Hey <@U04S8PLJWMT>, our server running 1.6.2 has s...
# ask-ai
e
Hey @kapa.ai, our server running 1.6.2 has started outputting logs like this:
Copy code
2025-08-29 12:15:29.753	
pod=stuart-server-598645c47c-5dx24 2025-08-29 10:15:29,752 [io-executor-thread-8] [1;31mERROR[0;39m i.a.c.s.e.h.KnownExceptionHandler(handle):34 - Known Exception: class KnownExceptionInfo {
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 }
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 details: null
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 rootCauseExceptionStack: []
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 rootCauseExceptionClassName: null
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 exceptionStack: [io.airbyte.commons.server.errors.ConflictException: Failed to access database. Check the server logs for more information, at io.airbyte.server.apis.ApiHelper.execute(ApiHelper.kt:45), at io.airbyte.server.apis.controllers.ConnectionApiController.postprocessDiscoveredCatalogForConnection(ConnectionApiController.kt:384), at io.airbyte.server.apis.controllers.$ConnectionApiController$Definition$Exec.dispatch(Unknown Source), at io.micronaut.context.AbstractExecutableMethodsDefinition$DispatchedExecutableMethod.invokeUnsafe(AbstractExecutableMethodsDefinition.java:461), at io.micronaut.context.DefaultBeanContext$BeanContextUnsafeExecutionHandle.invokeUnsafe(DefaultBeanContext.java:4354), at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:272), at io.micronaut.web.router.DefaultUriRouteMatch.execute(DefaultUriRouteMatch.java:38), at io.micronaut.http.server.RouteExecutor.executeRouteAndConvertBody(RouteExecutor.java:488), at io.micronaut.http.server.RouteExecutor.lambda$callRoute$5(RouteExecutor.java:465), at io.micronaut.core.execution.ExecutionFlow.lambda$async$1(ExecutionFlow.java:87), at io.micronaut.core.propagation.PropagatedContext.lambda$wrap$3(PropagatedContext.java:211), at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144), at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642), at java.base/java.lang.Thread.run(Thread.java:1583)]
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 exceptionClassName: io.airbyte.commons.server.errors.ConflictException
	2025-08-29 12:15:05.833	
pod=stuart-server-598645c47c-5dx24 message: Failed to access database. Check the server logs for more information
It was struggling to access the db for a while last night and was failing to perform ingestions. However, we restarted the server and it was able to begin ingestions again
k
It looks like Airbyte Server is intermittently failing on DB access, then recovering after a restart. Similar symptoms have been reported when: - The DB is temporarily unavailable or rejecting connections (e.g., container restart/backoff, bad permissions, or network issues), which surface as “Failed to access database” and HTTP 409 in the UI/API (see examples and stack traces matching yours) ([“Failed to access database” 409](https://github.com/airbytehq/airbyte/issues/54150), [Helm 1.8.0 thread](https://github.com/airbytehq/airbyte/issues/65096)). - Postgres misconfiguration or startup problems (permissions on data dir; service backoff) leading to connection refusals until the DB comes back up ([abctl Postgres backoff/permissions](https://github.com/airbytehq/airbyte/issues/54199)). - Version/migration-related states where the server can start but later DB queries fail; some users resolved by moving to a stable patch (e.g., 1.5.1 vs. problematic releases) ([upgrade threads and temporary fixes](https://github.com/airbytehq/airbyte/issues/58587), [409 resolved by 1.5.1 images](https://github.com/airbytehq/airbyte/issues/54150)). Recommended checks: - Inspect airbyte-db pod logs during the failure window for restarts, permission errors, or connection refusal; ensure the DB is Ready and stable (no BackOff) ([abctl Postgres issue](https://github.com/airbytehq/airbyte/issues/54199)). - Verify Airbyte Server logs around “Failed to access database” to see if it aligns with DB restarts or migrations; confirm DB version and migration status show as available and at required versions when healthy ([detailed server logs with availability/migrations](https://github.com/airbytehq/airbyte/issues/54150)). - If this started after upgrading components, consider pinning to a known-good patch level while investigating (users reported stability after switching images) ([reported workaround](https://github.com/airbytehq/airbyte/issues/54150), [release advisory](https://github.com/airbytehq/airbyte/issues/58587)). If you can share the airbyte-db pod events/logs from the timeframe of the failures, I can help pinpoint whether it’s DB restarts, permission issues, or a migration/compatibility edge.
e
@kapa.ai, we use an RDS as our airbyte db
k
A message from kapa.ai
Thanks. Given you’re using RDS for the Airbyte internal database, the “Failed to access database”/HTTP 409 pattern you saw aligns with transient connectivity or auth issues between Airbyte and the external Postgres, which can cause ingestion failures and then recover after restart. What to check on RDS setups: - Network/DNS reachability from all Airbyte pods to the RDS endpoint (VPC/security groups, firewall rules). Similar RDS cases were resolved by fixing firewall/VPC allow rules or DNS resolution of the RDS hostname (nslookup/dig/psql test) ([RDS connectivity/firewall fix](https://discuss.airbyte.io/t/2179) and the official guidance on DNS resolution issues with RDS hostnames) ([Pod-airbyte-bootloader error](https://github.com/airbytehq/airbyte/discussions/45177)). - Credentials/permissions: ensure the configured DB user/password are correct and that the user can access the Airbyte DB. A common RDS error is password auth failures blocking the bootloader/server until fixed ([Cannot connect to External RDS: password auth failed](https://github.com/airbytehq/airbyte/issues/48854)). - Temporal databases: if you run Temporal on external Postgres, the user must be able to create/access temporal and temporal_visibility or you must pre-create them and grant privileges; otherwise startup errors occur ([create temporal and temporal_visibility, grant privileges](https://discuss.airbyte.io/t/1544)). - Intermittent timeouts: similar “UpdateTaskQueue ... connection timed out” errors were ultimately traced to network path issues between on‑prem Airbyte and cloud RDS, resolved by adjusting firewall/security rules ([RDS timeouts resolved via firewall changes](https://discuss.airbyte.io/t/2179)). If deploying via Helm, confirm: - External DB settings are correctly placed in values and the airbyte-config-secrets (database-user/password) exists before install; also ensure the keys are at the correct level and the cluster can reach the RDS hostname ([Helm external DB config/secret requirement](https://docs.airbyte.com/platform/1.6/enterprise-setup/implementation-guide#configuring-the-airbyte-database), [helm cannot connect to RDS: missing secret / SGs](https://github.com/airbytehq/airbyte/issues/48854), [config placement/DNS note](https://github.com/airbytehq/airbyte/discussions/45177)). Next steps to stabilize: - From an Airbyte pod, test: psql "host=<rds-endpoint> dbname=<db> user=<user>" and monitor RDS connections/latency at the failure window. If you see timeouts, review SG/firewall/NACLs and RDS parameter group. - Verify server/bootloader logs around the error for auth vs. timeout signatures; if Temporal is external, ensure the two Temporal DBs exist and privileges are correct ([temporal DBs + grants](https://discuss.airbyte.io/t/1544)). If you share the exact RDS error (timeout vs. auth) and your Helm/values and SG setup, I can point to the likely fix.
e
@kapa.ai, we performed an update to 1.8.1 yesterday and had to move back down to 1.6.2. I manually had to update a table to get this to work. How do I safely perform roll back migrations of the Airbyte db in these instances?
k
A message from kapa.ai
Short answer: there is no documented, general-purpose “roll back Airbyte database migrations” procedure. The docs and community threads recommend either: - Avoiding the need to roll back by testing upgrades and using an external DB with backups you can restore, or - Restoring the DB from a backup taken prior to the upgrade. What you can do safely next time: - Before upgrading, back up the Airbyte Postgres database (and Temporal/Temporal Visibility if external). If you use the internal Postgres, follow the documented pg_dump approach; for external Postgres (e.g., RDS), take a snapshot or pg_dump of each DB. If you need to roll back, restore the backup/snapshot instead of manually editing tables ([Helm V2 upgrade guide: backup and restore steps](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade); restore guidance is provided for the internal DB and is analogous for external DBs via standard Postgres restore) ([Deploy Airbyte > Restore your database](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#deploy-airbyte)). - When using an external database, configure it properly and plan backups. The platform docs emphasize using an external Postgres for production and show how to wire it via Helm secrets/values; this setup enables clean restore-based rollbacks instead of schema hacking ([External database setup](https://docs.airbyte.com/platform/deploying-airbyte/integrations/database)). Why manual table edits aren’t recommended: - Migration failures across versions have occurred before; community workarounds included ad-hoc SQL, but those were situational and not an endorsed rollback path. The reliable rollback is to restore the pre-upgrade database state ([examples of migration issues and user SQL workarounds, not official guidance](https://github.com/airbytehq/airbyte/issues/36855); recent migration failures reported with abctl upgrades underline the need for backups/snapshots before upgrading or downgrading ([abctl migration failing example](https://github.com/airbytehq/airbyte/issues/55251))). Practical rollback playbook for your case (RDS): - Take an RDS snapshot (or pg_dump) before upgrading. - If you must revert (e.g., from 1.8.1 back to 1.6.2), stop Airbyte, restore the snapshot to a new RDS instance (or drop/recreate and restore from pg_dump), point Airbyte back to that restored instance, and start Airbyte. This mirrors the documented internal-DB restore flow, adapted to RDS standard Postgres practices ([Backup/restore pattern around upgrades](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade); [deploy/restore flow](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#deploy-airbyte)). If you share exactly which migration broke on 1.8.1, we can check if there’s a published mitigation. Otherwise, the supported/safe route is snapshot/backup-based restore rather than schema-level rollbacks.
e
@kapa.ai, aye obviously taking manual snapshots or dumps is the best way to proceed. However, we deployed Airbyte successfully in our staging area with 0 issues so were not expecting to have to downgrade. In the future I will. However, for now, we don’t have a time machine to redo this. As such, I want some practical advice on what might be a safe way to do this in the future
k
A message from kapa.ai
Understood. Given the constraints, here’s a practical, low‑friction playbook to make future upgrades/downgrades safe without manual table edits: - Always use an external Postgres for Airbyte (e.g., RDS) and configure it via Helm secrets/values. This is the recommended production setup and makes backup/restore straightforward (external DB config and secret requirements) ([External database](https://docs.airbyte.com/platform/deploying-airbyte/integrations/database)). - Take a database backup before any upgrade. For internal DB, use pg_dump as documented; for external (RDS), take a snapshot or pg_dump of each DB used by Airbyte (airbyte, and if applicable temporal and temporal_visibility). The official upgrade guides explicitly instruct backing up and provide the restore flow you can mirror on RDS ([How to upgrade: backup step](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade), [Restore your database](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#deploy-airbyte)). - Keep a DR‑style second cluster on the same version for tests, especially if Airbyte is business‑critical. The docs recommend DR with external DB/logs/secrets and version parity; this doubles as a safe place to validate migrations before prod ([DR regions recommendations](https://docs.airbyte.com/platform/1.6/enterprise-setup/scaling-airbyte#disaster-recovery-dr-regions)). - If you must roll back: stop Airbyte, restore the pre‑upgrade backup/snapshot to a clean Postgres (or drop/recreate schema and restore), and repoint Airbyte to that instance. This is the supported pattern vs. schema edits (mirrors the documented restore steps, adapted to external DBs) ([Restore your database](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#deploy-airbyte)). - For RDS specifically, ensure the target Postgres version is compatible and precreate required databases if you externalize Temporal (airbyte, temporal, temporal_visibility), then restore into them. Users reported success with explicit DB creation and version matching during external DB moves ([External Postgres setup issues—create DBs, version note](https://github.com/airbytehq/airbyte/issues/49304)). - During Helm upgrades, deploy into a new namespace when feasible and reuse the same external DB only after validation; otherwise keep the existing namespace for internal DB upgrades as documented. This isolates issues and simplifies rollback by switching DB endpoints or namespace versions ([Upgrade to Helm chart V2: new namespace guidance](https://docs.airbyte.com/platform/next/deploying-airbyte/chart-v2-community#how-to-upgrade)). Limitations: There’s no official, generic “down-migration” for the Airbyte DB; the safe rollback is restore-from-backup. If you don’t have a pre‑upgrade backup, the knowledge sources don’t provide a supported SQL path to revert schema changes; proceed by restoring from the most recent good backup and reapplying minimal configuration changes ([Upgrade docs emphasize backup/restore, not SQL rollbacks](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade)).