Closed jianmaikj closed 11 months ago
Note: Older versions of PostgreSQL use ident authentication by default, newer versions (PSQL 10+) use scram-sha-256. To allow the kong user to communicate with the database locally, change the authentication method to md5 by modifying the PostgreSQL configuration file.
Note: Older versions of PostgreSQL use ident authentication by default, newer versions (PSQL 10+) use scram-sha-256. To allow the kong user to communicate with the database locally, change the authentication method to md5 by modifying the PostgreSQL configuration file.
thank you, so I have to use md5? is there any plan to support scram-sha-256?
Just a note here (not sure if it is related): https://github.com/leafo/pgmoon/issues/133
But it looks like we are using our own fork: https://github.com/Kong/pgmoon#pgmoon
Create internal ticket KAG-2600
Hey @jianmaikj ,
Could you share your postgres config? From my research it looks like scram-sha-256
should be supported on the kong side and we need to update the docs. Reasons for that:
scram-sha-256
from version 1.13.0 as it's described in it's changelog (https://github.com/Kong/pgmoon#changelog)scram-sha-256
: https://github.com/Kong/kong/commit/99c1276a109a2c0e753bd03f2ad6b6b517e6ea65Apart from that I tried to replicate your issue with various postgres configuration and I was not able to. Everytime I ran kong migrations bootstrap
- it worked.
It's possible that the issue reported on original pgmoon repo that bugs scram-sha-256
is also present in our fork, though I could not replicate it either.
Therefore to move this issue forward could you share your postgres config or a docker-compose file that reproduces this issue?
Also - could you double check the password? The only instance when I was able to replicate the error you reported was when I intentionally used wrong password for kong. Then I got:
Postgres logs:
FATAL: password authentication failed for user "kong"
DETAIL: Connection matched file "/var/lib/postgresql/data/pg_hba.conf" line 128: "host all all all scram-sha-256"
Kong logs:
Error: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: authentication exchange unsuccessful
But when I changed the password to the correct one then kong connected without any issues.
This issue is marked as stale because it has been open for 14 days with no activity.
Dear contributor,
We are automatically closing this issue because it has not seen any activity for three weeks. We're sorry that your issue could not be resolved. If any new information comes up that could help resolving it, please feel free to reopen it.
Your contribution is greatly appreciated!
Please have a look our pledge to the community for more information.
Sincerely, Your Kong Gateway team
β Run with --v (verbose) or --vv (debug) for more details β β waiting for db β β Error: don't know how to auth: 10
Is there an existing issue for this?
Kong version (
$ kong version
)3.4.0
Current Behavior
I'm installing Kong through docker and connecting to Postgresql 14 on the host, but get this error:
Error: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: authentication exchange unsuccessful
when I run the following command:docker run -it --rm --network=host -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=127.0.0.1" -e "KONG_PG_PORT=5432" -e "KONG_PG_USER=kong" -e "KONG_PG_PASSWORD=12345678" -e "KONG_PG_DATABASE=kong" kong:latest kong migrations bootstrap;
BUT it works fine with Postgresql 13 or md5 mode
Expected Behavior
No response
Steps To Reproduce
[PostgreSQL error] failed to retrieve PostgreSQL server_version_num: authentication exchange unsuccessful
Anything else?
No response