You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docker in docker test fails with "Error while fetching server API version" #329
The core/tests/test_docker_in_docker.py::test_wait_for_logs_docker_in_docker test has started failing in CI without an obvious reason (see here for an example run). docker/docker-py#2717 may be related. @Duchadian, do you have thoughts on this?
FAILED core/tests/test_docker_in_docker.py::test_wait_for_logs_docker_in_docker -
docker.errors.DockerException: Error while fetching server API version:
HTTPConnectionPool(host='172.17.0.2', port=2375): Max retries exceeded with url:
/version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fda5372d090>:
Failed to establish a new connection: [Errno 111] Connection refused'))
I have the same problem on a M1 Mac. All of a sudden it started to crash. I guess it has something to do with the new version of Docker, I upgraded yesterday, until then it worked.
Edit: I can confirm that downgrading makes testcontainers work again
Hey @tillahoffmann, sorry I should have been more precise. I have this problem on docker desktop. In the gitlab CI we use it still works, but that runs on linux. In any case, locally I am running 4.16.2 (95914). It was just the installer that I had laying around. No other reason. I tried to look up on the docker github page but I cannot see any report that might explain this and I did not have time yet to really start digging to see if I can find what is going on and open a proper bug report
@tillahoffmann, there's a decent number of things that could have caused this as far as I can see. I don't think the CI failing suddenly and that you and @dfioravanti are seeing issues with a new version of docker desktop are unrelated.
There's probably been some change in how the docker api behaves in the new version (could be a change in endpoint, response, tls, etc.) that the docker client can't deal with, but it's strange that it only shows up with the DinD tests. My guess is some sort of verification on the calls to the docker api, but that's nothing more than my best guess without having looked into it at all.
I'll look into this when I have the time, which will probably be after the weekend.
in my case issue appeared after Docker Desktop upgrade v4.21.1 on M1.
fixed by enabling /var/run/docker.sock in Advanced settings in docker client:
Allow the default Docker socket to be used (requires password)
Creates /var/run/docker.sock which some third-party clients may use to communicate with Docker Desktop. [Learn more](https://docs.docker.com/desktop/mac/permission-requirements)
Reacted by Diego Fioravanti, Rogelio, Dan Coates, Kenneth Bowen, Souhib TRABELSI and Ben Cook
Reacted by Rogelio, edpyt, Marcin Konowalczyk, Artem Kostiuk, Vemund Hellekleiv, Donny Knight and Souhib TRABELSI
@gooner22 Thanks a lot, I forgot how I had fixed this and I had the same problem on a new machine. I have no idea why I did not comment my solution here 🤦 You saved me quite a lot of work finding it out
I'm also running into this. I use colima and my docker socket is located under unix://${HOME}/.colima/default/docker.sock. Is there a way to get it to use this one?
In Java it seems to work, because it respects ~/.testcontainers.properties.
Activity
dfioravanti commentedon Apr 12, 2023
I have the same problem on a M1 Mac. All of a sudden it started to crash. I guess it has something to do with the new version of Docker, I upgraded yesterday, until then it worked.
Edit: I can confirm that downgrading makes testcontainers work again
tillahoffmann commentedon Apr 12, 2023
Thanks for reporting, @dfioravanti. I also observe the issue on my M1.
Which version did you use to make the docker-in-docker tests work again?
dfioravanti commentedon Apr 13, 2023
Hey @tillahoffmann, sorry I should have been more precise. I have this problem on docker desktop. In the gitlab CI we use it still works, but that runs on linux. In any case, locally I am running
4.16.2 (95914). It was just the installer that I had laying around. No other reason. I tried to look up on the docker github page but I cannot see any report that might explain this and I did not have time yet to really start digging to see if I can find what is going on and open a proper bug reportDuchadian commentedon Apr 15, 2023
@tillahoffmann, there's a decent number of things that could have caused this as far as I can see. I don't think the CI failing suddenly and that you and @dfioravanti are seeing issues with a new version of docker desktop are unrelated.
There's probably been some change in how the docker api behaves in the new version (could be a change in endpoint, response, tls, etc.) that the docker client can't deal with, but it's strange that it only shows up with the DinD tests. My guess is some sort of verification on the calls to the docker api, but that's nothing more than my best guess without having looked into it at all.
I'll look into this when I have the time, which will probably be after the weekend.
gooner22 commentedon Jul 31, 2023
in my case issue appeared after Docker Desktop upgrade v4.21.1 on M1.
fixed by enabling /var/run/docker.sock in
Advanced settingsin docker client:dfioravanti commentedon Aug 6, 2023
@gooner22 Thanks a lot, I forgot how I had fixed this and I had the same problem on a new machine. I have no idea why I did not comment my solution here 🤦 You saved me quite a lot of work finding it out
moonbrv commentedon Aug 18, 2023
@gooner22 Thanks! I had it enabled, but after disable+enable it fixed my issue
rogelioLpz commentedon Dec 14, 2023
@gooner22 thanks a lot!
That works for me!! 🎉 🎉
FRosner commentedon Feb 28, 2024
I'm also running into this. I use
colimaand my docker socket is located underunix://${HOME}/.colima/default/docker.sock. Is there a way to get it to use this one?In Java it seems to work, because it respects
~/.testcontainers.properties.Edit: As a workaround, you can
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"fix(core): DinD issues #141, #329 (#368)
chore(main): release testcontainers 4.2.0 (#484)
fix(core): DinD issues testcontainers#141, testcontainers#329 (testco…
chore(main): release testcontainers 4.2.0 (testcontainers#484)
gpkc commentedon Dec 6, 2024
FYI I was able to make it work with the
~/.testcontainers.propertiesfile by settingtc.hostinstead ofdocker.host