Compose: Windows docker fails to use build function of docker-compose

Created on 7 Mar 2020  路  8Comments  路  Source: docker/compose

Description of the issue

Errors about credential occurs on build within docker-compose.yml on Windows.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.25.4, build 8d51620a
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c  28 May 2019

Output of docker version

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:37 2019
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:29:19 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  redis:
    image: redis:alpine
  web:
    build:
      context: C:\Users\cacog\OneDrive\Documents\composetest
    ports:
    - 5000:5000/tcp
version: '3.0'

Steps to reproduce the issue

  1. Follow Step 1 to Step 4 of Get started with Docker Compose

Observed result

docker-compose up of Step 4 fails to build.

Expected result

Successfull docker-compose up.

Stacktrace / full error message

Building web
Traceback (most recent call last):
  File "site-packages\docker\credentials\store.py", line 80, in _execute
  File "subprocess.py", line 395, in check_output
  File "subprocess.py", line 487, in run
subprocess.CalledProcessError: Command '['C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker-credential-desktop.EXE', 'list']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 72, in main
  File "compose\cli\main.py", line 128, in perform_command
  File "compose\cli\main.py", line 1077, in up
  File "compose\cli\main.py", line 1073, in up
  File "compose\project.py", line 548, in up
  File "compose\service.py", line 367, in ensure_image_exists
  File "compose\service.py", line 1106, in build
  File "site-packages\docker\api\build.py", line 261, in build
  File "site-packages\docker\api\build.py", line 308, in _set_auth_headers
  File "site-packages\docker\auth.py", line 302, in get_all_credentials
  File "site-packages\docker\credentials\store.py", line 71, in list
  File "site-packages\docker\credentials\store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error listing credentials - err: exit status 1, out: `A specified logon session does not exist. It may alrea
dy have been terminated.`".
[2780] Failed to execute script docker-compose

Additional information

OS version

  • Edition : Windows 10 Pro
  • Version : 1903
  • OS build : 18362.657

docker-compose install method

docker-compose is installed with official installer of docker.

kinbug

Most helpful comment

I find that this error only occurs over ssh.
I'm using ssh server on windows, Win32 OpneSSH and when I use docker-compose build over ssh, above error occurs.
However, when I try docker build (not docker-compose build) over ssh, it works well. So I think it's still a problem of docker-compose and I'll leave this issue opened.

All 8 comments

I find that this error only occurs over ssh.
I'm using ssh server on windows, Win32 OpneSSH and when I use docker-compose build over ssh, above error occurs.
However, when I try docker build (not docker-compose build) over ssh, it works well. So I think it's still a problem of docker-compose and I'll leave this issue opened.

Same here: docker and docker-compose versions are exactly the same, but running on WIndows 10 1909 (18363.418).
The error also does occur when sitting right in front of the system (so not ssh'ing into Windows). Deleting %userprofile%.dockerconfig.json solves the problem and docker-compose pull runs without any errors. But config.json gets recreated after some time.

Same here: docker and docker-compose versions are exactly the same, but running on WIndows 10 1909 (18363.418).
The error also does occur when sitting right in front of the system (so not ssh'ing into Windows). Deleting %userprofile%.dockerconfig.json solves the problem and docker-compose pull runs without any errors. But config.json gets recreated after some time.

I tried this solution, but still have error over ssh.

Try renaming the file instead of deleting it. The file will get re-created almost immediately after it is deleted. Renaming it (config.bla or whatever) gives you some extra seconds until it is also recreated.

@Hooch76 Thank you for advice, but even I change file name with mv command and retry, it shows same error.

It happens to me when I use git bash, when I run the command on the windows cmd this problem does not happen

It happens to me when I use git bash, when I run the command on the windows cmd this problem does not happen.

FWIW I can confirm the same issue. I am using Docker desktop on Windows 10 Home Single Language (version 2004, OS Build 19041.508 ) with WSL2.
Here's the output of docker-compose up on Git Bash. (But if i run the docker-compose up on Windows command prompt it seems to be working fine)

 Traceback (most recent call last):
  File "site-packages\docker\credentials\store.py", line 80, in _execute
  File "subprocess.py", line 395, in check_output
  File "subprocess.py", line 487, 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 "site-packages\docker\auth.py", line 264, in _resolve_authconfig_credstore
  File "site-packages\docker\credentials\store.py", line 35, in get
  File "site-packages\docker\credentials\store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exec: "docker-credential-wincred.exe": executable file not found in %PATH%, out: ``".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 72, in main
  File "compose\cli\main.py", line 128, in perform_command
  File "compose\cli\main.py", line 1078, in up
  File "compose\cli\main.py", line 1074, in up
  File "compose\project.py", line 548, in up
  File "compose\service.py", line 361, in ensure_image_exists
  File "compose\service.py", line 1250, in pull
  File "compose\progress_stream.py", line 102, in get_digest_from_pull
  File "compose\service.py", line 1215, in _do_pull
  File "site-packages\docker\api\image.py", line 396, in pull
  File "site-packages\docker\auth.py", line 48, in get_config_header
  File "site-packages\docker\auth.py", line 324, in resolve_authconfig
  File "site-packages\docker\auth.py", line 235, in resolve_authconfig
  File "site-packages\docker\auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exec: "docker-credential-wincred.exe": executable file not foundial-wincred.exe": executable file not found in %PATH%, out: ``".')
[13052] Failed to execute script docker-compose

For more info about the docker version I am using is the output of docker version command from command prompt:

Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:43:18 2020
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a66213fe
Built: Mon Jun 22 15:49:27 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

Thanks

Hey guys we are having the same issue. Any progress on this or workarounds. We too see it happening more over ssh (we have jenkins ssh-ing in and calling it) though I think we reproduced it once without (can't confirm for sure it was exactly the same thing).

It seems intermittent so can't always tell if deleting the file is helping or not

Using docker desktop 2.4.0.0 (48506)

[4480] Failed to execute script docker-compose
Traceback (most recent call last):
  File "site-packages\docker\credentials\store.py", line 80, in _execute
  File "subprocess.py", line 395, in check_output
  File "subprocess.py", line 487, in run
subprocess.CalledProcessError: Command '['C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker-credential-wincred.EXE', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages\docker\auth.py", line 264, in _resolve_authconfig_credstore
  File "site-packages\docker\credentials\store.py", line 35, in get
  File "site-packages\docker\credentials\store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-wincred exited with "A specified logon session does not exist. It may already have been terminated.".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 67, in main
  File "compose\cli\main.py", line 126, in perform_command
  File "compose\cli\main.py", line 1070, in up
  File "compose\cli\main.py", line 1066, in up
  File "compose\project.py", line 615, in up
  File "compose\service.py", line 356, in ensure_image_exists
  File "compose\service.py", line 1267, in pull
  File "compose\progress_stream.py", line 99, in get_digest_from_pull
  File "compose\service.py", line 1234, in _do_pull
  File "site-packages\docker\api\image.py", line 396, in pull
  File "site-packages\docker\auth.py", line 48, in get_config_header
  File "site-packages\docker\auth.py", line 324, in resolve_authconfig
  File "site-packages\docker\auth.py", line 235, in resolve_authconfig
  File "site-packages\docker\auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-wincred exited with "A specified logon session does not exist. It may already have been 
terminated.".')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

darkrasid picture darkrasid  路  3Comments

HackerWilson picture HackerWilson  路  3Comments

saulshanabrook picture saulshanabrook  路  3Comments

maltefiala picture maltefiala  路  3Comments

DhairyashilBhosale picture DhairyashilBhosale  路  3Comments