Skip to content

docker compose watch fails to detect permission issue and deadlocks #51092

@Trolldemorted

Description

@Trolldemorted

Description

On a WSL2 ubuntu, docker compose up --build --watch does neither abort nor work if the current user cannot access ignored folders.

On a "real" ubuntu, docker compose aborts with the following error message:

notify.Add("/home/benni/repositories/dockerfreeze"): watcher.Add("/home/benni/repositories/dockerfreeze/data"): permission denied

On a WSL2 ubuntu, /usr/libexec/docker/cli-plugins/docker-compose compose up --build --watch is stuck waiting for something, not sure whether it is the docker engine:

(gdb) bt
#0  0x000000000047fca3 in runtime.futex.abi0 ()
#1  0x000000000043c610 in runtime[futexsleep] ()
#2  0x00000000004170e7 in runtime[notesleep] ()
#3  0x00007ffc27a0fe80 in ?? ()
#4  0x00000000004179d1 in runtime.unlock2 ()
#5  0x0000000123196b06 in ?? ()
#6  0xffffffffffffffff in ?? ()
#7  0x0000000004339b00 in ?? ()
#8  0x00007ffc27a0feb0 in ?? ()
#9  0x0000000000447d2c in runtime[stopm] ()
#10 0x000000000433b498 in runtime.m0 ()
#11 0x0000000000000001 in ?? ()
#12 0x0000000004339b00 in ?? ()
#13 0x0000000004339b00 in ?? ()
#14 0x00007ffc27a10028 in ?? ()
#15 0x00000000004497fc in runtime[findRunnable] ()
#16 0x000000c00006c000 in ?? ()
#17 0x000000c000074f08 in ?? ()
#18 0x0000000000000000 in ?? ()

Reproduce

  • Install WSL2 ubuntu + docker as instructed here
  • Create .dockerignore
/data
  • Create Dockerfile
FROM ubuntu
WORKDIR /app
COPY . .
ENTRYPOINT ["tail", "-f", "/dev/null"]
  • Create compose.yml
services:
  test:
    build: .
    volumes:
      - "./data:/data"
    develop:
      watch:
        - action: sync
          path: .
          target: /app
  • sudo mkdir data
  • sudo chmod 700 data/
  • docker compose up --build --watch
  • Observe that the docker client is deadlocked, neither succeeding, nor aborting, nor responding to ctrl+c

Expected behavior

docker compose either aborts or succeeds. One could argue that permissions on ignored folders should not cause an abort, but that is a different problem.

docker version

Client: Docker Engine - Community
 Version:           28.4.0
 API version:       1.51
 Go version:        go1.24.7
 Git commit:        d8eb465
 Built:             Wed Sep  3 20:57:32 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.4.0
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.24.7
  Git commit:       249d679
  Built:            Wed Sep  3 20:57:32 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.28
  GitCommit:        b98a3aace656320842a23f4a392a33f46af97866
 runc:
  Version:          1.3.0
  GitCommit:        v1.3.0-0-g4ca628d1
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    28.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.29.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.39.4
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 14
 Server Version: 28.4.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b98a3aace656320842a23f4a392a33f46af97866
 runc version: v1.3.0-0-g4ca628d1
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.87.2-microsoft-standard-WSL2
 Operating System: Ubuntu 24.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 15.57GiB
 Name: Silberdachs
 ID: 07670eea-a2ba-43ee-bd99-c7bb2635df50
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions