Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Seppskit opened this issue Apr 10, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@Seppskit
Copy link

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 Seppskit added the bug Something isn't working label Apr 10, 2024
@Seppskit
Copy link
Author

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

@Seppskit
Copy link
Author

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 robholland changed the title temporal-sql-tool does not accept host other than localhost temporal-sql-tool does not accept hostnames longer than 68 characters Apr 30, 2024
@robholland
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants