I’m setting up a new Linux install with Kong to kick the tires on it. From a fresh install of CentOS 8 , I followed the install guide for PostgreSQL and the Kong installation instructions.
The installation went fine, but I’m not able run the
kong migrations bootstrap. I get:
Error: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: FATAL: Ident authentication failed for user "kong"
I didn’t create a user
kong because the Kong instructions didn’t tell me to, nor did I create a password for the
kong user. I can add a password and configure PostgreSQL to use md5/sha256 password authentication, but is that the right approach? Should I create a
kong user instead, so ident resolves?
How do I proceed on this?
If I understood correctly, you need to create user/database kong and password in PostgreSQL server, since you have installed it separately (could be separate in a machine) and update the PostgreSQL details in a kong.conf file. And then start the service with verbose.
Accordingly to me, it is the correct approach. Please let me know if it resolves. Thanks
I created the user
kong as per the Kong directions:
CREATE USER kong; CREATE DATABASE kong OWNER kong;
But when I run the following, it fails with the error:
kong migrations bootstrap -c /etc/kong/kong.conf
what is the password you created for user kong? if not, can you create one and then update the username/password in kong.conf file
GRANT ALL PRIVILEGES ON DATABASE kong to kong;
ALTER USER kong WITH PASSWORD 'new_password';
I think issue is you have not created the password for user kong, do create one and try
you may also need to allow kong user to be accessed from remote servers.
I gave that a whirl; still the same error:
FATAL: Ident authentication failed for user "kong"
EDIT: After some more investigation, it turns out that in addition to supplying the password, I had to update PostgreSQL to allow passwords for local users (in the pg_hba.conf file, changing the auth method from ident to md5). I then had to explicitly enable the pg_password setting in kong.conf and specify the password.
Once those two things were done, voila! I can run my migrations.