<@U04S8PLJWMT> In my Linux I already had a Airbyte...
# ask-ai
j
@kapa.ai In my Linux I already had a Airbyte 0.62 docker installed, the internal postgres database is on localhost port 5432. Then I installed a newer version of Airbyte (1.8.1) with kubernetes and need to find where the internal database is.
k
When you install Airbyte with Docker (as in your 0.62 setup), the internal Postgres database typically runs as a Docker container, and is accessible on
localhost:5432
if you mapped the port in your
docker-compose.yml
. However, when you install Airbyte with Kubernetes (as in your 1.8.1 setup), the internal Postgres database—if you use the default configuration—runs as a Kubernetes Pod, not directly on your Linux host. Its network location and access method are different: - Kubernetes Internal Database Location: By default, the internal Postgres database is deployed as a StatefulSet/Pod within your Kubernetes cluster. It is not directly accessible on your host's
localhost:5432
. Instead, it is exposed as a Kubernetes service, usually named something like
airbyte-db
or
airbyte-db-svc
within the Airbyte namespace. - How to Find the Database Pod and Service: You can list the pods and services in your Airbyte namespace (replace
airbyte
with your actual namespace if different):
Copy code
kubectl get pods -n airbyte   kubectl get svc -n airbyte
Look for pods/services with names like
airbyte-db-0
(pod) and
airbyte-db
or
airbyte-db-svc
(service). - How to Access the Database: To connect to the internal Postgres database running in Kubernetes, you typically need to port-forward the service to your local machine:
Copy code
kubectl port-forward svc/airbyte-db 5432:5432 -n airbyte
After running this command, you can connect to the database on
localhost:5432
as long as the port-forward is active. - Database Credentials: The credentials are usually stored in a Kubernetes secret, often named something like
airbyte-airbyte-secrets
. You can retrieve them with:
Copy code
kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data}'
The output will be base64-encoded; decode as needed to get the actual username and password. For example, to decode the password:
Copy code
echo '<base64-password>' | base64 --decode
For more details on how Airbyte manages its internal database in Kubernetes and how to back it up or migrate it, see the official documentation on [Upgrading to Helm chart V2](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade) and [Configuring the Airbyte Database](https://docs.airbyte.com/platform/enterprise-setup/implementation-guide#configuring-the-airbyte-database). If you used an external database (like AWS RDS) with your Kubernetes deployment, the database would not be inside the cluster, but from your question, it sounds like you are using the default internal database.
j
@kapa.ai The commands show the following: airbyte-db-svc ClusterIP 10.43.51.78 <none> 5432/TCP 35d airbyte-db-0 1/1 Running 0 35d Does this mean it is already port-forwarded? Or do I need to port forward it from 5432 to another one? Because I want to keep the old airbyte isntallation db available where it already is (5432)
k
A message from kapa.ai
No, seeing the
airbyte-db-svc
service running in your Kubernetes cluster does not mean it is already port-forwarded to your local machine. It means the Postgres database is running inside your Kubernetes cluster and is accessible to other pods in the same namespace via the internal cluster IP and port 5432. If you want to access this Kubernetes-managed Postgres database from your local machine (for example, to connect with a tool like
psql
), you must set up a port-forward. Since your old Airbyte Docker installation is already using
localhost:5432
, you should port-forward the Kubernetes service to a different local port to avoid conflicts. For example, to forward the Kubernetes Postgres service to local port 5433, run:
Copy code
bash kubectl port-forward svc/airbyte-db-svc 5433:5432 -n airbyte
After running this command, you can connect to the Kubernetes Postgres database at
localhost:5433
, while your old Docker-based database remains available at
localhost:5432
. This approach is consistent with the guidance in the Airbyte documentation, which explains that the internal database is exposed as a Kubernetes service and must be port-forwarded for local access. The documentation also shows that you can specify the namespace and the service name in your port-forward command to access the correct database instance [Airbyte port forwarding in Kubernetes namespace](https://discuss.airbyte.io/t/259). Summary: - The database is not automatically port-forwarded. - You need to port-forward it to a different local port (e.g., 5433) to avoid conflicts with your existing database. - Use the
kubectl port-forward
command as shown above.
j
@kapa.ai I'm trying to create a source connector to the internal airbyte database. My installation is 1.8.1 with kubernetes. The host and port I'm using are airbyte-db-svc.airbyte.svc.cluster.local and 5432. Apparently host port user and password all passed the check, but I'm getting an error regarding the Database "airbyte". What would be the database for this installation?
k
A message from kapa.ai
Based on the official Airbyte documentation for Kubernetes deployments (including versions 1.6, 1.7, and "Next"), the default database name used by Airbyte's internal Postgres instance is typically airbyte. This is shown in the example Kubernetes secrets and
values.yaml
configurations:
Copy code
yaml # Example from the docs: stringData:   # Database Secrets   database-user: ## e.g. airbyte   database-password: ## e.g. password
And in the Helm values:
Copy code
yaml global:   database:     database: ""  # This should be set to "airbyte"
([Source: External Database Integration](https://docs.airbyte.com/platform/1.7/deploying-airbyte/integrations/database)) If you are getting an error regarding the database "airbyte", it is possible that: - The database name is not set to "airbyte" in your configuration, or - The database was not created properly during installation, or - There is a mismatch between the credentials or database name you are using and what is actually present in the Postgres instance. What you should check: 1. Database Name: The default should be
airbyte
. Double-check your source connector configuration to ensure you are using this name. 2. Credentials: Make sure the username and password match those stored in your Kubernetes secret (commonly
airbyte-config-secrets
). 3. Database Existence: If you have shell access to the Postgres pod, you can check the available databases:
Copy code
bash    kubectl exec -it airbyte-db-0 -n airbyte -- psql -U <username>    \l
Replace
<username>
with the value from your secret (often
airbyte
). If you have customized your Helm values or secrets, the database name could be different. But unless you changed it, the default is
airbyte
as per the documentation. If you continue to get errors, please provide the exact error message for further troubleshooting. --- References integrated from official documentation: - [External Database Integration](https://docs.airbyte.com/platform/1.7/deploying-airbyte/integrations/database) - [Configuring the Airbyte Database](https://docs.airbyte.com/platform/1.7/enterprise-setup/implementation-guide#configuring-the-airbyte-database)
j
@kapa.ai [root@CDA-AIRBYTE-TESP3 ~]# kubectl exec -it airbyte-db-0 -n airbyte -- psql -U airbyte psql: error: FATAL: database "airbyte" does not exist command terminated with exit code 2
k
A message from kapa.ai
Based on your output:
Copy code
psql: error: FATAL:  database "airbyte" does not exist
This means the
airbyte
database is not present in your internal Postgres instance running in Kubernetes. According to the official Airbyte documentation and user experiences, the default database name for Airbyte is expected to be
airbyte
. If it does not exist, it may not have been created during installation, or it may have been deleted or misconfigured. This is consistent with issues reported by other users, where missing databases (
airbyte
,
temporal
, or
temporal_visibility
) caused errors when connecting or starting Airbyte services. The solution in those cases was to manually create the required databases in Postgres and grant the necessary privileges to the Airbyte user [see example](https://github.com/airbytehq/airbyte/issues/49304) [see also](https://discuss.airbyte.io/t/1544). To resolve this: 1. Connect to the Postgres pod as the
postgres
superuser
(or another user with sufficient privileges):
Copy code
bash    kubectl exec -it airbyte-db-0 -n airbyte -- psql -U postgres
2. Create the
airbyte
database and assign ownership to the
airbyte
user
(replace
airbyte
with your actual username if different):
Copy code
sql    CREATE DATABASE airbyte WITH OWNER = airbyte;
3. Exit and try connecting again:
Copy code
bash    kubectl exec -it airbyte-db-0 -n airbyte -- psql -U airbyte -d airbyte
If you are also missing the
temporal
and
temporal_visibility
databases (required for Airbyte's Temporal service), you should create those as well:
Copy code
sql CREATE DATABASE temporal WITH OWNER = airbyte; CREATE DATABASE temporal_visibility WITH OWNER = airbyte;
Summary: The error occurs because the
airbyte
database does not exist in your internal Postgres instance. You need to manually create it (and possibly the other required databases) and assign the correct ownership, as described above [see user solution](https://discuss.airbyte.io/t/1544) [see GitHub issue](https://github.com/airbytehq/airbyte/issues/49304). If you continue to have issues, please check your Helm values and Kubernetes secrets to ensure the database name and user match your configuration.
j
@kapa.ai [root@CDA-AIRBYTE-TESP3 ~]# kubectl exec -it airbyte-db-0 -n airbyte -- psql -U postgres psql: error: FATAL: role "postgres" does not exist command terminated with exit code 2
k
A message from kapa.ai
The error message:
Copy code
psql: error: FATAL:  role "postgres" does not exist
means that the
postgres
role (user) does not exist in your Airbyte internal Postgres instance running in Kubernetes. This situation can occur if the database was initialized with a different superuser or if the Helm chart or Docker image used a custom user for the database. The knowledge sources confirm that the default user is often
airbyte
, but it can be customized in your Helm values or Kubernetes secrets. For example, the documentation shows:
Copy code
yaml # Example from the docs: stringData:   # Database Secrets   database-user: ## e.g. airbyte   database-password: ## e.g. password
and
Copy code
yaml global:   database:     user: "" # -- The database user
([Configuring the Airbyte Database](https://docs.airbyte.com/platform/enterprise-setup/implementation-guide#configuring-the-airbyte-database)) What you should do: 1. Check which users exist in your database. Since you cannot log in as
postgres
, try logging in as the
airbyte
user (or whatever user is set in your Kubernetes secrets):
Copy code
bash    kubectl exec -it airbyte-db-0 -n airbyte -- psql -U airbyte
If you get a similar error, you may need to check your Kubernetes secrets for the correct username. 2. Check your Kubernetes secrets for the database user. The username is typically stored in a secret like
airbyte-airbyte-secrets
or
airbyte-config-secrets
. You can check it with:
Copy code
bash    kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}' | base64 --decode
Replace
airbyte-airbyte-secrets
with the actual secret name if different. 3. If you can log in as the correct user, list the roles: Once logged in, you can list all roles with:
Copy code
sql    \du
Summary: The
postgres
role does not exist in your Airbyte internal database, which is consistent with some Airbyte deployments where a custom user is used instead of the default
postgres
superuser. You should check your Kubernetes secrets for the correct username and use that to connect. If you cannot find the correct user or still cannot connect, you may need to review your Airbyte Helm values and secrets configuration to determine which user was created during installation. The knowledge sources do not provide a way to recover or create the
postgres
user if it was not set up initially.
j
@kapa.ai how do I find out the name of the secrets airbyte-airbyte-secrets
k
A message from kapa.ai
To find out the name of the secrets in your Airbyte Kubernetes namespace, you can use the following command:
Copy code
bash kubectl get secrets -n airbyte
This will list all secrets in the
airbyte
namespace, including any that are related to Airbyte, such as
airbyte-config-secrets
or
airbyte-airbyte-secrets
. The exact name may vary depending on your installation and Helm chart version. The documentation and user reports confirm that
airbyte-config-secrets
is commonly used, but some installations and Helm chart versions may generate or expect a secret named
airbyte-airbyte-secrets
or similar [see example](https://docs.airbyte.com/platform/next/deploying-airbyte/creating-secrets). If you do not see a secret with the expected name, review your Helm values or installation documentation to confirm which secret name is being used in your deployment.
j
@kapa.ai I found the secret with the correct name: airbyte-airbyte-secrets. How do I print the value with this command? I only have terminal access to the linux where airbyte is installed: kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}'
k
A message from kapa.ai
To print the value of the
database-user
from the
airbyte-airbyte-secrets
secret, you can use the command you provided:
Copy code
bash kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}'
However, the value will be base64-encoded. To decode it and see the actual username, you should pipe the output to `base64 --decode`:
Copy code
bash kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}' | base64 --decode
This approach is confirmed in the Airbyte documentation, which explains that secret values are base64-encoded and need to be decoded to view the actual content [see documentation](https://docs.airbyte.com/platform/deploying-airbyte/integrations/authentication).
j
@kapa.ai This command prints nothing:
Copy code
kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}' | base64 --decode
k
A message from kapa.ai
If the command
Copy code
bash kubectl get secret airbyte-airbyte-secrets -n airbyte -o jsonpath='{.data.database-user}' | base64 --decode
prints nothing, it means that the
database-user
key does not exist in the
airbyte-airbyte-secrets
secret. This is consistent with issues reported by other users, where the expected database keys were missing from the secret, leading to errors during Airbyte startup or when trying to connect to the internal database. In such cases, users have had to manually patch the secret to add the missing keys, as described in [this GitHub issue](https://github.com/airbytehq/airbyte/issues/39604): > I found a workaround solution which is patching Kubernetes secret
airbyte-airbyte-secrets
to add missing
DATABASE_USER
immediately after deployment. > >
Copy code
shell > kubectl patch secret airbyte-airbyte-secrets \ >   --namespace=production-hm-airbyte \ >   --patch="{\"stringData\":{\"DATABASE_USER\":\"airbyte_user\"}}" >
What you can do: 1. Check the contents of the secret:
Copy code
bash    kubectl get secret airbyte-airbyte-secrets -n airbyte -o yaml
Look for the keys under
data:
. If
database-user
(or
DATABASE_USER
) is missing, that's why your command returns nothing. 2. If the key is missing, you may need to add it. The knowledge sources confirm that the secret should contain the database credentials, and missing keys can cause issues with Airbyte's operation. You can patch the secret to add the missing key, as shown above. Note: - The key name is case-sensitive. Double-check if your secret uses
database-user
,
DATABASE_USER
, or another variant. - If you are unsure which key name to use, review your
values.yaml
or Helm chart configuration to see which key Airbyte expects for the database user. If you need to add the key, you can use a command like:
Copy code
bash kubectl patch secret airbyte-airbyte-secrets -n airbyte --patch='{"stringData":{"database-user":"airbyte"}}'
Replace
"airbyte"
with the actual username if different. --- In summary: The command prints nothing because the
database-user
key does not exist in the secret. You should check the secret's contents and add the key if necessary, as supported by the knowledge sources and user experiences [see GitHub issue](https://github.com/airbytehq/airbyte/issues/39604).
j
@kapa.ai I found the DATABASE_USER on the secrets file and it is "airbyte" in base64
k
A message from kapa.ai
Great! If you found the
DATABASE_USER
key in your
airbyte-airbyte-secrets
secret and, after decoding, it is
"airbyte"
, then
"airbyte"
is the correct username for connecting to your internal Airbyte Postgres database in your Kubernetes installation. This matches the default configuration shown in the Airbyte documentation and examples, where the default user is typically
airbyte
 [see documentation example](https://docs.airbyte.com/platform/1.7/deploying-airbyte/integrations/database). You should use: - Host:
airbyte-db-svc.airbyte.svc.cluster.local
- Port:
5432
- User:
airbyte
- Password: (from the
DATABASE_PASSWORD
or
database-password
key in the same secret) - Database: The default is usually
airbyte
, but if you get an error that the database does not exist, you may need to create it as described earlier. If you encounter a "database does not exist" error, it means the
airbyte
database is missing and you will need to create it using the credentials you have, as discussed in previous answers.
j
@kapa.ai The problem is that when I try to login via kubectl and psql with this user airbyte it says the database "airbyte" doesn't exist
k
A message from kapa.ai
The error message you are seeing—`database "airbyte" does not exist`—means that, although you have the correct username (
airbyte
), the actual database named
airbyte
has not been created in your internal Postgres instance running in Kubernetes. This situation is documented in both the Airbyte community forum and GitHub issues. Airbyte expects the
airbyte
database (and sometimes also
temporal
and
temporal_visibility
databases) to exist. If they do not, Airbyte may attempt to create them, but if the user does not have sufficient privileges, or if the database was not created during installation, you will encounter this error. The solution is to manually create the missing database(s) and grant the necessary privileges to the
airbyte
user [see forum post](https://discuss.airbyte.io/t/1544) [see GitHub issue](https://github.com/airbytehq/airbyte/issues/49304). What to do: 1. Connect to the Postgres pod as a user with database creation privileges. If you do not have a
postgres
superuser, you may need to use the user that was set up with sufficient privileges during installation. If you only have the
airbyte
user and it does not have permission to create databases, you may need to update your deployment or secrets to temporarily grant those privileges, or recreate the database using a different method. 2. If you have a user with sufficient privileges, create the database:
Copy code
sql    CREATE DATABASE airbyte WITH OWNER = airbyte;
3. If you do not have a user with sufficient privileges: The knowledge sources do not provide a method for recovering from this situation if you do not have a superuser or a user with
CREATEDB
privileges. In this case, you may need to review your Airbyte installation process or redeploy with the correct database initialization. Summary: The error occurs because the
airbyte
database does not exist. You need to create it and assign ownership to the
airbyte
user. This is a known requirement for Airbyte installations using an internal Postgres database in Kubernetes [see forum post](https://discuss.airbyte.io/t/1544) [see GitHub issue](https://github.com/airbytehq/airbyte/issues/49304). If you do not have a user with sufficient privileges to create the database, you may need to adjust your deployment or consult your installation documentation for further steps.