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

Kong 0.10.3 won't start with "special characters" in password #2885

Closed
jeremills opened this issue Sep 12, 2017 · 2 comments
Closed

Kong 0.10.3 won't start with "special characters" in password #2885

jeremills opened this issue Sep 12, 2017 · 2 comments

Comments

@jeremills
Copy link

jeremills commented Sep 12, 2017

Summary

Running Kong in a docker swarm I had set the KONG_PG_PASSWORD and KONG_PG_USER but I continued to receive:

2017/09/12 18:10:52 [verbose] saving serf shell script handler to /usr/local/kong/serf/serf_event.sh
2017/09/12 18:10:52 [verbose] SSL enabled, no custom certificate set: using default certificate
2017/09/12 18:10:52 [verbose] default SSL certificate found at /usr/local/kong/ssl/kong-default.crt
2017/09/12 18:10:52 [verbose] Admin SSL enabled, no custom certificate set: using default certificate
2017/09/12 18:10:52 [verbose] admin SSL certificate found at /usr/local/kong/ssl/admin-kong-default.crt
2017/09/12 18:10:52 [verbose] running datastore migrations
2017/09/12 18:10:52 [verbose] could not start Kong, stopping services
2017/09/12 18:10:52 [verbose] leaving serf cluster
2017/09/12 18:10:52 [verbose] stopped services
Error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:34: /usr/local/share/lua/5.1/kong/cmd/start.lua:21: [postgres error] could not get current migrations: [postgres error] FATAL: password authentication failed for user "kong"
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/kong/cmd/start.lua:34: in function 'cmd_exec'
	/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>
	[C]: in function 'xpcall'
	/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
	/usr/local/bin/kong:7: in function 'file_gen'
	init_worker_by_lua:40: in function <init_worker_by_lua:38>
	[C]: in function 'pcall'
	init_worker_by_lua:47: in function <init_worker_by_lua:45>

However, running psql with the username and password all works fine.

I was able to realize on my own the issue was that my password had a special character within it:
one of -=!@#$%^&*() more specifically I had # mid way through my password and kong was unable to use the password properly.

After removing any special characters (which tbh keeps me from making my pw more secure) I am able to connect and run kong.

I was unable to find any documentation on this so I decided to leave this here.

Additional Details & Logs

  • Kong version (0.10.3)
  • Postgres version (9.6)
@jeremills jeremills changed the title Kong 0.10.3 won't start with "special characters" in password (fix) Kong 0.10.3 won't start with "special characters" in password Sep 12, 2017
@p0pr0ck5
Copy link
Contributor

@jmills-bespoke this was fixed in 0.11: https://github.com/Mashape/kong/blob/master/CHANGELOG.md#configuration-2

If you like, you can try applying the patch from #2411 to your 0.10.3 instance, it should apply cleanly.

@pennliang
Copy link

"KONG_VERSION=0.14.1" also have this probleam, my pg password contain #,when migration,have the error:
Error:
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:37: [postgres error] could not retrieve current migrations: [postgres error] FATAL: password authentication failed for user "kong"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants