Júlia Lemes
09/03/2025, 5:12 PMkapa.ai
09/03/2025, 5:12 PMMountVolume.SetUp failed for volume "airbyte-local-pv" : mkdir /var/local-path-provisioner/airbyte-local-pv: no such file or directory indicates that the Kubernetes cluster cannot create or access the directory for the persistent volume. This is a cluster/storage configuration issue, not directly related to the database migration. You need to ensure that the local-path-provisioner is installed and configured correctly, and that the directory /var/local-path-provisioner/airbyte-local-pv exists on the node(s) where the pod is scheduled. This is a common issue when using local-path provisioner on KIND or Minikube clusters. Fixing this is required for Airbyte to function properly, regardless of the database backend. ### 2. Database Errors The logs: ERROR: database "temporal" already exists ERROR: database "temporal_visibility" already exists ERROR: duplicate key value violates unique constraint "namespaces_pkey" FATAL: could not open file "global/pg_filenode.map": No such file or directory suggest that: - The migration or install process is trying to create databases (temporal, temporal_visibility) that already exist. This is expected if you have already migrated or restored these databases manually, as recommended in the documentation and user experiences. You can safely ignore the "already exists" errors if the databases are intact and contain the correct schema and data. - The "duplicate key value violates unique constraint" error may indicate that the migration process is trying to insert data that already exists. This can happen if the migration is re-run on a database that already contains Airbyte/Temporal data. - The "could not open file ... No such file or directory" error is more severe and usually indicates database corruption or a mismatch between the database files and the running Postgres version. This can happen if the database files were copied incorrectly or if the Postgres version changed between backups/restores. ### 3. Migration Steps According to the documentation, when migrating to an external database, you should: - Manually create the airbyte, temporal, and temporal_visibility databases in your external Postgres instance before running the migration, as the Airbyte installer expects them to exist and may not have permission to create them itself. This is confirmed by user reports and the official docs [[External Database Setup](https://docs.airbyte.com/platform/deploying-airbyte/integrations/database)]. - Ensure that your values.yaml and secrets.yaml are correctly configured to point to the external database, and that the secrets contain the correct credentials [[External Database Setup](https://docs.airbyte.com/platform/deploying-airbyte/integrations/database)]. - If you restored the databases from a backup, make sure the Postgres version matches between the source and target, as version mismatches can cause file-level errors and corruption [[External Database Setup Issues](https://github.com/airbytehq/airbyte/issues/49304)]. ### 4. Recommendations - Fix the volume mount issue first: Airbyte cannot function if the persistent volumes are not available. - Verify your external database: Make sure the airbyte, temporal, and temporal_visibility databases exist and are accessible with the credentials provided in your secrets. - Check for database corruption: The "could not open file" error suggests possible corruption. If you restored from a backup, ensure the backup and restore process was clean and the Postgres versions match. - Ignore "already exists" errors: These are expected if the databases were pre-created. - If you see unique constraint errors: Double-check that the migration process is not being run multiple times or on a database that already contains all the necessary data. If you continue to see the "could not open file" error, you may need to restore your database from a clean backup or re-initialize it, ensuring version compatibility. If you need more specific troubleshooting, please provide details about your external database setup, how you migrated the data, and the Postgres versions involved. References integrated above from: - [External Database Setup](https://docs.airbyte.com/platform/deploying-airbyte/integrations/database) - [External Postgres Database Setup Issues](https://github.com/airbytehq/airbyte/issues/49304)Júlia Lemes
09/03/2025, 5:16 PMkapa.ai
09/03/2025, 5:16 PMkapa.ai
09/03/2025, 5:17 PMpg_dump to export the databases (airbyte, temporal, temporal_visibility) and then restoring them into your RDS Postgres 14 instance—is correct and aligns with recommended practices for moving Airbyte to an external database. This is also confirmed by user experiences and official guidance: you must manually back up and restore each database, as Airbyte does not automatically migrate internal data to an external database [[Connecting to an External Postgres database](https://discuss.airbyte.io/t/2903)]. Key points to ensure a successful migration: 1. Database Creation: Before restoring, you must manually create the target databases (airbyte, temporal, temporal_visibility) in your RDS instance, and grant the correct privileges to the Airbyte user. For example: sql CREATE DATABASE airbyte WITH OWNER = airbyte; CREATE DATABASE temporal WITH OWNER = airbyte; CREATE DATABASE temporal_visibility WITH OWNER = airbyte; This step is required because Airbyte expects these databases to exist and may not have permission to create them itself [[Forum Post: Unable to create SQL database](https://discuss.airbyte.io/t/1544)]. 2. Restore Process: Use the following commands to restore each dump into its respective database: bash psql -h <rds-endpoint> -U <user> -d airbyte -f airbyte_backup.sql psql -h <rds-endpoint> -U <user> -d temporal -f temporal_backup_staging_2.sql psql -h <rds-endpoint> -U <user> -d temporal_visibility -f temporal_visibility_backup_staging_2.sql Make sure you are restoring each dump into the correct database. 3. Version Compatibility: Your source and target Postgres versions should be compatible. Migrating from a lower version to a higher version (e.g., from Postgres 13 to 14) is generally supported, but not the reverse. The knowledge sources confirm that Postgres 14 is supported for Airbyte external databases [[Minimal Postgres Version Supported](https://github.com/airbytehq/airbyte/issues/48542)]. 4. Configuration: Update your Airbyte deployment configuration (values.yaml and secrets) to point to the new RDS instance, ensuring the credentials and host information are correct [[Configuring the Airbyte Database](https://docs.airbyte.com/platform/enterprise-setup/implementation-guide#configuring-the-airbyte-database)]. If you encounter errors such as duplicate keys or missing files: - Duplicate key errors may indicate the restore is being run on a non-empty database. Ensure the target databases are empty before restoring. - "Could not open file" errors typically indicate database corruption or a mismatch in the backup/restore process. Ensure the backup and restore steps are clean and that you are not mixing up database files. Summary: Your migration steps are correct according to Airbyte documentation and community experience. Just ensure the databases are created and empty before restore, and that your Airbyte configuration points to the new RDS instance. If you follow these steps, your Airbyte instance should work with the external RDS Postgres 14 database. If you encounter specific errors during restore or startup, please provide the exact error messages for more targeted troubleshooting.Júlia Lemes
09/03/2025, 5:20 PMkapa.ai
09/03/2025, 5:21 PMkapa.ai
09/03/2025, 5:21 PMRUN_DATABASE_MIGRATION_ON_STARTUP environment variable resolved their issue, as the migration logic had changed between versions [[Forum Post: Airbyte wont start after updating](https://discuss.airbyte.io/t/3843)]. - RDS/Postgres Specific Issues: Some users found that migrations failed specifically on RDS or external Postgres, but worked on local Docker databases. This suggests that certain migrations or schema checks may behave differently depending on the database backend or permissions [[Forum Post: Upgrade migration failing](https://discuss.airbyte.io/t/4667)]. - Manual Intervention Required: In some cases, manual cleanup or adjustment of the database (such as removing deprecated fields or ensuring all migrations have run) was necessary for the update to succeed. If the database is not in a clean state, updates can fail, but a fresh install (which creates a new schema) works without issue. In summary: The most likely cause is a migration or schema mismatch between your existing database and the new Airbyte version. A fresh install works because it creates a new, clean schema that matches the expected structure for the new version. Updates fail if the migration scripts cannot handle the existing data or schema. Recommendation: - Review your environment variables and configuration for deprecated or changed settings. - Check the Airbyte release notes for breaking changes or required manual migration steps. - If possible, test the migration on a copy of your database to identify and resolve schema issues before updating your production instance. If you need more specific help, providing the exact error messages from the update process would be helpful for further troubleshooting.