Skip to content

Startup crash-loop: stale AF_UNIX socket files (dockerInference, secrets-engine engine.sock) cannot be removed on Windows; settings flags do not disable Inference listener (4.77.0) #460

Closed

Description

@NeuralNetNinjaT

Description

Docker Desktop on Windows enters a startup crash-loop after any unclean exit: each backend service that listens on an AF_UNIX socket file crashes startup because the stale socket file from the previous run cannot be removed — Windows reports the file as inaccessible until reboot (kernel-held by afd.sys). Each cleared component just exposes the next one.

Crash 1 (Inference manager):

starting services: initializing Inference manager: listening on unix://C:/Users/HansT/AppData/Local/Docker/run/dockerInference: remove C:/Users/HansT/AppData/Local/Docker/run/dockerInference: The file cannot be accessed by the system. (listener: The filename, directory name, or volume label syntax is incorrect.)

After manually clearing ...\Docker\run\ (rename of the parent directory — plain deletion of the socket file fails even with every Docker process stopped), startup proceeds one step further and dies on the next component's stale socket:

starting services: initializing Secrets Engine: listening on unix://C:/Users/HansT/AppData/Local/docker-secrets-engine/engine.sock: remove C:/Users/HansT/AppData/Local/docker-secrets-engine/engine.sock: The file cannot be accessed by the system. (listener: The filename, directory name, or volume label syntax is incorrect.)

The next unclean exit re-strands whichever sockets were created, and the loop repeats.

Reproduce

  1. Docker Desktop running normally (in our case 4.71.0, auto-updated to 4.77.0 mid-session; the Linux engine died ~5 minutes after the post-update restart).
  2. Any unclean backend exit leaves dockerInference / engine.sock socket files behind.
  3. Start Docker Desktop → crash dialog with the first error above ("Quit" / "Reset to factory defaults").
  4. Force-deleting the socket file from a shell fails ("The file cannot be accessed by the system") even with all docker*/com.docker.* processes stopped and after wsl --shutdown — only a reboot (or renaming the parent directory) clears it.

Expected behavior

A stale socket file that cannot be removed should not hard-crash the whole backend — fall back to a fresh path, or treat the listener as recreatable.

Notes

Environment

  • Docker Desktop: 4.77.0 (auto-updated from 4.71.0 on 2026-06-12), WSL 2 backend
  • Windows 11 Pro for Workstations, build 10.0.26200
  • Engine: 29.5.x

Diagnostics

Diagnostics ID can be provided on request.

Activity

  1. NeuralNetNinjaT commented on Jun 12, 2026

    @NeuralNetNinjaT
    Author

    Additional data points after further testing on the same machine (4.77.0, WSL 2.7.8.0, kernel 6.18.33.1-1):

    1. The strand-on-unclean-exit is immediate and reboot does not durably help. After a full Windows reboot (which clears the previously stranded socket files and lets the backend start), force-terminating the backend processes strands the freshly created dockerInference socket instantly — the next start crash-loops with the identical error. So ANY non-graceful backend exit (crash or process kill) reproduces the condition; only the currently stranded files are cleared by reboot.
    2. Separate post-update symptom: on the first boot after the 4.71.0→4.77.0 auto-update (and again after the reboot), the backend sat in still waiting for init control API to respond after 10m45s with vpnkit-bridge ... socketforwarder-receive-fds.sock: does not exist yet repeating — the docker-desktop WSL VM is "Running" but its init never answers. The force-kill performed to recover from THAT hang is what stranded the socket per (1) — the two failure modes chain into each other.
    3. Workaround that reliably clears a stranded socket without reboot: rename the parent directory (...\Docker\run, ...\docker-secrets-engine) — in-place deletion of the socket file fails from any tool, even SYSTEM-adjacent, with "The file cannot be accessed by the system".
  2. transferred this issue fromdocker/for-winon Jun 16, 2026
  3. bsousaa commented on Jul 13, 2026

    @bsousaa
    Collaborator

    Does this issue still reproduces on a recent version of Docker Desktop e.g. 4.80?

  4. asaals commented on Jul 31, 2026

    @asaals

    Does this issue still reproduces on a recent version of Docker Desktop e.g. 4.80?

    Yes, as of 4.83.0 (234302)

  5. kutzki commented on Aug 4, 2026

    @kutzki

    Happening to me rn.... Devs? :)))

  6. egordoronchenko commented on Aug 11, 2026

    @egordoronchenko

    Still reproduces on 4.86.0 (236216), so this now spans 4.71 → 4.77 → 4.86.

    Environment

    • Docker Desktop 4.86.0 (236216), engine 29.6.2, WSL 2 backend
    • Windows 11 Pro, build 26200.8875 (25H2), fully patched — no pending updates
    • Custom disk image location (CustomWslDistroDir), containerd snapshotter enabled

    What I can add to the report

    1. A clean reinstall does not help. I uninstalled Docker Desktop ("Docker Desktop Installer.exe" uninstall, exit 0), then installed from the full installer for the same build (not the delta updater). First start of the freshly installed app failed with the Secrets Engine socket:

      starting services: initializing Secrets Engine: listening on
      unix://C:/Users/<user>/AppData/Local/docker-secrets-engine/engine.sock:
      remove C:/Users/<user>/AppData/Local/docker-secrets-engine/engine.sock:
      The file cannot be accessed by the system.
      (listener: The filename, directory name, or volume label syntax is incorrect.)
      
    2. A reboot clears the blocking start, but does not make the files deletable. After a full OS reboot Docker Desktop started normally — yet the previously orphaned directories were still present and still undeletable, with the same error 1920.

    3. The sockets are left behind after a graceful shutdown too. I stopped everything with docker desktop stop (clean exit, no force-kill, engine reported stopped, wsl --shutdown afterwards). The next start still failed on the same stale socket. So this is not limited to unclean exits — a normal stop/start cycle is enough to trigger it.

    4. Every deletion method fails with ERROR_CANT_ACCESS_FILE (1920):

      Method Result
      Remove-Item -Force 1920
      [System.IO.File]::Delete() 1920
      cmd /c del /f 1920
      rd /s /q "\\?\<path>" (long-path prefix) 1920
      fsutil reparsepoint delete <file> Error 1920
      Rename-Item on the socket file 1920
      Rename the parent directory works
    5. Whack-a-mole confirmed. Clearing %LOCALAPPDATA%\Docker\run only moved the failure to %LOCALAPPDATA%\docker-secrets-engine\engine.sock. Both directories have to be cleared before every start.

    Workaround in use

    A launcher script that renames both parent directories when they contain reparse-point files, then starts Docker Desktop. Docker's own auto-start had to be disabled (AutoStart: false), otherwise Docker Desktop launches at logon before the cleanup runs and lands in the crash-loop again.

    $stamp = Get-Date -Format 'yyyyMMdd-HHmmss'
    foreach ($dir in @("$env:LOCALAPPDATA\Docker\run", "$env:LOCALAPPDATA\docker-secrets-engine")) {
        if (-not (Test-Path -LiteralPath $dir)) { continue }
        $sockets = Get-ChildItem -LiteralPath $dir -Force -ErrorAction SilentlyContinue |
                   Where-Object { $_.Attributes -band [IO.FileAttributes]::ReparsePoint }
        if ($sockets) {
            Rename-Item -LiteralPath $dir -NewName ((Split-Path $dir -Leaf) + ".stale-$stamp")
        }
    }
    Start-Process "$env:ProgramFiles\Docker\Docker\Docker Desktop.exe"

    The renamed directories can never be deleted afterwards — they survive reboots — so they accumulate and have to be parked somewhere out of the way.

    Suggestion

    Since the socket file provably cannot be removed on this Windows build, the listener setup could fall back to a fresh path (e.g. dockerInference-<pid> / a new subdirectory) instead of failing startup when remove returns ERROR_CANT_ACCESS_FILE. That would turn a hard crash-loop into a cosmetic leftover file.

  7. darrenCWJ commented on Aug 21, 2026

    @darrenCWJ

    Hitting this on 4.70.0 as well, so the affected range starts earlier than 4.71. A few things I was able to confirm or rule out by testing — hopefully useful for narrowing it down.

    A graceful shutdown also leaves the sockets behind, so this isn't limited to unclean exits

    A clean docker desktop stop, waited out until every Docker process had exited, still leaves all three files in place:

    %LOCALAPPDATA%\Docker\run\dockerInference
    %LOCALAPPDATA%\Docker\run\userAnalyticsOtlpHttp.sock
    %LOCALAPPDATA%\docker-secrets-engine\engine.sock
    

    The next start then fails on remove-then-listen. So the reproduction seems to be "every start following any stop", not "after a crash" — which matches it happening on essentially every launch here. I found 14 parked copies of those directories that had accumulated over about four weeks of working around it.

    Factory reset does not fix it

    The crash dialog's Reset to factory defaults reports success, and the very next start crashes identically on dockerInference.

    Worth noting for anyone weighing it: the reset did not remove images or containers here (9 images and 5 containers, including a 10GB one, all survived). So it's less destructive than expected — but it doesn't help.

    Windows Defender exclusions do not fix it

    Added exclusions for both %LOCALAPPDATA%\Docker and %LOCALAPPDATA%\docker-secrets-engine, then restarted with the leftover sockets deliberately left in place: identical crash. Defender is the only AV registered on this machine, so AV filter-driver interference looks ruled out.

    Which APIs actually fail

    On the leftover socket files, all of these return error 1920 (ERROR_CANT_ACCESS_FILE):

    • Remove-Item, del, rmdir
    • [System.IO.File]::Delete
    • fsutil reparsepoint delete

    One clarification that cost me some time: OpenRead fails the same way on live sockets during a perfectly healthy run. So "unreadable by the Win32 file API" is just how AF_UNIX socket files present on Windows — on its own it isn't evidence that a leftover is corrupt. The anomaly is specifically that delete fails on them.

    A cleaner workaround than reboot-or-rename: unlink them from WSL

    The Linux filesystem layer removes them without complaint:

    wsl -d Ubuntu -- rm -rf "/mnt/c/Users/<you>/AppData/Local/Docker/run"
    

    Unlike renaming the parent, this actually deletes them, so you don't leave an undeletable copy behind on every occurrence. Renaming still works and is what I automate before each start, but the WSL sweep is what let me clear the backlog.

    With the directories cleared, startup succeeds consistently in about 12 seconds.

    Environment: Docker Desktop 4.70.0, Windows 11 Pro (26200), WSL2 backend, Windows Defender only.

  8. estoll37 commented on Sep 2, 2026

    @estoll37

    Still reproducible on 4.89.0 — the .stale rename fix only survives one attempt

    I can confirm this on 4.89.0 (build 238018), and I think the new fix is very close but has an off-by-one-attempt flaw that is worth a look.

    What changed in 4.89.0. On 4.88.1 the failure was a failed delete:

    starting services: initializing Ingest server: listening on
    unix://C:/Users/<user>/AppData/Local/Docker/run/sailor-ingest.sock:
    remove C:/Users/<user>/AppData/Local/Docker/run/sailor-ingest.sock:
    The file cannot be accessed by the system.
    

    On 4.89.0 the same startup path now tries a rename instead, which is the right idea, since deleting these orphaned AF_UNIX reparse points is simply not possible from Win32:

    starting services: initializing Ingest server: listening on
    unix://C:/Users/<user>/AppData/Local/Docker/run/sailor-ingest.sock:
    rename C:/Users/<user>/AppData/Local/Docker/run/sailor-ingest.sock
           C:/Users/<user>/AppData/Local/Docker/run/sailor-ingest.sock.stale:
    The file cannot be accessed by the system.
    

    Why it still fails. The rename target is a fixed name. The first time it works — after one cycle I had dockerInference.stale and sailor-ingest.sock.stale sitting in %LOCALAPPDATA%\Docker\run. But those .stale files are orphaned reparse points too, and therefore just as undeletable and unrenameable as the originals. On the next startup the target name is already taken, the rename fails, and Docker Desktop is back to the same crash dialog. So the fix buys exactly one clean start per socket.

    Suggested fix: make the rename target unique per attempt — a timestamp or a random suffix (<name>.stale.<unixtime>) instead of a fixed .stale. That would make the recovery path idempotent regardless of how many corpses have piled up. Optionally sweep old .stale.* entries opportunistically and ignore failures.

    Measurements, in case they help.

    On 4.88.1, without intervention: 4 consecutive failures, and one docker desktop start hung for 7 min 55 s before failing. After clearing the socket directories first: 3.6-3.8 s.

    On 4.89.0, without intervention: the first cycle failed after 148 s. After clearing the socket directories first: 3.7-3.8 s across 10 consecutive cycles, no failure.

    Repro is simply docker desktop stop, wait, then start again — no crash or ungraceful shutdown needed. That matters because the 4.89.0 release note describes the fix as covering the case where "an ungraceful shutdown left behind a stuck socket file"; a plain stop is enough to produce it.

    Confirming the deletion wall, since it comes up in this thread: on the orphaned files, Remove-Item -Force, del /f /q /a, rmdir /s /q, [System.IO.File]::Delete() via the \\?\ long path, and a robocopy /PURGE against an empty directory all fail with the same Windows error 1920 (ERROR_CANT_ACCESS_FILE). fsutil reparsepoint query fails identically. Renaming the parent directory works, and deleting from inside a WSL distribution works — as already reported here.

    One unverified observation I'll flag as such rather than assert: in my runs, a wsl --shutdown immediately before the start attempt correlated strongly with success (3 successes vs. 4 failures without it), which would suggest a running distribution's /mnt/c mount keeps the files pinned. I only have a handful of samples and others in this thread report that wsl --shutdown did not help them, so treat that as a hint at most, not a finding.

  9. Utopiahomes commented on Sep 15, 2026

    @Utopiahomes

    I can reproduce this on a newer Docker Desktop release, including the sequence where moving one socket directory only exposes the next failure.

    Environment:

    • Docker Desktop 4.90.0 (Windows x64 GUI)
    • Docker CLI 29.7.2, API 1.55
    • Windows 11 10.0.26200.9457, x64
    • WSL 2.6.3.0, kernel 6.6.87.2-1, WSL2 backend

    Observed sequence:

    1. Startup failed while initializing the Ingest server because Docker could not rename %LOCALAPPDATA%\Docker\run\sailor-ingest.sock to .stale: The file cannot be accessed by the system.
    2. With Docker Desktop and backend processes stopped, I preserved the entire Docker\run directory under a timestamped sibling name and restarted Docker Desktop.
    3. Startup advanced to the Secrets Engine and failed while renaming %LOCALAPPDATA%\docker-secrets-engine\engine.sock to .stale with the same inaccessible-file error.
    4. With Docker stopped again, I preserved that entire parent directory under a timestamped sibling name and restarted.
    5. Startup returned to the sailor-ingest.sock failure in the newly recreated Docker\run directory. The Linux engine never became available.

    This suggests the parent-directory rename workaround is not sufficient on 4.90.0: startup can recreate and immediately strand a new AF_UNIX socket, returning to the first failure. No factory reset, uninstall, WSL unregister, or destructive cleanup was attempted.

    Diagnostics ID: 949B2614-539E-485E-9D14-A0238705A24D/20260915162759

  10. ctalledo commented on Oct 7, 2026

    @ctalledo
    Collaborator

    Hi folks, Cesar Talledo from Docker here. Thanks all for the reports.

    The fix should be present in DD 4.92 and later. Please try and let us know if you hit any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions