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.conf Postgresql Password can't contain '#' #2919

Closed
DanielTimLee opened this issue Sep 30, 2017 · 2 comments
Closed

Kong.conf Postgresql Password can't contain '#' #2919

DanielTimLee opened this issue Sep 30, 2017 · 2 comments

Comments

@DanielTimLee
Copy link

NOTE: GitHub issues are reserved for bug reports only.

Please read the CONTRIBUTING.md guidelines to learn on which channels you can
seek for help and ask general questions:

https://github.com/Mashape/kong/blob/master/CONTRIBUTING.md#where-to-seek-for-help

Summary

Kong.conf 's Postgresql Password can't contain # Value.

Steps To Reproduce

  1. Set Postgres User's password containing #.
  2. Set kong.conf's postgresql password.
  3. sudo kong migrations up -c /etc/kong.conf

Additional Details & Logs

  • Kong version ($ kong version) - 0.11.0
  • Kong debug-level startup logs ($ kong start --vv)
2017/09/30 11:51:53 [verbose] Kong: 0.11.0
2017/09/30 11:51:53 [debug] ngx_lua: 10008
2017/09/30 11:51:53 [debug] nginx: 1011002
2017/09/30 11:51:53 [debug] Lua: LuaJIT 2.1.0-beta2
2017/09/30 11:51:53 [verbose] reading config file at /etc/kong.conf
2017/09/30 11:51:53 [debug] admin_access_log = "logs/admin_access.log"
2017/09/30 11:51:53 [debug] admin_error_log = "logs/error.log"
2017/09/30 11:51:53 [debug] admin_http2 = false
2017/09/30 11:51:53 [debug] admin_listen = "0.0.0.0:8001"
2017/09/30 11:51:53 [debug] admin_listen_ssl = "0.0.0.0:8444"
2017/09/30 11:51:53 [debug] admin_ssl = true
2017/09/30 11:51:53 [debug] anonymous_reports = true
2017/09/30 11:51:53 [debug] cassandra_consistency = "ONE"
2017/09/30 11:51:53 [debug] cassandra_contact_points = {"127.0.0.1"}
2017/09/30 11:51:53 [debug] cassandra_data_centers = {"dc1:2","dc2:3"}
2017/09/30 11:51:53 [debug] cassandra_keyspace = "kong"
2017/09/30 11:51:53 [debug] cassandra_lb_policy = "RoundRobin"
2017/09/30 11:51:53 [debug] cassandra_port = 9042
2017/09/30 11:51:53 [debug] cassandra_repl_factor = 1
2017/09/30 11:51:53 [debug] cassandra_repl_strategy = "SimpleStrategy"
2017/09/30 11:51:53 [debug] cassandra_schema_consensus_timeout = 10000
2017/09/30 11:51:53 [debug] cassandra_ssl = false
2017/09/30 11:51:53 [debug] cassandra_ssl_verify = false
2017/09/30 11:51:53 [debug] cassandra_timeout = 5000
2017/09/30 11:51:53 [debug] cassandra_username = "kong"
2017/09/30 11:51:53 [debug] client_body_buffer_size = "8k"
2017/09/30 11:51:53 [debug] client_max_body_size = "0"
2017/09/30 11:51:53 [debug] client_ssl = false
2017/09/30 11:51:53 [debug] custom_plugins = {}
2017/09/30 11:51:53 [debug] database = "postgres"
2017/09/30 11:51:53 [debug] db_cache_ttl = 3600
2017/09/30 11:51:53 [debug] db_update_frequency = 5
2017/09/30 11:51:53 [debug] db_update_propagation = 0
2017/09/30 11:51:53 [debug] dns_error_ttl = 1
2017/09/30 11:51:53 [debug] dns_hostsfile = "/etc/hosts"
2017/09/30 11:51:53 [debug] dns_no_sync = false
2017/09/30 11:51:53 [debug] dns_not_found_ttl = 30
2017/09/30 11:51:53 [debug] dns_order = {"LAST","SRV","A","CNAME"}
2017/09/30 11:51:53 [debug] dns_resolver = {}
2017/09/30 11:51:53 [debug] dns_stale_ttl = 4
2017/09/30 11:51:53 [debug] error_default_type = "text/plain"
2017/09/30 11:51:53 [debug] http2 = false
2017/09/30 11:51:53 [debug] latency_tokens = true
2017/09/30 11:51:53 [debug] log_level = "notice"
2017/09/30 11:51:53 [debug] lua_code_cache = "on"
2017/09/30 11:51:53 [debug] lua_package_cpath = ""
2017/09/30 11:51:53 [debug] lua_package_path = "?/init.lua;./kong/?.lua"
2017/09/30 11:51:53 [debug] lua_socket_pool_size = 30
2017/09/30 11:51:53 [debug] lua_ssl_verify_depth = 1
2017/09/30 11:51:53 [debug] mem_cache_size = "128m"
2017/09/30 11:51:53 [debug] nginx_daemon = "on"
2017/09/30 11:51:53 [debug] nginx_optimizations = true
2017/09/30 11:51:53 [debug] nginx_user = "nobody nobody"
2017/09/30 11:51:53 [debug] nginx_worker_processes = "auto"
2017/09/30 11:51:53 [debug] pg_database = "kong"
2017/09/30 11:51:53 [debug] pg_host = "0.0.0.0"
2017/09/30 11:51:53 [debug] pg_password = "******"
2017/09/30 11:51:53 [debug] pg_port = 5432
2017/09/30 11:51:53 [debug] pg_ssl = false
2017/09/30 11:51:53 [debug] pg_ssl_verify = false
2017/09/30 11:51:53 [debug] pg_user = "kong"
2017/09/30 11:51:53 [debug] prefix = "/usr/local/kong/"
2017/09/30 11:51:53 [debug] proxy_access_log = "logs/access.log"
2017/09/30 11:51:53 [debug] proxy_error_log = "logs/error.log"
2017/09/30 11:51:53 [debug] proxy_listen = "0.0.0.0:8000"
2017/09/30 11:51:53 [debug] proxy_listen_ssl = "0.0.0.0:8443"
2017/09/30 11:51:53 [debug] real_ip_header = "X-Real-IP"
2017/09/30 11:51:53 [debug] real_ip_recursive = "off"
2017/09/30 11:51:53 [debug] server_tokens = true
2017/09/30 11:51:53 [debug] ssl = true
2017/09/30 11:51:53 [debug] ssl_cipher_suite = "modern"
2017/09/30 11:51:53 [debug] ssl_ciphers = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"
2017/09/30 11:51:53 [debug] trusted_ips = {}
2017/09/30 11:51:53 [debug] upstream_keepalive = 60
2017/09/30 11:51:53 [verbose] prefix in use: /usr/local/kong
2017/09/30 11:51:53 [verbose] running datastore migrations
Error: 
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:34: [postgres error] could not retrieve current migrations: [postgres error] FATAL: password authentication failed for user "kong"
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/lua/5.1/kong/cmd/migrations.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:41: in function <init_worker_by_lua:39>
        [C]: in function 'xpcall'
        init_worker_by_lua:48: in function <init_worker_by_lua:46>
  • Kong error logs (<KONG_PREFIX>/logs/error.log)
  • Kong configuration (registered APIs/Plugins & configuration file)
  • Operating System
    Ubuntu 16.04.2 LTS
@p0pr0ck5
Copy link
Contributor

Hi,

This was corrected in Kong 0.11.0. Please see also #2885. Thank you!

@p0pr0ck5
Copy link
Contributor

Sorry, to clarify on a point, octothorpes need to be escaped with a backslash to be treated as character literals in config values (e.g. a password foo#bar should be written as foo\#bar in the config file).

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

2 participants