Kong does not work with Postgres 14.x

Hello Community,

I have installed kong on our Kubernetes cluster using the latest Helm chart. We have Postgres 14.x Version installed. Its default password encryption is scram-sha-256.

I am having trouble running the migration. Here is log

Error: module ‘openssl.rand’ not found:No LuaRocks module found for openssl.rand
no field package.preload[‘openssl.rand’]
no file ‘/opt/openssl/rand.lua’
no file ‘/opt/openssl/rand/init.lua’
no file ‘./openssl/rand.lua’
no file ‘./openssl/rand/init.lua’
no file ‘/usr/local/openresty/site/lualib/openssl/rand.ljbc’
no file ‘/usr/local/openresty/site/lualib/openssl/rand/init.ljbc’
no file ‘/usr/local/openresty/lualib/openssl/rand.ljbc’
no file ‘/usr/local/openresty/lualib/openssl/rand/init.ljbc’
no file ‘/usr/local/openresty/site/lualib/openssl/rand.lua’
no file ‘/usr/local/openresty/site/lualib/openssl/rand/init.lua’
no file ‘/usr/local/openresty/lualib/openssl/rand.lua’
no file ‘/usr/local/openresty/lualib/openssl/rand/init.lua’

here is the proxy POD log:

Error from server (BadRequest): container “proxy” in pod “kong-gateway-kong-6458d89d8c-fgvhg” is waiting to start: PodInitializing

Could you please help me resolve this issue?

I had to do the following to fix this

  1. Update the password encryption to md5 in postgresql.conf file, in my case, located at /var/lib/pgsql/14/data/postgresql.conf (amzn-linux2), and then restart the database.

  2. Log into Postgres and update the password
    sudo -u postgres psql
    ALTER USER kong WITH PASSWORD ‘new_password’;

  3. run the migrations command:
    kong migrations bootstrap -c {path to kong.conf file}