Open dhiaayachi opened 4 weeks ago
Thank you for reporting this issue.
It seems the issue is related to the way the temporal-sql-tool
init container tries to connect to the database. The error message indicates that the container is trying to connect to the database using the default database names postgres
and defaultdb
, rather than the one configured in the Helm chart (citus
).
The init container is using the SQL_DATABASE
environment variable to specify the database name, but it's possible that this variable isn't being correctly set or overridden.
To troubleshoot this, please provide the following information:
Once you provide this information, I can help you determine the root cause of the issue and provide a solution.
Thank you for reporting this issue.
Based on the logs you have provided, the problem seems to be related to the PostgreSQL configuration in your Kubernetes deployment. The error message indicates that the database can't be reached from the create-default-store
init container.
Could you please provide the following information to help us understand the situation better:
Once you provide this information, we'll be able to assist you further in resolving the issue.
Thanks for reporting this issue. It seems the temporal-sql-tool
init container is unable to connect to your PostgreSQL instance.
From the logs:
> kubectl logs temporal-schema-ttjv2 -c create-default-store
2024-08-23T10:04:50.384Z ERROR Unable to create SQL database. {"error": "unable to connect to DB, tried default DB names: postgres,defaultdb, errors: [pq: no pg_hba.conf entry for host \"fd40:6eea:20:81c1:8220:100:a45:1008\", user \"citus\", database \"postgres\", no encryption pq: no pg_hba.conf entry for host \"fd40:6eea:20:81c1:8220:100:a45:1008\", user \"citus\", database \"defaultdb\", no encryption]", "logging-call-at": "handler.go:94"}
You're getting pq: no pg_hba.conf entry
error. This means your PostgreSQL server is not configured to allow connections from the host running the temporal-sql-tool
container.
You need to update your pg_hba.conf
file on your PostgreSQL server to allow connections from the Kubernetes pod network where temporal-sql-tool
is running.
To resolve this:
Identify the Kubernetes Pod IP: Use kubectl get pods -n <namespace>
command to get the pod name and then use kubectl describe pod <pod-name> -n <namespace>
command to find the pod's IP address.
Update pg_hba.conf: Add a new entry in your pg_hba.conf
file on your PostgreSQL server to allow connections from the pod IP. You can use host
authentication method, for example:
host citus citus 10.63.7.94/32 trust
Replace 10.63.7.94
with the identified pod IP and ensure citus
user has necessary privileges.
Restart PostgreSQL: Restart your PostgreSQL service for the changes to take effect.
After making these changes, run your init container again and verify if it successfully connects to your PostgreSQL instance.
For more information on pg_hba.conf
configuration, refer to the PostgreSQL documentation: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
Expected Behavior
I expected it to use the database name that's configured in the helm chart.
Here is the init container that's created from the helm chart
Here is the yaml used for the helm chart:
Actual Behavior
I expected it to use the
citus
database referenced.