-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[BUG] Compose gets stuck when dealing with failed service that's indirectly depended on by another service #10728
Comments
This has been fixed by #10725, release v2.19.0 includes this fix if you can give it a try and confirm |
Thanks! I will try it out as soon as the update to 2.19 ships as part of Docker Desktop. |
Hi @ndeloof can you provide instructions for how to test the updated docker-compose 2.19? I'm currently running the latest Docker for Mac which uses this version:
Docker for Mac installs it in /usr/local/bin/. I can replace it with the binary from https://github.com/docker/compose/releases/tag/v2.19.0 but how do I make |
@jamshid download adequate binary from https://github.com/docker/compose/releases and move under |
Amazing! I think we can close this then. |
Closing as fixed, v2.19.0 will also be included with the next Docker Desktop release (v4.21). Thanks for reporting and confirming the fix! |
I get this error when I try running
The file seems correct:
To woarkround this I was able to
FWIW the failing github release version (docker-compose-darwin-x86_64) is a little larger than the working brew version: |
Description
When creating a chain of init containers using using the
depends_on:
field in a compose file together withcondition: service_completed_successfully
, I expect docker compose to fail and stop if one container in the chain fails and there are no other dependencies left to meet, i.e. if there are no executable services left in the stack because they all completed or depend on a failed service.However, having a chain on
depends_on:
for multiple services can cause docker compose to lock up and not quit, even though there are no containers left to run. At that point, force-quitting by pressing Ctrl+C multiple times is the only way to stop the stack.This poses a problem for any kind of script or automation that acts on the success/failure of a docker compose command, as it can just get stuck forever.
Steps To Reproduce
Consider the following stack:
This stack behaves as expected, quitting back to the console with an error message and leaving
step_2
in theCreated
state:Now expand the stack with one more step:
This stack never finishes! It reports the failure of
step_1
and then does nothing, even after minutes of waiting:Pressing Ctrl+C once, causes compose to try to stop all containers. But they are already stopped, because they didn't even start. It just hangs again, requiring multiple presses of CTRL+C to finally quit:
Compose Version
Docker Environment
Anything else?
I am using Docker Desktop with WSL2 on Win10 Home.
This issue was apparently introduced in Docker Desktop 4.20.
I tried it on my laptop (Also WSL2, but Win10 Pro) which still had 4.19 and it did not show this behavior before, but developed the same issue after installing the update to 4.20.
The text was updated successfully, but these errors were encountered: