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
live-restore in combination with docker compose is broken with docker-ce version 20.10.19 and newer #44422
Comments
This is most likely related to this change 66ddb7f (#44238) Poking around things I don't really see anything wrong in the code. It seems like you were exploiting a bug in live-restore before that has now been fixed that allowed volumes to be removed even though they were being referenced. |
as i mentioned in my detailed report version 20.10.18 was fine. i updated my report with a sample compose file, with this you can easily reproduce this behaviour. as a workaround for us we do not use named volumes with bind mounted directories anymore. |
Can you still reproduce on 23.0? |
I can confirm that this is still an issue on 24.0.2. Reproduced with this setup. Versions
Docker compose version
OS
Compose file
Start up the stack, auto-creating the volume
Restart docker daemon -- note that this bug exists across any restart, updating the docker daemon is just one possible trigger of a restart.
Bring down the container stack leaving volumes so we can see their state before trying to delete them. note that running
Current status of the volume
Now try to delete the volume
This failure should not happen. This appears to be a bug in the internal reference counting in the docker daemon. Restart the docker daemon again to try to clear up the error in reference counting.
Now notice that we can delete the volume with no error.
|
I am unable to reproduce the issue, either with live-restore or not. |
This is 100% reproducible for me. I've hit this issue over many versions of docker and on many similarly configured ubuntu systems. This burns me every time the docker daemon is restarted under my running stack and then I try to bring down the stack with I also notice that I have similar settings to @fichte in my
@cpuguy83 did you run your test with the same config? Maybe |
I just ran a few tests while reducing my docker daemon config file. I can 100% reproduce this with only this in my config file
|
I am running a dockerd from the dev branch. |
Also it is hitting me now that this error is coming from the (local) volume driver which is refcounting mounts and not from the volume service which handles refcounting objects referencing a volume. |
Looking through the code a bit, if I had to guess this is the cause: Lines 253 to 257 in a978888
Or more specifically that in live-restore BaseFS is not set.
|
And sure enough I can reproduce this with the graphdriver backend, does not reproduce with containerd snapshotters. |
Even worse, it is calling |
So this is happening because the active mount count is not initialized for live-restored containers. |
It also seems something on master has changed since I'd built it before and it is now broken with containerd snapshotters as well. |
Thank you very much for digging into this issue. |
I have a working patch for this, it needs tests and I'd like to do a bisect to see exactly the commit that caused the issue so it's going to take a bit of time to get this in, but I at least see what's happening. |
Draft PR is here: #45754 |
Description
Hello,
we are heavily using the live-restore feature in our production environments and facing automatic deployment issues through our ci. In our environment all Operating System Packages are updated automatically. When the docker engine gets updated and someone restarts a container in a running compose stack a docker compose down -v --remove-orphans does not work.
Update:
This happens particularly to named volumes with local driver and binded directory.
docker-compose.yml example
Operating System: Debian GNU/Linux 11.5 (Bullseye)
Reproduce
Expected behavior
docker compose down -v --remove-orphans should reliably tear down the stack
docker version
docker info
Additional Info
Docker Compose version v2.12.2
daemon.json
The text was updated successfully, but these errors were encountered: