-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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] watch crashes when deleting file #11066
Comments
Same thing happens when copying many files into a synced folder like this:
only way to recover from |
lock is managed by https://github.com/moby/moby/blob/master/pkg/pidfile/pidfile.go#L29 |
When the issue happens and I see that message, then there is no process with that PID. |
which OS are you running on ? |
|
Same on
|
Another workarround (Linux) is to stop containers before exiting watch. |
I've been implementing small script that watches The question is why it reports that |
@wclr process detection is implemented by https://github.com/moby/moby/blob/master/pkg/process/process_windows.go |
Well, here I believe it checks the process. But the fact is that when launching |
Same. No such process at Windows host itself, neither at the container I watch (Ubuntu based app image). Seems to exist somewhere within the "docker engine space" UPD. Managed to resolve this by updating to latest docker version. The installation itself said there's an assistance service process running and suggested to kill it. |
It is not fixed, I used the latest version when run into this. And you don't need to reboot, you can just delete I eventually ended up writing my own custom watch script to fully replace The problem mentioned in this issue is not the only one for current compose watch implementation, for example it also ignores /skips some file changes if they are made in a batch, so the custom solution can solve all this. |
I am deleting the image and the container and then run the
|
Can confirm that I'm seeing this issue on docker version 24.0.7, and a temporary work around for it is to delete the .pid file in: |
Encountered this on Desktop 4.27.1 (136059), Engine: 25.0.2, Compose: v2.24.3-desktop.1 |
Hey @perosb For all the other, if you don't have the same issue as the original one, please:
Thanks all 🙏 |
Errors are still occurring (I've updated to the latest Docker version
My OS :
If necessary, I can open a repository. |
for me manual delete file in AppData\Local\docker-compose\ *.pid solove problem but very annoying
|
@glours I'm actually facing this issue with my repo here: https://github.com/torrinworx/Bitorch To reproduce:
Result:
This is with docker desktop 4.27.2. |
Maybe this is related, but for me it looks like the I always need to delete that file, no other problems so far (but haven't played around with this new feature yet). Running Docker Desktop 4.27.2 on Windows 10 Pro 22H2 using HyperV. |
This file is not expected to be removed after command completion, but when executed compose command check the registered pid is alive (see https://github.com/moby/moby/blob/master/pkg/process/process_windows.go). |
@torrinworx 👋 |
@glours I'm using WSL2 on Windows 11 Home 22H2 22621.3155. Here is a video with this issue happening with the Bitorch repository I linked above: |
@torrinworx thank you very much! |
np! Huh yeah it looks like it's still taking the old desktop version: Docker Compose version v2.24.5-desktop.1 Even though my docker desktop client is saying v4.27.2 |
Unfortunately no 😞 , Compose |
@torrinworx can you try something else please, instead of doing
And a 2nd test:
|
Can you please check the status of the process listed in the lock file ? Get-Process -Id 146328 |
So both tests result in the same error:
However when I delete the .pid file from the directory they both work just fine. @ndeloof After I CTRL+C the watch command and delete the containers this is the result:
It only shows
|
Looking at the pidfile code which should detect process is done, I wonder |
@ndeloof agree |
Using the implementation from pkg/pidfile for windows, as that implementation looks to be handling more cases to check if a process is still alive (or to be considered alive). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@torrinworx can you try this specific version of Compose (choose the right binary for you) and install it with the name |
@glours That worked! I was able to re-watch the compose file and build the containers without seeing the PID error. |
This fix has been included in Compose 2.24.7+. If you continue to have problems after upgrading, comment here and we can re-open the issue or create a new one as appropriate. Thanks for the report! |
I will be documenting all of these experiments in a blog post but just wanted to leave it here in case someone gets stuck. Some data for you @milas , as I'm getting this on mac Monterey v 12.5 docker compose -f "docker-compose.yml" up -d --build --watch cannot take exclusive lock for project "xxx": process with PID 88950 is still running I THINK IT's the detached flag that is causing this... ??? (sorry for the brain dump. I keep playing wtih it and understanding more and more and maybe its useful to you...maybe not LOL) Note that --watch results in multiple terminal windows (as stated in the docs somewhere) : docker terminal and my zsh terminal window. * Update: I feel like I'm going a little crazy. After manually clsoing the docker terminal, then running with up --watch again, there is no docker terminal. Just my main zsh. I hate inconsistent outcomes. I've done this many times and this is a new behavior. With docker compose watch, docker compose down properly releases and gets me back to *Side question; I haven't been able to find any other guidance about using up --watch vs watch. Does it exist somewhere? |
Description
When deleting a file (unsure if the file existed or not but should have since it synced it) watch command crashes and cannot be restarted.
Then when trying to restart it is locked:
Killing the 20836 process still errors out the same.
Steps To Reproduce
It seem to be reproducable
Compose Version
Docker Environment
Anything else?
The file is not removed from container.
No idea of how/where the lock is kept.
A restart of docker-engine removed the lock.
The text was updated successfully, but these errors were encountered: