Docker failed to initialize | Docker Desktop is shutting down

Hi All,

I am facing an issue with Docker for Windows application. This is happening after updating to newer version of 4.3.2. Previous version was running without any issues. After downloading and updating to new version, whenever I launch Docker Desktop I get error message " Docker failed to initialize. Docker Desktop is shutting down. ".

I have tried many solutions like:

  1. Closed docker and restarted laptop after update.
  2. Deleting log files in C:\Users\{...}\AppData\Local\Docker
  3. Deleting files in C:\Users\{...}\AppData\Roaming\Docker
  4. Tried to bump to previous release but unsuccessful with the message

Can anyone please help me resolve this issue as I have already wasted few hours to resolve this.

I am not sure if I should completely uninstall docker and install freshly. If doing so, may remove all existing volumes and containers. I don’t want to lose existing containers and data. BTW, I didn’t sign-in while working with containers.

Your help will be much appreciated.

Thanks in advance

P.S: I am working with Docker for Windows on Windows 10 machine with WSL2 enabled. I have also enabled Containers and Virtual Machine Platform in Windows Features.

i have the same problem …
I have re install docker desktop and WSL .
DOCKER desktop with adminatration don’t work.

1 Like

I suddenly started getting “Docker failed to initialize” message with v4.9.1. Thanks to @sourabh1107 's tip I looked at the logs and found

[2022-06-23T09:00:08.176804000Z][com.docker.backend.exe][E] writing locks to locked-directories: reading \AppData\Roaming\Docker\locked-directories: parsing JSON from \AppData\Roaming\Docker\locked-directories: invalid character ‘\x00’ looking for beginning of value

When I opened the file with Notepad+, I saw it had three NULL characters. I tried deleting those first, but then the log showed the error

[2022-06-23T09:01:11.658967500Z][com.docker.backend.exe][E] writing locks to locked-directories: reading \AppData\Roaming\Docker\locked-directories: parsing JSON from \AppData\Roaming\Docker\locked-directories: EOF

I then deleted the file, and Docker started up immediately.

While this specific solution may not address a specific occurrence, looking at the log file might provide clues.

1 Like