-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Timeout to docker host causes containers to stop #2338
Comments
Can you provide an example of the command and output? Where is the engine running? virtualbox or a cloud instance somewhere? |
Hi, i'm using OSX (El Capitan) with virtual machine set up on virtualbox.
the core of the problem is described in #812 , but the what happens next, depends on compose's version Using 1.4.2 exception with stack is printed and that's all. Containers are still up and running .
|
Hi, I'm also facing this issue. Now that I've updated to 1.5.1 the containers graceful stop after 1 min, round, in every single try and then print the following error: I'm using OSX 10.11.1 |
I think a workaround for now is to run with |
@dnephin It works! Thank you. |
Same issue here on a newly installed mac OSX 10.10.4 (14E46) Docker compose
Docker
Running with If you need any more info, i'll be glad to provide it. |
This does not happen only with Python. I have a contained with SOLR. When it is enabled (uncommented) in I am using Docker-compose 1.5.0 and Docker 1.9.0 Running with Two questions:
|
@ChrisCinelli After running with docker-compose logs; while [ $? -ne 0 ]; do docker-compose logs; done; and you will have the logs just like you're used to. |
Thanks @nbap. I also just saw @dnephin's comment about I am also curious to know what cause the timeout. This happens only on 2 containers build by people in the same team. It seems there is a pattern. |
In my case tty: true If it's not enabled then everythings works as expected. Docker compose version information:
Digging deeper I noticed that problem seems to be in the So, disabling the timeout if pseudo-TTY enabled solves the above mentioned problem - https://gist.github.com/ux/ac4fd45392aedb380903. I don't know if it's a correct way to solve this problem, but it works for me. |
I don't think we want to remove the timeout. Timeouts are good. We should however add a retry so that if we hit the timeout it re-establishes the connection. |
Or it's good to somehow differentiate between no output and real connection timeout. On other hand timeout is disabled on multiplexed data. |
My case is the same as @ux's. I also agree we should distinguish between no output and a real connection timeout. The best option, IMO, would be to remove the timeout if pseudo tty is enabled and to use some form of keepalive to make sure that the connection is just inactive as opposed to timed out. |
We might be able to set keep alive on the TCP socket, I'm not that familiar with it. If we do that, we'll still want to keep the timeout though. |
Well, I'm still thinking that it's not bad to disable timeout. Regarding to this timeouts documentation http://docs.python-requests.org/en/latest/user/advanced/#timeouts there are
Further, it's good idea to enable TCP keep-alive - once in a certain period of time probe packet with no data will be sent to make sure that connection is still alive and it doesn't disappeared accidentally. That's the point how to find out if something is wrong with a connection. No output provided is not the reason for decision that something is wrong with connection. So, just to summarize - |
@ux's point seems reasonable. Will this bug's resolution get scheduled in the next milestone? |
Since there is an easy workaround (using |
there is a workaround to keep containers alive with -d but this : |
I agree with @dcharbonnier, it's not a good workaround. It's also not easy to find this workaround when a user first encounters the terminating instances and the "Couldn't connect to Docker daemon" error in the latest Docker Compose, so many users will be getting confused and wasting time. But a pull request would be great. |
Just a note - as of 1.5.2 (specifically, be5b7b6), we don't stop the containers when we encounter a timeout (or an error of any kind) - only when we get SIGINT or SIGTERM. It's still an issue that we detach, but at least we're not stopping the containers any more. |
This option let's us view stdout print statements but causes timeouts with docker-compose. It can be enabled momentarily when debugging until a fix is found. docker/compose#2338
I'm going to close this issue as a duplicate of #3106 since it has a more concise problem description and only describes the subset of the problem that we're still facing . The "containers get shutdown" side of the problem was fixes a few releases ago. Please follow along in that issue if you're interested. |
Before 1.5.0, from time to time, python stack trace was popping up.
In 1.5.0 this stack trace doesn't show up anymore, but all containers are stopped instead. Even though the target docker machine is running.
Reverted to 1.4.2 and it works fine.
The text was updated successfully, but these errors were encountered: