compose: [BUG] watch crashes when deleting file
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.
develop:
watch:
- action: sync
path: ${LOCAL_DEPLOY_PATH}\platform
target: c:/inetpub/wwwroot/
Syncing cm after changes were detected:
- C:\t\docker\deploy\platform\Web.config.xdt
☺�container 061ae4ad9ec878e7a259e45aa1d7b4bd0dc56468b05497fa18cd71dd5f1c0cbe encountered an error during hcs::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
Then when trying to restart it is locked:
> docker compose watch --no-up
cannot take exclusive lock for project "kermit": process with PID 20836 is still running
Killing the 20836 process still errors out the same.
Steps To Reproduce
It seem to be reproducable
watching [C:\t\docker\deploy\platform]
Syncing cm after changes were detected:
- C:\t\docker\deploy\platform\images.jpg
☻Rtar: Removing leading drive letter from member names
x inetpub/wwwroot/images.jpg☻☻
Syncing cm after changes were detected:
- C:\t\docker\deploy\platform\images.jpg
☺�container 7b26f6516e4c0ed000d0d71b1f01250411af2ddab0b17cd3f7f3b391a4ee97a0 encountered an error during hcs::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
Compose Version
Docker Compose version v2.22.0
Docker Environment
Client:
Version: 24.0.6
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.10.3
Path: C:\Users\Administrator\.docker\cli-plugins\docker-buildx.exe
compose: Docker Compose (Docker Inc.)
Version: v2.22.0
Path: C:\ProgramData\Docker\cli-plugins\docker-compose.exe
scout: Command line tool for Docker Scout (Docker Inc.)
Version: 0.17.1
Path: C:\Users\Administrator\.docker\cli-plugins\docker-scout.exe
Server:
Containers: 14
Running: 0
Paused: 0
Stopped: 14
Images: 861
Server Version: 24.0.4
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.1970)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 31.86GiB
Name: kermit-dev
ID: YP3Q:GBSN:NFJ3:QQMM:DB3Z:CD3V:7RBI:V445:473L:3WU3:VOP3:5DVB
Docker Root Dir: C:\ProgramData\docker
Debug Mode: false
Username: kermit
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 37 (14 by maintainers)
for me manual delete file in AppData\Local\docker-compose\ *.pid solove problem but very annoying
Same thing happens when copying many files into a synced folder like this:
only way to recover from
cannot take exclusive lock for projectis to restart the host, not even restarting Docker Desktop or dockerd helps.Another workarround (Linux) is to stop containers before exiting watch.
Ctrl+zto suspend watchdocker-compose downto stop and remove containersfgto bring watch process into foregroundCtrl+cto exit watch@pbering and @perosb a possible workaround so you don’t have to restart your host can be found in issue #11069:
https://github.com/docker/compose/issues/11069#issuecomment-1769694535
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!
@glours That worked! I was able to re-watch the compose file and build the containers without seeing the PID error.
Can you please check the status of the process listed in the lock file ?
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).
@glours I’m actually facing this issue with my repo here: https://github.com/torrinworx/Bitorch
To reproduce:
$ docker compose -f .\dev.docker-compose.yml build --no-cache$docker compose -f .\dev.docker-compose.yml watch$ ctrl+c, and delete/remove running container/compose stacks$ docker compose -f .\dev.docker-compose.yml watchResult:
This is with docker desktop 4.27.2.
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: C:\Users<your-user-name>\AppData\Local\docker-compose<your-project-name>.pid
Well, here I believe it checks the process. But the fact is that when launching
docker compose watchit reports thatprocess with PID XXXX is still runningwhile there is noXXXXin the tasklist (for example, in my case this PID was killed by the aforementioned script that spawneddocker compose watch). Рeople above mention this too,, so you probably need to check the logic behind this report and check to ensure that it can not be the case.