-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cannot pull images when logged in to Docker Desktop (Status 500: unauthorized: incorrect username or password) #5121
Comments
I have exactly the same issue with Test Container 1.16.2. This issue only occurs if the Docker image has to be pulled. As long as I have a local image everything is fine. |
Problem still exists with Test Containers 1.16.3 and Docker Desktop with versions: 4.2.0, 4.3.2, 4.6.1 and 4.7.0
Image pulled manually via |
Thanks for bumping this issue. I was recently running into this error on Docker Desktop as well. And can someone reproduce this with Docker Desktop on macOS as well? |
I tested on |
I don't know how I did that, but now containers are pulled correctly even if I am logged out of everything. |
@awojcik64 How I perceive the error so far with regards to pulling public images with Testcontainers:
For further triangulation, may I ask you @SiwyDym if you are sure that on macOS, you recently did a login through the Docker Desktop GUI and it still worked? Also, please make sure the images are not cache before trying out Testcontainers. So as a current workaround, I'd suggest doing the |
I can confirm that issue occurs when I login by Docker Desktop GUI :| |
@SiwyDym Can you confirm that performing the login through CLI mitigates the issue? |
I cannot confirm that, the only working mitigation for me is manually pulling the image |
@SiwyDym I see. Can you instead confirm that it works if your Docker daemon is unautheticated? (after |
Another interesting aspect to try out is if doing a |
I'm running Docker Desktop 4.7.0 (77141) on Windows 21H2. As a new user, I was completely unable to find any workaround from the selection above. I tried logging out, logging in via the UI, logging in via the command line, logging into I then went to Docker Desktop and clicked "Reset to factory defaults" and it worked perfectly first time (not logged in). I tried deleting the images and it re-download them perfectly. However, when I then logged in using the command line and removed the images, it failed again. Once I reset Docker Desktop again, everything worked again. Hope that helps. |
Thanks a lot for sharing your experiences @jodastephen, this really helps in triaging this issue. I am currently in the process of debugging and triaging as well. What seems to help is to, in addition to performing a
I currently suspect this is caused by changes to the Docker Hub registry, but the permutation in which this is currently failing are unfortunately not 100% clear to me yet. |
I am also having this exact issue. I am setting up a new development environment on a M1 Max MacBook Pro, with latest Docker (darwin/arm64). I have tried all the suggestions in the previous comments; i.e. logging out of docker, logging in via CLI (with and without The only thing that ever works for me is to manually pull the image Docker Desktop 4.7.0 (77141) |
Would someone affected by this issue like to try out this PR from Jitpack? |
This worked for me running the test from the Micronaut Data-JDBC guide. I used the following dependencies from jitpack:
|
This appears to work for me, thanks. |
Based on the idea behind the PR I tried the following workaround with the current release and it works for me on Windows:
Would anyone affected like to give it a try as well? |
That worked for me on M1 Macbook Pro. It added an |
i tried resetting docker windows setup to defaults, login / logout with docker (and specific registry urls) nothing helped. The only thing that helped me was pulling every image needed manually. But there was something odd: The first image needed was ryuk (one project 0.3.3 another 0.3.1) but after pulling only this and run the project again i get too many failed login requets for the other images to pull (for ryuk i always got unauthorized). |
@dermoritz So you say, login with exactly |
@kiview I can also confirm the command fixes this for me. |
- Fix testcontainers for integration tests - startDockerContainer takes http endpoint for up check - Exclude jna from spring-shell as more recent version is required by testcontainers - Bump rocksdbjni to 7.1.2 - Use testcontainers 9baede using jitpack to solve testcontainers/testcontainers-java#5121 - Fix Mule integration tests by excluding WMQ when running on Mac M1 - Move dependency to RocksDB into openrewrite module
Can confirm the same issue with M1 Mac, Docker Desktop Nothing mentioned up here doesn't help - still getting:
Tried to pull test image manually - no way :( |
You are now getting this error from registry:
That's why the workaround did not work. You have to wait until the block times out on Docker Hub. |
Still waiting for several (5?) days, so... |
Which is the workaround you have currently applied? Also, maybe the block does not time out if you are connecting from the same IP address. |
@kiview I just tried the command line fix on macOS 12.3.1 (M1 Pro) running Docker Desktop 4.8.1 and confirmed it works here too. Thank you! Edit: This was also using Testcontainers 1.16.2 |
The fix that worked for me on an M1 Mac was: |
I'm running into this problem in our CI environment. We're running testcontainers via maven and this is the command line we use to run maven: We need to use a private registry to get the containers that are being tested, but for some reason, this seems to break testcontainers ability to fetch public containers:
Since the container that we're running the Maven tests from within doesn't have the docker executable, I can't run Does anybody have anything I could try out to get this working? |
@StFS Can you please ask about this in Slack, or open a dedicated discussion/issue? |
Good point. Sorry about that. |
Had the same issue. Logout, and than login via console. Helped for me.
|
Note: If it isn't working, make sure to log out of docker. See: testcontainers/testcontainers-java#5121
…ontainers/dockerDesktop v.4.22.0 that forces mitigations as advised in the issue (testcontainers/testcontainers-java#5121): 1. Logout of Docker Desktop 2. Run a cmd to log into Dockerhub Up'd the portgresVersion because of a vulnerability in the older version.
This is the exact situation I have as well. Has anyone found a workaround or solution? |
I am also encountering this issue while running Github Actions locally using Act. I have tried all the suggestions above, and none seem to work. When running my tests in CI (Github Actions), it works fine though. |
sorry this isnt a valid solution, somebody must run this in a pipeline for example, the image must be pulled |
@angelomelonas We never tested TC with Act, but essentially, this will lead to Docker-in-Docker scenario, so the issue you are facing here, is very likely independent from the issue that is discussed here. I would suggest opening a dedicated issue or discussion for using TC with Act and Docker authentication. |
Ah that does makes sense. I will create a separate issue for that. Thanks @kiview! |
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.
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
The text was updated successfully, but these errors were encountered: