temporalio / helm-charts

Temporal Helm charts
MIT License
276 stars 315 forks source link

temporal-sql-tool does not accept hostnames longer than 68 characters #481

Closed Seppskit closed 3 weeks ago

Seppskit commented 2 months ago

What are you really trying to do?

i tried to deploy temporal via helm in my k8s cluster.

i have a postgres database in a cloud. i wanted to set it as host in the following commands.

export SQL_PLUGIN=postgres12
export SQL_HOST=postgresql_host
export SQL_PORT=5432
export SQL_USER=postgresql_user
export SQL_PASSWORD=postgresql_password

make temporal-sql-tool

./temporal-sql-tool --database temporal create-database
SQL_DATABASE=temporal ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal ./temporal-sql-tool update -schema-dir schema/postgresql/v12/temporal/versioned

./temporal-sql-tool --database temporal_visibility create-database
SQL_DATABASE=temporal_visibility ./temporal-sql-tool setup-schema -v 0.0
SQL_DATABASE=temporal_visibility ./temporal-sql-tool update -schema-dir schema/postgresql/v12/visibility/versioned

Describe the bug

unfortunately i no longer have the logs as i have now deleted the setup. the tool tells me that it can't connect to 127.0.06 because it can't find it. The tool still assumes that I am using localhost. however, I have entered my actual database in "SQL_HOST". when i check the env with "echo" it tells me its set to my postgres endpoint, but the tool always thinks its 127.0.0.6 and tries to find the DB on localhost. the database is also accessible from my setup, which I have tested.

Additional context

i faced this as well: bug ..but thats another topic.

Seppskit commented 2 months ago

addition: my host string is 69 characters long. up to character 68 it recognizes the string, from 69 the message appears with localhost

Seppskit commented 2 months ago

thats the log error message: ERROR Unable to create SQL database. {"error": "unable to connect to DB, tried default DB names: postgres,defaultdb, errors: [pq: pg_hba.conf rejects connection for host \"127.0.0.6\", user \"temporal\", database \"postgres\", no encryption pq: pg_hba.conf rejects connection for host \"127.0.0.6\", user \"temporal\", database \"defaultdb\", no encryption]", "logging-call-at": "handler.go:94"}

robholland commented 3 weeks ago

127.0.0.6 is where the connection is coming from, not where you are connecting to. This is not an issue with hostname length.

robholland commented 3 weeks ago

Please check that your connection details (username, password and whether you need TLS) are all correct.