Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker credential helpers not supported on Windows #756

Closed
rnorth opened this issue Jun 15, 2018 · 5 comments
Closed

Docker credential helpers not supported on Windows #756

rnorth opened this issue Jun 15, 2018 · 5 comments
Labels

Comments

@rnorth
Copy link
Member

rnorth commented Jun 15, 2018

We've not yet had a chance to test RegistryAuthLocator on Windows, so it is unsupported.

If we can test it/fix it, it will enable us to properly support this feature.

@kiview
Copy link
Member

kiview commented Jun 22, 2018

I'll try to check this on Windows this weekend 👍

@kiview
Copy link
Member

kiview commented Jul 1, 2018

Here are my results so far. I was logged into docker hub.
For docker hub:

22:51:20.108 INFO  docker[alpine:latest] - Pulling docker image: alpine:latest. Please be patient; this may take some time but only needs to be done once.
22:51:20.109 DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: alpine:latest
22:51:20.110 DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Kivie\.docker\config.json (exists) and commandPathPrefix: 
22:51:20.112 DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential helper: docker-credential-wincred to locate auth config for: 
22:51:20.175 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure running docker credential helper (docker-credential-wincred)
22:51:20.177 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: alpine:latest, configFile: C:\Users\Kivie\.docker\config.json. Falling back to docker-java default behaviour
org.zeroturnaround.exec.InvalidExitValueException: Unexpected exit value: 1, allowed exit values: [0], executed command [docker-credential-wincred, get], output was 26 bytes:
no credentials server URL

For quay.io:

22:51:54.548 INFO  docker[quay.io/testcontainers/ryuk:latest] - Pulling docker image: quay.io/testcontainers/ryuk:latest. Please be patient; this may take some time but only needs to be done once.
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: quay.io/testcontainers/ryuk:latest
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Kivie\.docker\config.json (exists) and commandPathPrefix: 
22:51:54.549 DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential helper: docker-credential-wincred to locate auth config for: quay.io
22:51:54.604 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure running docker credential helper (docker-credential-wincred)
22:51:54.605 ERROR org.testcontainers.utility.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: quay.io/testcontainers/ryuk:latest, configFile: C:\Users\Kivie\.docker\config.json. Falling back to docker-java default behaviour
org.zeroturnaround.exec.InvalidExitValueException: Unexpected exit value: 1, allowed exit values: [0], executed command [docker-credential-wincred, get], output was 41 bytes:
credentials not found in native keychain
	at org.zeroturnaround.exec.ProcessExecutor.waitFor(ProcessExecutor.java:1118)
	at org.zeroturnaround.exec.ProcessExecutor.execute(ProcessExecutor.java:925)
	at org.testcontainers.utility.RegistryAuthLocator.runCredentialProvider(RegistryAuthLocator.java:162)
	at org.testcontainers.utility.RegistryAuthLocator.authConfigUsingStore(RegistryAuthLocator.java:129)
	at org.testcontainers.utility.RegistryAuthLocator.lookupAuthConfig(RegistryAuthLocator.java:88)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:99)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:27)
...

TBH, I not even getting docker-credential-wincred working by hand. list command works fine, get command doesn't return any output for me, maybe I'm doing something wrong?

aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 14, 2018
@aulea aulea mentioned this issue Sep 14, 2018
aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 14, 2018
aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018
aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018
…tials not found' error message for each credentials helper
aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 18, 2018
…tials not found' error message for each credentials helper. unix fake credential helper fix
aulea pushed a commit to aulea/testcontainers-java that referenced this issue Sep 20, 2018
rnorth pushed a commit that referenced this issue Sep 20, 2018
#756 tested on Windows. 
Fixed RegistryAuthLocatorTest on Windows and also allowed better fallbacks from running credential provider (to allow lookup alternative AuthConfigs), when:
1) there is no hostName, then there is no point to ask credentials
2) when credential helper response with "credentials not found in native keychain" to try other resources

Main reason for failing for me on Windows machine was #710 changes. When i used Netty or OkHttp together with npipe, then it worked fine. Yesterday evening i found out the reason and today morning i found also fix in master for that :-) - #865, breaking docker response by line breaks.
@stale
Copy link

stale bot commented Oct 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Oct 28, 2018
@rnorth
Copy link
Member Author

rnorth commented Oct 28, 2018

Ah, we released support for this in 1.9.1 (#868) so I shall close.

@nathantippy
Copy link

Stacktrace on windows 10 with junit-jupiter 1.10.5
"RegistryAuthLocator - Credentials not found for host (quay.io) when using credential helper/store"

[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Will use 'okhttp' transport
[main] INFO org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy - Accessing docker with local Npipe socket (npipe:////./pipe/docker_engine)
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with local Npipe socket (npipe:////./pipe/docker_engine)
[main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is localhost
[main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 18.09.1
API Version: 1.39
Operating System: Docker Desktop
Total Memory: 6442 MB
[main] INFO org.testcontainers.utility.RegistryAuthLocator - Credentials not found for host (quay.io) when using credential helper/store (docker-credential-wincred)
[tc-okhttp-stream-2088371948] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Get https://quay.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"}

at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:276)
at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.lambda$executeAndStream$1(OkHttpInvocationBuilder.java:292)
at java.lang.Thread.run(Thread.java:748)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants