Hi <@U04S8PLJWMT> I tried to setup the airbyte usi...
# ask-ai
r
Hi @kapa.ai I tried to setup the airbyte using the helm chart but Iam getting an error of PostgreSQL Database directory appears to contain a database; Skipping initialization 2025-07-30 094354.201 UTC [9] LOG: starting PostgreSQL 13.20 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit 2025-07-30 094354.201 UTC [9] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-07-30 094354.201 UTC [9] LOG: listening on IPv6 address "::", port 5432 2025-07-30 094354.206 UTC [9] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-07-30 094354.214 UTC [17] LOG: database system was interrupted; last known up at 2025-07-30 093932 UTC 2025-07-30 094354.251 UTC [17] LOG: database system was not properly shut down; automatic recovery in progress 2025-07-30 094354.255 UTC [17] LOG: redo starts at 0/16380B60 2025-07-30 094354.265 UTC [17] LOG: invalid record length at 0/163C31B8: wanted 24, got 0 2025-07-30 094354.265 UTC [17] LOG: redo done at 0/163C3190 2025-07-30 094354.301 UTC [9] LOG: database system is ready to accept connections 2025-07-30 094357.469 UTC [30] FATAL: database "db-airbyte" does not exist 2025-07-30 094402.472 UTC [36] FATAL: database "db-airbyte" does not exist 2025-07-30 094407.475 UTC [37] FATAL: database "db-airbyte" does not exist
k
The error message you are seeing—`database "db-airbyte" does not exist`—indicates that while the PostgreSQL server is running, the required Airbyte database has not been created. This is a common issue when the database directory already exists (so initialization is skipped), but the specific database Airbyte expects (
db-airbyte
) is missing. Solution: You need to manually create the
db-airbyte
database in your PostgreSQL instance. This can be done by connecting to your running PostgreSQL pod and executing the following command:
Copy code
bash kubectl -n <your-namespace> exec -it <airbyte-db-pod> -- psql --user airbyte --dbname postgres --command='create database "db-airbyte"'
Replace
<your-namespace>
and
<airbyte-db-pod>
with your actual Kubernetes namespace and pod name. This approach has resolved the same error for other users installing Airbyte via Helm, as documented in the knowledge sources. After creating the database, the Airbyte bootloader should be able to connect and complete the installation process successfully [Unable to install Airbyte locally - Unable to connect to the database](https://github.com/airbytehq/airbyte/issues/45456). If you are using an external Postgres instance, ensure that the database is created and accessible with the correct user and permissions before running the Airbyte Helm chart [External Postgres Database Setup Issues](https://github.com/airbytehq/airbyte/issues/49304). Summary: - The error is due to the missing
db-airbyte
database. - Manually create the database as shown above. - Re-run or continue your Airbyte installation. Let me know if you need the exact command for your environment!
r
can I delete the directory from pvc and again initioalize the pod
@kapa.ai can I delete the directory from pvc and again initioalize the pod
k
A message from kapa.ai
The knowledge sources do not explicitly mention deleting the directory from a PersistentVolumeClaim (PVC) and reinitializing the pod as a recommended or supported solution for Airbyte deployments. However, there are related instructions for resetting the Airbyte environment, which involve deleting persistent data and reinstalling Airbyte. For local development, the official documentation suggests using commands like:
Copy code
bash abctl local uninstall --persisted rm -rf ~/.airbyte/ abctl local install --values values.yaml
This process removes the persisted data and reinitializes the environment, effectively starting from a clean state. However, this is done via Airbyte's tooling and not by manually deleting directories inside the PVC from within the pod or Kubernetes directly. There is no guidance in the sources about manually deleting files from a PVC, and doing so could lead to unexpected issues if not handled carefully by the application or its initialization scripts [Resetting the Airbyte developer environment](https://docs.airbyte.com/platform/1.6/contributing-to-airbyte/developing-locally#resetting-the-airbyte-developer-environment). In summary: There is no official documentation or community guidance in the provided sources that recommends manually deleting the directory from a PVC and reinitializing the pod for Airbyte. The supported approach is to use Airbyte's uninstall/reset commands to clear persistent data and reinstall. If you need to reset your environment, it is safer to follow the documented reset procedures rather than manually deleting files from the PVC.
r
Hi @kapa.ai The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.utf8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... ok sh: locale: not found 2025-07-30 095548.520 UTC [25] WARNING: no usable system locales were found performing post-bootstrap initialization ... ok syncing data to disk ... ok Success. You can now start the database server using: initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. pg_ctl -D /var/lib/postgresql/data/pgdata -l logfile start waiting for server to start....2025-07-30 095549.070 UTC [31] LOG: starting PostgreSQL 13.20 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit 2025-07-30 095549.072 UTC [31] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-07-30 095549.082 UTC [32] LOG: database system was shut down at 2025-07-30 095548 UTC 2025-07-30 095549.087 UTC [31] LOG: database system is ready to accept connections done server started CREATE DATABASE /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/000_init.sql ALTER SYSTEM waiting for server to shut down...2025-07-30 095549.247 UTC [31] LOG: received fast shutdown request .2025-07-30 095549.250 UTC [31] LOG: aborting any active transactions 2025-07-30 095549.251 UTC [31] LOG: background worker "logical replication launcher" (PID 38) exited with exit code 1 2025-07-30 095549.252 UTC [33] LOG: shutting down 2025-07-30 095549.275 UTC [31] LOG: database system is shut down done server stopped PostgreSQL init process complete; ready for start up. 2025-07-30 095549.371 UTC [9] LOG: starting PostgreSQL 13.20 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit 2025-07-30 095549.372 UTC [9] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-07-30 095549.372 UTC [9] LOG: listening on IPv6 address "::", port 5432 2025-07-30 095549.376 UTC [9] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-07-30 095549.384 UTC [48] LOG: database system was shut down at 2025-07-30 095549 UTC 2025-07-30 095549.393 UTC [9] LOG: database system is ready to accept connections 2025-07-30 095550.049 UTC [55] FATAL: database "temporal" does not exist 2025-07-30 095550.124 UTC [56] FATAL: database "temporal" does not exist 2025-07-30 095550.254 UTC [57] FATAL: database "temporal" does not exist 2025-07-30 095551.103 UTC [58] FATAL: database "temporal" does not exist 2025-07-30 095551.175 UTC [59] FATAL: database "temporal" does not exist 2025-07-30 095551.308 UTC [60] FATAL: database "temporal" does not exist 2025-07-30 095551.533 UTC [61] FATAL: database "temporal_visibility" does not exist 2025-07-30 095551.776 UTC [62] FATAL: database "temporal_visibility" does not exist 2025-07-30 095552.151 UTC [63] FATAL: database "temporal" does not exist
k
A message from kapa.ai
Your logs show that PostgreSQL started successfully, but Airbyte (specifically Temporal) is failing because the required databases
temporal
and
temporal_visibility
do not exist:
Copy code
FATAL:  database "temporal" does not exist FATAL:  database "temporal_visibility" does not exist
This is a common issue when deploying Airbyte with a fresh or manually-initialized Postgres instance. Airbyte expects the
temporal
and
temporal_visibility
databases to be present. If they are missing, Airbyte (or the Temporal component) will attempt to create them, but if the configured user does not have permission to create databases, or if the initialization scripts do not run as expected, you will see these errors. Solution: You need to manually create the
temporal
and
temporal_visibility
databases and grant the necessary privileges to the Airbyte user. This is confirmed by both official Airbyte support and multiple user reports:
Copy code
sql CREATE DATABASE temporal; GRANT ALL PRIVILEGES ON DATABASE temporal TO airbyte;  CREATE DATABASE temporal_visibility; GRANT ALL PRIVILEGES ON DATABASE temporal_visibility TO airbyte;
Run these commands as a superuser (e.g.,
postgres
) in your PostgreSQL instance. After this, restart your Airbyte pods and the errors should be resolved. This approach is directly recommended in the official Airbyte forum and GitHub issues [Forum: "Unable to create SQL database." when trying to connect to an external database](https://discuss.airbyte.io/t/1544) [External Postgres Database Setup Issues](https://github.com/airbytehq/airbyte/issues/49304). Summary: - The error is because the
temporal
and
temporal_visibility
databases do not exist. - Manually create these databases and grant privileges to the Airbyte user. - Restart your Airbyte deployment. If you continue to see issues after creating the databases, please share the new logs for further troubleshooting.
r
@kapa.ai please give me helm values to setup the temporal database in airbyte
k
A message from kapa.ai
To configure the Temporal database for Airbyte using the Helm chart, you need to: 1. Disable the internal Postgres (if using an external database). 2. Provide the external database details in your
values.yaml
. 3. (Optional but recommended): Pre-create the
temporal
and
temporal_visibility
databases in your Postgres instance and grant the necessary privileges to the Airbyte user, as the Temporal auto-setup may require database creation permissions otherwise. Here is an example
values.yaml
configuration for setting up Temporal with an external Postgres database:
Copy code
yaml postgresql:   enabled: false  global:   database:     type: external     secretName: "airbyte-config-secrets"  # Name of the Kubernetes secret containing DB credentials     host: "<your-postgres-host>"     port: "5432"     database: "airbyte"                   # Airbyte's main database     userSecretKey: "database-user"     passwordSecretKey: "database-password"  temporal:   extraEnv:     - name: DBNAME       value: "temporal"     - name: VISIBILITY_DBNAME       value: "temporal_visibility"     - name: SKIP_DB_CREATE       value: "true"  # Set to true if you have pre-created the databases     - name: SQL_TLS_ENABLED       value: "true"  # Enable if your DB requires TLS     - name: POSTGRES_TLS_ENABLED       value: "true"  # Enable if your DB requires TLS     - name: POSTGRES_TLS_DISABLE_HOST_VERIFICATION       value: "true"  # Use with caution; disables host verification
Notes: - The
temporal.extraEnv
section allows you to specify the database names and skip DB creation if you have already created them manually. This is useful in environments where the DB user does not have permission to create databases. - Make sure your Kubernetes secret (
airbyte-config-secrets
) contains the correct user and password for your Postgres instance. - If you are using TLS, set the appropriate environment variables as shown above. This configuration is based on community best practices and examples from Airbyte's documentation and GitHub issues [Configuring the Airbyte Database](https://docs.airbyte.com/platform/next/enterprise-setup/implementation-guide#configuring-the-airbyte-database), [Helm Chart: make temporal and temporal_visibility databases configurable](https://github.com/airbytehq/airbyte/issues/11157), and [Temporal v1.23.0 fails to start with error: Unable to create SQL database, but v1.20.1 works fine.](https://github.com/airbytehq/airbyte/issues/38593). If you need to use custom database names for Temporal, adjust the
DBNAME
and
VISIBILITY_DBNAME
values accordingly.
r
@kapa.ai I wanted to use the internal database
k
A message from kapa.ai
If you want to use the internal database for Airbyte and Temporal, you should set the following in your `values.yaml`:
Copy code
yaml postgresql:   enabled: true  global:   database:     type: internal
With this configuration, Airbyte will deploy and use the internal PostgreSQL database that comes with the Helm chart. You do not need to provide external database connection details or secrets. The internal database will be automatically initialized and managed by Airbyte. This approach is confirmed in the official documentation, which states that enabling the internal Postgres is the default and recommended for non-production or simple deployments [Configuring the Airbyte Database](https://docs.airbyte.com/platform/1.6/enterprise-setup/implementation-guide#configuring-the-airbyte-database). If you encounter issues with the internal database (such as leftover data or initialization problems), you may need to delete the associated PersistentVolumeClaim (PVC) to reset the database state, but this is not covered in detail in the provided knowledge sources. Summary: - Set
postgresql.enabled: true
and
global.database.type: internal
in your Helm values. - No need to configure external database secrets or connection info.
r
@kapa.ai I did the same but still asking for the temporal database creation
k
A message from kapa.ai
If you are using the internal database (
postgresql.enabled: true
and
global.database.type: internal
) but Airbyte is still asking for the creation of the
temporal
and
temporal_visibility
databases, this suggests that something is not working as expected with the internal Postgres initialization. Based on the knowledge sources, this issue can occur if: - The internal Postgres data directory (PVC) was not properly initialized or was left in a partial state from a previous failed deployment. - There is a mismatch or misconfiguration in the Helm values, or the pods are not picking up the correct configuration. Troubleshooting steps from the knowledge sources: 1. Check for leftover data: If the PVC for the internal Postgres already contains data from a previous deployment, the initialization scripts may be skipped, and the required databases (
temporal
,
temporal_visibility
) may not be created. This is indicated by logs such as:
Copy code
PostgreSQL Database directory appears to contain a database; Skipping initialization
In this case, you may need to delete the PVC associated with the internal Postgres to force a fresh initialization. However, the knowledge sources do not provide explicit instructions for this, so proceed with caution and ensure you do not need any existing data. 2. Manual database creation: If the databases are missing, you can manually create them by connecting to the internal Postgres pod and running:
Copy code
sql    CREATE DATABASE temporal;    CREATE DATABASE temporal_visibility;
This is a workaround mentioned in several sources for both internal and external setups when the databases are missing and the application cannot create them automatically due to permissions or initialization issues [Forum: "Unable to create SQL database." when trying to connect to an external database](https://discuss.airbyte.io/t/1544). 3. Check Helm values: Ensure your
values.yaml
does not have conflicting settings (e.g., both internal and external database settings enabled). 4. Pod logs: Review the logs for the Postgres and Airbyte pods for any errors related to database initialization or permissions. Summary: - This issue is often caused by a partially-initialized or leftover Postgres data directory. - Deleting the PVC (if you do not need the data) and redeploying can resolve it. - Alternatively, manually create the missing databases inside the Postgres pod. If you continue to have issues, please provide the relevant pod logs and your current
values.yaml
configuration for further troubleshooting. The knowledge sources do not provide a more specific solution for this scenario.
r
@kapa.ai I have inside the database pod how can run connect to the database and create the temporal databases
k
A message from kapa.ai
To create the
temporal
and
temporal_visibility
databases from inside the database pod, you can use the
psql
command-line tool. Here’s how you can do it, based on the knowledge sources: 1. Access the Postgres pod (replace
<your-namespace>
and
<postgres-pod-name>
with your actual values):
Copy code
bash    kubectl -n <your-namespace> exec -it <postgres-pod-name> -- bash
2. Connect to the Postgres server as the
postgres
user (or the user with sufficient privileges):
Copy code
bash    psql -U postgres
3. Create the required databases and grant privileges (replace
airbyte
with your Airbyte DB user if different):
Copy code
sql    CREATE DATABASE temporal;    GRANT ALL PRIVILEGES ON DATABASE temporal TO airbyte;     CREATE DATABASE temporal_visibility;    GRANT ALL PRIVILEGES ON DATABASE temporal_visibility TO airbyte;
This process is confirmed as the solution in the official Airbyte forum and GitHub issues for both internal and external Postgres setups [Forum: "Unable to create SQL database." when trying to connect to an external database](https://discuss.airbyte.io/t/1544). If you encounter a permissions error, ensure you are connecting as a user with the necessary rights to create databases. After running these commands, you can exit
psql
and the pod, then restart your Airbyte pods if needed.
r
Hi @kapa.ai psql: error: FATAL: role "postgres" does not exist I am getting this error wen I run connection command
k
A message from kapa.ai
The error
psql: error: FATAL:  role "postgres" does not exist
means that the
postgres
user (role) does not exist in your database instance. This can happen if the internal Airbyte Postgres was initialized with a different default user, or if the Helm chart or Docker image used a custom user. What to do: 1. Check the available users: You can try connecting as the
airbyte
user, which is commonly used by Airbyte's internal Postgres setup. For example:
Copy code
bash    psql -U airbyte
2. If you don't know the user: - Check your Helm
values.yaml
for the configured Postgres user. - You can also look at the environment variables or secrets used by the Postgres pod for the username. 3. If you still can't connect: - You may need to check the pod logs or the initialization scripts to see which user was created. - If the database was initialized without a
postgres
superuser, you must use the user that was actually created during initialization. Summary: Try connecting with
psql -U airbyte
instead of
psql -U postgres
. If that doesn't work, check your configuration for the correct username. The knowledge sources confirm that the default user is often
airbyte
in Airbyte's internal Postgres deployments, not always
postgres
[Tutorial: Build an EL(T) from Postgres CDC (Change Data Capture)](https://airbyte.com/tutorials/postgresql-change-data-capture-elt#step-2). If you still have trouble, please provide the output of
psql --help
or the list of users if you can connect with any user.
r
@kapa.ai airbyte database is also not present
k
A message from kapa.ai
If the
airbyte
database is also not present in your internal Postgres instance, this indicates that the database initialization did not complete as expected. This situation is documented in the knowledge sources: when the required databases (
airbyte
,
temporal
,
temporal_visibility
) are missing, Airbyte components will fail to start and log errors about missing databases. Solution: You need to manually create the
airbyte
,
temporal
, and
temporal_visibility
databases. This has been confirmed as a working solution by users and support in the Airbyte community:
Copy code
sql CREATE DATABASE airbyte; GRANT ALL PRIVILEGES ON DATABASE airbyte TO airbyte;  CREATE DATABASE temporal; GRANT ALL PRIVILEGES ON DATABASE temporal TO airbyte;  CREATE DATABASE temporal_visibility; GRANT ALL PRIVILEGES ON DATABASE temporal_visibility TO airbyte;
You should run these commands as a user with sufficient privileges (often the
airbyte
user in internal deployments). If you are unable to connect as
postgres
, try connecting as
airbyte
or the user specified in your Helm values or environment variables. If you do not know the user, you may need to check your deployment configuration for the correct username. This approach is directly recommended in the official Airbyte forum and GitHub issues for both internal and external Postgres setups. Manually creating the databases resolves the startup errors and allows Airbyte to function properly [Forum: "Unable to create SQL database." when trying to connect to an external database](https://discuss.airbyte.io/t/1544). If you continue to have trouble connecting or creating the databases, please provide the exact error message and the user you are attempting to connect with.