Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/
Apache License 2.0
39.4k stars 4.83k forks source link

Unable to start kong - Amazon EC2 #3430

Closed dilangathalpegama closed 6 years ago

dilangathalpegama commented 6 years ago

I am getting the below error when trying to start kong. The 'kong migrations up [-c /path/to/kong.conf]' command is working fine.

I'm using this tutorial for the installation: https://getkong.org/install/aws-linux/?_ga=2.267838093.2048648287.1525250425-1855460585.1525250425

Start command: 'kong start --vv -c /etc/kong/kong.conf'

Error log: [ec2-user@ip-172-31-19-25 kong]$ kong start --vv -c /etc/kong/kong.conf 2018/05/02 12:16:06 [verbose] Kong: 0.13.1 2018/05/02 12:16:06 [debug] ngx_lua: 10011 2018/05/02 12:16:06 [debug] nginx: 1013006 2018/05/02 12:16:06 [debug] Lua: LuaJIT 2.1.0-beta3 2018/05/02 12:16:06 [verbose] reading config file at /etc/kong/kong.conf 2018/05/02 12:16:06 [debug] admin_access_log = "logs/admin_access.log" 2018/05/02 12:16:06 [debug] admin_error_log = "logs/error.log" 2018/05/02 12:16:06 [debug] admin_listen = {"127.0.0.1:8001","127.0.0.1:8444 ssl"} 2018/05/02 12:16:06 [debug] anonymous_reports = true 2018/05/02 12:16:06 [debug] cassandra_consistency = "ONE" 2018/05/02 12:16:06 [debug] cassandra_contact_points = {"127.0.0.1"} 2018/05/02 12:16:06 [debug] cassandra_data_centers = {"dc1:2","dc2:3"} 2018/05/02 12:16:06 [debug] cassandra_keyspace = "kong" 2018/05/02 12:16:06 [debug] cassandra_lb_policy = "RoundRobin" 2018/05/02 12:16:06 [debug] cassandra_port = 9042 2018/05/02 12:16:06 [debug] cassandra_repl_factor = 1 2018/05/02 12:16:06 [debug] cassandra_repl_strategy = "SimpleStrategy" 2018/05/02 12:16:06 [debug] cassandra_schema_consensus_timeout = 10000 2018/05/02 12:16:06 [debug] cassandra_ssl = false 2018/05/02 12:16:06 [debug] cassandra_ssl_verify = false 2018/05/02 12:16:06 [debug] cassandra_timeout = 5000 2018/05/02 12:16:06 [debug] cassandra_username = "kong" 2018/05/02 12:16:06 [debug] client_body_buffer_size = "8k" 2018/05/02 12:16:06 [debug] client_max_body_size = "0" 2018/05/02 12:16:06 [debug] client_ssl = false 2018/05/02 12:16:06 [debug] custom_plugins = {} 2018/05/02 12:16:06 [debug] database = "postgres" 2018/05/02 12:16:06 [debug] db_cache_ttl = 3600 2018/05/02 12:16:06 [debug] db_update_frequency = 5 2018/05/02 12:16:06 [debug] db_update_propagation = 0 2018/05/02 12:16:06 [debug] dns_error_ttl = 1 2018/05/02 12:16:06 [debug] dns_hostsfile = "/etc/hosts" 2018/05/02 12:16:06 [debug] dns_no_sync = false 2018/05/02 12:16:06 [debug] dns_not_found_ttl = 30 2018/05/02 12:16:06 [debug] dns_order = {"LAST","SRV","A","CNAME"} 2018/05/02 12:16:06 [debug] dns_resolver = {} 2018/05/02 12:16:06 [debug] dns_stale_ttl = 4 2018/05/02 12:16:06 [debug] error_default_type = "text/plain" 2018/05/02 12:16:06 [debug] latency_tokens = true 2018/05/02 12:16:06 [debug] log_level = "notice" 2018/05/02 12:16:06 [debug] lua_package_cpath = "" 2018/05/02 12:16:06 [debug] lua_package_path = "./?.lua;./?/init.lua;" 2018/05/02 12:16:06 [debug] lua_socket_pool_size = 30 2018/05/02 12:16:06 [debug] lua_ssl_verify_depth = 1 2018/05/02 12:16:06 [debug] mem_cache_size = "128m" 2018/05/02 12:16:06 [debug] nginx_daemon = "on" 2018/05/02 12:16:06 [debug] nginx_optimizations = true 2018/05/02 12:16:06 [debug] nginx_user = "nobody nobody" 2018/05/02 12:16:06 [debug] nginx_worker_processes = "auto" 2018/05/02 12:16:06 [debug] pg_database = "kong" 2018/05/02 12:16:06 [debug] pg_host = "13.250.182.171" 2018/05/02 12:16:06 [debug] pg_password = "**" 2018/05/02 12:16:06 [debug] pg_port = 5432 2018/05/02 12:16:06 [debug] pg_ssl = false 2018/05/02 12:16:06 [debug] pg_ssl_verify = false 2018/05/02 12:16:06 [debug] pg_user = "kong" 2018/05/02 12:16:06 [debug] prefix = "/usr/local/kong/" 2018/05/02 12:16:06 [debug] proxy_access_log = "logs/access.log" 2018/05/02 12:16:06 [debug] proxy_error_log = "logs/error.log" 2018/05/02 12:16:06 [debug] proxy_listen = {"0.0.0.0:8000","0.0.0.0:8443 ssl"} 2018/05/02 12:16:06 [debug] real_ip_header = "X-Real-IP" 2018/05/02 12:16:06 [debug] real_ip_recursive = "off" 2018/05/02 12:16:06 [debug] server_tokens = true 2018/05/02 12:16:06 [debug] ssl_cipher_suite = "modern" 2018/05/02 12:16:06 [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" 2018/05/02 12:16:06 [debug] trusted_ips = {} 2018/05/02 12:16:06 [debug] upstream_keepalive = 60 2018/05/02 12:16:06 [verbose] prefix in use: /usr/local/kong 2018/05/02 12:16:06 [verbose] preparing nginx prefix directory at /usr/local/kong 2018/05/02 12:16:06 [verbose] could not start Kong, stopping services 2018/05/02 12:16:06 [verbose] stopped services Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:68: /usr/local/share/lua/5.1/kong/cmd/start.lua:25: Permission denied stack traceback: [C]: in function 'error' /usr/local/share/lua/5.1/kong/cmd/start.lua:68: in function 'cmd_exec' /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87> [C]: in function 'xpcall' /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44> /usr/local/bin/kong:7: in function 'file_gen' init_worker_by_lua:49: in function [C]: in function 'xpcall' init_worker_by_lua:56: in function

gszr commented 6 years ago

@dilangathalpegama Kong's default prefix is /usr/local/kong. Make sure it exists and the user you're running Kong as has permissions over it - e.g., sudo mkdir /usr/local/kong && sudo chown $USER /usr/local/kong.

dilangathalpegama commented 6 years ago

@salazar Thanks for the tip. I created the directory and added full permissions but haven't added the chown.