Update to 2.4.0.0: docker login from WSL2 distro fails with .../docker-credential-desktop.exe: Invalid argument
- [x] I have tried with the latest version of my channel (Stable or Edge)
- [x] I have uploaded Diagnostics
- Diagnostics ID: D277A93A-1E25-4716-AE7A-56BBB29CD950/20201015094317
Expected behavior
Docker login, docker-compose work as before
Actual behavior
Docker login, docker-compose fail from WSL2 distro
Information
- Windows Version: 19041
- Docker Desktop Version: 2.4.0.0
- Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No
Steps to reproduce the behavior
(from powsershell)
- docker login -> works
- relogin works with existing credentials
(from wsl2 distro)
-
docker login -> fails /c/Program Files/Docker/Docker/resources/bin/docker-credential-desktop.exe: Invalid argument Error saving credentials: error storing credentials - err: exit status 1, out: `
-
docker-compose up (only hello-world as service) -> fails
/c/Program Files/Docker/Docker/resources/bin/docker-credential-desktop.exe: Invalid argument Traceback (most recent call last): File "docker/credentials/store.py", line 80, in _execute File "subprocess.py", line 411, in check_output File "subprocess.py", line 512, in run subprocess.CalledProcessError: Command '['/c/Program Files/Docker/Docker/resources/bin/docker-credential-desktop.exe', 'get']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "docker/auth.py", line 264, in _resolve_authconfig_credstore File "docker/credentials/store.py", line 35, in get File "docker/credentials/store.py", line 93, in _execute docker.credentials.errors.StoreError: Credentials store docker-credential-desktop.exe exited with "".
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bin/docker-compose", line 3, in
- docker run hello-world -> pulls latest but with warning /c/Program Files/Docker/Docker/resources/bin/docker-credential-desktop.exe: Invalid argument
I have this issue as well.
Docker Desktop Version: 2.4.2.0 (48975)
I was able to get it to work by setting appendWindowsPath = true in /etc/wsl.conf.
[automount]
enabled = true
[interop]
appendWindowsPath = true
This could be related to #9278 as well. I was able to set appendWindowsPath = false after I disabled the build kit feature.
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": false,
"experimental": true,
"features": {
"buildkit": false
}
}
For me, have this in my ~/.docker/config.json fixed docker-credentials errors.
{
"_credSstore": "desktop",
"experimental": "enabled"
}
Note the underscore, without the underscore I can't docker build ("docker-credential-desktop": executable file not found in $PATH).
If I remove the underscore, it only fixes docker-compose, not docker build.
Warning, the file seems to update itself... (after docker update ? wsl --shutdown ?)
No related to my /etc/wsl.conf configuration where I have disable some options...
[interop]
enabled=false # enable launch of Windows binaries; default is true
appendWindowsPath=false # append Windows path to $PATH variable; default is true
The login is ok!
Original post: https://github.com/docker/for-win/issues/6652#issuecomment-662960874
But is not normal to have to change this config.json manually...
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
Just ran into this on a coworkers machine. Latest docker for win, latest version of windows, WSL2.
[automount]
enabled = true
[interop]
appendWindowsPath = true
in /etc/wsl2 fixed it for us as well.
Anyone knows which executables from the Windows-side are necessary for authentication to work? Enabling appendWindowsPath causes tab-completion on the shell to be very slow but adding some specific folder Docker needs would be no problem.
I tried adding
C:\Program Files\Docker\Docker\resources\binC:\ProgramData\DockerDesktop\version-bin
unfortunately without success.
EDIT: Adding these directories to path actually did the trick, Docker authenticates using the credentials from Windows without having to use appendWindowsPath. Add the following to your profile:
export PATH="/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:$PATH"
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
Remains an issue
For me, have this in my ~/.docker/config.json fixed docker-credentials errors.
{ "_credSstore": "desktop", "experimental": "enabled" }Note the underscore, without the underscore I can't
docker build("docker-credential-desktop": executable file not found in $PATH). If I remove the underscore, it only fixesdocker-compose, notdocker build.Warning, the file seems to update itself... (after docker update ? wsl --shutdown ?)
No related to my /etc/wsl.conf configuration where I have disable some options...
[interop] enabled=false # enable launch of Windows binaries; default is true appendWindowsPath=false # append Windows path to $PATH variable; default is true
The login is ok!
Original post (I didn't need a symbolic link): #6652 (comment)
But is not normal to have to change this config.json manually...
This just worked for me, but remains to be seen how sustainable it is. Would like a proper fix at some point though.. the perils of using windows 🤒
Same issue, since I installed Windows 11, I have:
> docker login
/usr/bin/docker-credential-desktop.exe: Invalid argument
Same issue, since I installed Windows 11, I have:
> docker login /usr/bin/docker-credential-desktop.exe: Invalid argument
Hi @olivierchatry, try to remove the file: $HOME/.docker/config.json, it worked for me.
-> Make sure that you backup the file first....
@thaylongs thanks ! but it did not help. Just running the command give me the same results :

Tried unstalling and resintalling, still the same error.
Update, running it in a normal window shell does not give me any error :

So it is really about wsl.
Turning off buildkit ( "buildkit": false in json config ) made it work. Would be great if this can be fixed.
So, turn out, I installed WSl using the new app store from windows 11, and this seems to not work correctly with docker desktop. Uninstalled it ( it work alongside the normal "add remove feature" way of installing ), and then everything working find and dandy.
I was able to get it to work via changing the symlink for docker-credential-desktop.exe in the wsl /usr/bin:
sudo ln -sf /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-credential-desktop.exe /usr/bin
The existing symlink pointed to a different executable that was broken:
/usr/bin/docker-credential-desktop.exe -> /mnt/wsl/docker-desktop/cli-tools/usr/bin/docker-credential-desktop.exe
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale Still an issue.
I am getting a similar error message when doing docker pull from WSL.
My IT org has enabled AppLocker on Windows, and it is blocking /usr/bin/docker-credential-desktop.exe.
WSL2
$ docker pull ubuntu
Using default tag: latest
/usr/bin/docker-credential-desktop.exe: Invalid argument
latest: Pulling from library/ubuntu
Digest: sha256:26c68657ccce2cb0a31b330cb0be2b5e108d467f641c62e13ab40cbec258c68d
Status: Image is up to date for ubuntu:latest
docker.io/library/ubuntu:latest
Windows Powershell
Get-WinEvent 'Microsoft-Windows-AppLocker/*' -MaxEvents 100000 | Where LevelDisplayName -eq 'Error' | Format-Table -Wrap
ProviderName: Microsoft-Windows-AppLocker
TimeCreated Id LevelDisplayName Message
----------- -- ---------------- -------
11-05-2022 12:53:36 8004 Error \\WSL$\UBUNTU\MNT\WSL\DOCKER-DESKTOP\CLI-TOOLS\USR\BIN\DOCKER-CREDENTIAL-DESKTOP.EXE was prevented from running.
11-05-2022 12:45:17 8004 Error \\WSL$\UBUNTU\MNT\WSL\DOCKER-DESKTOP\CLI-TOOLS\USR\BIN\DOCKER-CREDENTIAL-DESKTOP.EXE was prevented from running.
11-05-2022 11:03:33 8004 Error \\WSL$\UBUNTU\MNT\WSL\DOCKER-DESKTOP\CLI-TOOLS\USR\BIN\DOCKER-CREDENTIAL-DESKTOP.EXE was prevented from running.
this solved my problem - https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225/5
Solution:
In ~/.docker/config.json change credsStore to credStore