question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot pull images when logged in to Docker Desktop (Status 500: unauthorized: incorrect username or password)

See original GitHub issue

Test Containers 1.16.3 on Docker Engine 20.10.12 with Docker Desktop using WSL2 Backend on Windows 21H1.

When I am logged in to my account in Docker Desktop, Test Containers can no longer pull images from Docker Hub. Once I log out of my account, Test Containers is able to pull images as expected.

com.github.dockerjava.api.async.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"Head \"https://registry-1.docker.io/v2/testcontainers/ryuk/manifests/0.3.3\": unauthorized: incorrect username or password"}
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
	at java.base/java.lang.Thread.run(Thread.java:833)

I think my Docker installation is fine, as I can pull images from the terminal when I am logged in to Docker Desktop. I don’t want to log out every time I use Test Containers. How can I fix this issue?

Logs (on INFO): https://pastebin.com/fyExxi76

Logs (on DEBUG): https://pastebin.com/b4H283fL

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

25reactions
kiviewcommented, Apr 19, 2022

Based on the idea behind the PR I tried the following workaround with the current release and it works for me on Windows:

docker login index.docker.io

Would anyone affected like to give it a try as well?

10reactions
wettedcommented, Apr 19, 2022

That worked for me on M1 Macbook Pro. It added an {"auths":{"index.docker.io":{}}} entry in my ~/.docker/config.json file. Thereafter the workaround persists across, restarts, etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unauthorized: incorrect username or password
You can do this by signing out from the system tray icon, or by logging in at a command prompt, using the syntax...
Read more >
I have added testcontainer in spring boot app - Stack Overflow
I have installed docker desktop and logged it using docker desktop And then try using cli. When Running it Getting the below error....
Read more >
Fix docker ERROR: unauthorized: incorrect username or ...
1. Open cmd and type “docker logout” and you'll get this message. $ docker logout. Removing login credentials for https://index.
Read more >
Docker Tip #67: Incorrect Username or Password When ...
Using Docker to pull a public image should not require authentication but if your Docker Hub login credentials are bad it will fail....
Read more >
Troubleshooting errors with Docker commands when using ...
Error : "Filesystem Layer Verification Failed" when pulling images from Amazon ECR ... authenticated to Docker using the aws ecr get-login-password command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found