I have 2 ECS instances just call them “A” and “B” ;
I install docker and build kong 1.3 on “A” ;
The “B” has a postgressql ;
The I try to migrations kong on “A” linking to postgresql on “B”, like:
docker run --rm
-e “KONG_DATABASE=postgres”
-e “KONG_PG_HOST=10.47.136.45”
-e “KONG_PG_PORT=6506”
-e “KONG_PG_DATABASE=devauth”
-e “KONG_PG_USER=devauthdata”
-e “KONG_PG_PASSWORD=Paic1234#”
ay/kong:1.3 kong migrations bootstrap
it failed :
Error: [PostgreSQL error] failed to retrieve server_version_num: FATAL: password authentication failed for user “devauthdata”
but the username and password are valid !!!
=-------------------------------------------
I think I know that:
it is Special characters !
the password contains a “#” !
I just try a new password without “#” , it success !!!
so, is the way for kong to link postgresql-11 wrong???
or need some improvement?
The # in postgres password seems to still be an issue. I’m using docker secrets to set the postrges password and setting KONG_PG_PASSWORD_FILE. I’ve noticed when the docker secret value contains a #, “kong start” will exist with an error. Strangely the kong bootstrap/up/list/finish seem work without issue when the secret contains a #. I’ve tried this on 2.0.5 and 2.1.3.
nginx: [warn] load balancing method redefined in /usr/local/kong/nginx-kong.conf:56
2020/09/09 20:45:14 [error] 33#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:447: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: FATAL: password authentication failed for user “kong”
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/kong/init.lua:447: in function ‘init’
init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:447: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: FATAL: password authentication failed for user “kong”
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/kong/init.lua:447: in function ‘init’
init_by_lua:3: in main chunk
Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:64: failed to start nginx (exit code: 1)
Run with --v (verbose) or --vv (debug) for more details