-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Cannot start container: Port has already been allocated #6476
Comments
PS: The only way to recover is restarting docker after which everything works as expected. |
Tentatively adding to 1.0.1 milestone (cc @vieux @crosbymichael @tibor @unclejack ) |
I see here, that if there is error during port allocations - already allocated ports never released. Maybe it is problem. |
@LK4D4 maybe we are hitting an error when we stop the container and the port is not being released? |
@crosbymichael Yup, you are right. Then we should see errors in log on stop. |
@LK4D4 are you looking into this issue or do you want me to take it? |
@crosbymichael I almost asleep :) And have no progress on this issue, so feel free to take it. |
I'll provide the logs as soon as I run into that again. But haven't so far.. |
The issue can be reproduced easily. Whenever you try to allocate a port to a port which is already occupied, Docker complains since then even the port becomes free. Tested with Docker 1.0 on Ubuntu 14.04 How to reproduce: $ sudo service apache2 start #occupies port 80 2014/06/19 15:53:59 Error: Cannot start container 2094c72e4485bd9f54e7f3f8de797845d6d8a43db37fd2f4f8231222e4bf377e: port has already been allocated$ sudo service apache2 stop # frees port 80, can be verified by nmap 2014/06/19 15:53:59 Error: Cannot start container 2094c72e4485bd9f54e7f3f8de797845d6d8a43db37fd2f4f8231222e4bf377e: port has already been$ sudo service docker restart |
@kruxik Wow, thank you |
In |
Just verified, the issue is still in Docker 1.0.1 |
@shykes I'm quite disappointed that this hasn't been fixed in 1.0.1. This is a severe bug for every production deployment. |
I am having the same issue.. so I am subscribing to this thread. |
@LK4D4 is this fully resolved by your patches? I was going to see if I could resolve this. |
+1... |
+1 ... is there a known workaround for the time being? |
+1 |
Just hit the same thing with docker 1.0.0 on a production box... |
+1 Client version: 1.0.1 |
Just an FYI as clarification for the new people coming to this bug. This has been fixed. It will be part of 1.2.1 which hasn't been released yet. |
when will v1.2.1 be released? |
@phemmer - any dates for 1.2.1? this is critical bug for us (and for many other folks it seems). few questions -
|
You can test 1.3.0 with this fix here: |
@crosbymichael - thanks! have you been trying this? any regressions / other major issues already known with this RC to watch out for? will definitely take it for test drive |
Well, I would not push the RC to your production servers but this build should be stable for you to help test. If you have any problem please let us know before the release so we can get it fixed and you have a proper release to run in production. |
@crosbymichael - Got it thanks, and one last Q before i get into this - Is there an updated CHANGELOG anywhere to look over? would be useful to know what new features / modifications / bug fixes there are in this release before I deploy it here |
The last commit in that branch includes a high level changelog. Docker is very active and there are too many commits in each release to include everything in the changelog. So just git log v1.2.0.. |
@crosbymichael - got it, thanks |
+1
|
@crosbymichael been running that binary RC for few days now, looking good so far. mostly doing login/pull/start/stop/rm flows as part of a deployment process and looks solid, containers restart well and haven't run into the "port already bound" issue so far. |
Faced this issue in CoreOS - Docker v 1.2.0. No running or stopped container was claiming the port when I tried to run a new container using a port that was previously used. |
@buzypi the issue was fixed in 1.3.0, let us know if you are still seeing it after upgrading |
@jfrazelle Great! Do you know when will the fix be released on RHEL6 epel? Actually, do you recommend compiling / installing Docker directly from docker.com? |
you can download just the docker binary if you would like and swap that out On Fri, Nov 14, 2014 at 6:38 PM, Soichi Hayashi notifications@github.com
|
@jfrazelle was this actually fixed? It looks like @kung-foo is reporting the issue even in 1.3.0? |
this issue has a lot of noise, @kung-foo if you are having a problem with ports in use on the latest version, please open a new issue, so it gets the attention it deserves. |
In my case, I ended up rebuilding all of the containers and the problem was no longer reproducible. |
I am still seeing this on version 1.4.1. It is unfortunate because I cannot restart docker since it is on production. |
@amalagaura Can you open new issue and describe how you run containers? so we can find reproduction case. Thanks for report! |
I have the issue, first of all my netstat -tlp not report any listen docker-proxy on the port I try to bind to ( port 50000 ) and docker fails with follow
/var/log/syslog reports:
while if I try with a different port ( 50001 ) it works
I think something stuck when I tried to create a 2th layer using port map 50000 with my previous tests and now I cannot use that port any more neither it is really free in the os. any suggestion, workarounds ? |
@devel0 Also, this problem has been reported in more recent issues, and it is liley not related to this old GH issue which is in closed state and it is related to docker 1.0.0. Feel free to update anyof the existing issue with your docker version and steps to reproduce. |
A lot has changed from docker 1.0.0 & using this issue for later versions isn't useful. I will lock this issue for now. we can unlock it if someone see a need for it. |
Hi,
docker 1.0.0 with aufs on 14.04 here.
I haven't found a way to reproduce it, but since upgrade to 1.0.0 I quite often get the error "port has already been allocated" when starting a container that was stopped earlier:
And the processes aren't running either:
The text was updated successfully, but these errors were encountered: