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 can't start after restarting docker container #1164

Closed
jimmytoan opened this issue Apr 20, 2016 · 13 comments
Closed

Kong can't start after restarting docker container #1164

jimmytoan opened this issue Apr 20, 2016 · 13 comments
Assignees

Comments

@jimmytoan
Copy link

I install kong on docker container by following this document https://getkong.org/install/docker/
I use postgres. It runs properly. But after run command "docker restart kong kong-database". Kong can't start.
Result of command "docker logs kong" is here:
[INFO] kong 0.8.0
[INFO] Using configuration: /etc/kong/kong.yml
[INFO] Setting working directory to /usr/local/kong
[INFO] database...........postgres host=kong-database database=kong user=kong port=5432
[INFO] Leaving cluster..
[ERR] dnsmasq is already running
[ERR] Could not start Kong

@jimmytoan
Copy link
Author

After container kong-database runs over 10 minutes. I start kong again and it can run. I dont' know why sometime I see the "[ERR] dnsmasq is already running"

@subnetmarco subnetmarco self-assigned this Apr 20, 2016
@lagonnebula
Copy link

I have the same issue, it's only happen when i restart the docker container

@harryparmar
Copy link

You should check additional messages in
/usr/local/kong/logs/error.log
In past I have found runscope plugin to be issue

You can go inside docker by
docker exec -i -t [name of your docker use docker ps to find out] bash
and then VI

@subnetmarco
Copy link
Member

@harryparmar do you recall what was the issue with the Runscope plugin?

@harryparmar
Copy link

harryparmar commented Jun 1, 2016

@thefosk If I remember right, one of your files constants.lua was missing runscope reference but allowed installing runscope following your guide on website. This was all good as long as Kong was running but on next restart Kong would not start. I manually cleaned up cassandra tables and removed runscope and fixed constants.lua file or something like that to fix the issue. This is no longer issue though as your constants.lua file is good unless people are using old version.

@Tieske Tieske added the question label Jun 2, 2016
@harryparmar
Copy link

harryparmar commented Jun 3, 2016

@thefosk I faced this dnsmasq issue in one of my dev instances today and after deleting container and image and downloading new image..the error turned into cannot connect to port kong-database:9042. could not figure out what was wrong. Suspecting there was bug in docker itself i deleted all containers and images...and updated my docker through Yum command and then installed kong and cassandra again and everything starting running smooth again.

@thanh-nguyen-van
Copy link

thanh-nguyen-van commented Jun 17, 2016

I got the same issue. Any helps appreciate !

@moneyit
Copy link

moneyit commented Jul 4, 2016

If you run kong-dashboard then it should be stopped before restart kong container.
You should restart kong-database and let it ready to serve kong then restart kong container.
Process dnsmaq is always run but start first or after kong procee is other story:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 4448 848 ? Ss 07:04 0:00 /bin/sh -c kong start
root 6 0.0 0.0 36388 5436 ? S 07:04 0:00 /usr/local/bin/luajit -e package.path="/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;"..package.path; package.cpath="/usr/
root 8 0.0 0.0 15572 2036 ? Rs+ 07:04 0:00 ps -aux
root 30 0.0 0.0 4448 740 ? S 07:04 0:00 sh -c /bin/bash /tmp/lua_0lENr5 > /tmp/lua_bsZh9o 2>&1
root 31 0.0 0.0 17964 2692 ? S 07:04 0:00 /bin/bash /tmp/lua_0lENr5
root 32 0.0 0.0 19748 2152 ? R 07:04 0:00 dnsmasq -p 8053 --pid-file=/usr/local/kong/dnsmasq.pid -N -o --listen-address=127.0.0.1

Hope it can help you!

@thanh-nguyen-van
Copy link

Thanks ! Actually, I have to stop kong in docker container first, then exit to docker container and restart the docker, anyway thanks for your answer !

@486
Copy link

486 commented Aug 8, 2016

So it actually looks like the dnsmasq process or its pid or whatever is not cleaned up when the container is stopped. Maybe it's linked to #1074 because that is not fixed either. So far I have been successful with changing the command to kong restart instead of kong start. Also the problem will probably go away when #1225 hits.

@orphaner
Copy link

Hello

Here is a fix proposal for this issue : Kong/docker-kong#47

@subnetmarco
Copy link
Member

In the new Kong 0.9 this command seems to work as expected - do you confirm?

@thibaultcha
Copy link
Member

Considering this answered, please re-open if occurring with Kong 0.9.

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

10 participants