-
Notifications
You must be signed in to change notification settings - Fork 126
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
Amazon Linux 2023: Invalid response from docker daemon: key \"ApiVersion\" is missing."} #1033
Comments
This collection is for Docker, not for Podman. You seem to be using it with Podman. That might work in some cases, but not in others. Check that the Unix socket (/var/run/docker.sock) points to Docker and not to Podman. If you need podman to provide that socket, you need to provide the modules with the location of the Docker socket ( (Also please note that you should better use community.docker.docker_image_pull for pulling an image.) |
Nope, I'm using this collection for Docker.
You can reproduce the issue by lauching the Amazon Linux 2023, and install
Ansible and Docket via command 'dnf install ansible docker', nothing
special with the instance
…On Mon, 27 Jan 2025 at 11:19 Felix Fontein ***@***.***> wrote:
This collection is for Docker, not for Podman. You seem to be using it
with Podman. That might work in some cases, but not in others.
Check that the Unix socket (/var/run/docker.sock) points to Docker and not
to Podman. If you need podman to provide that socket, you need to provide
the modules with the location of the Docker socket (docker_host option,
can be set with the docker module defaults group for all modules).
(Also please note that you should better use
community.docker.docker_image_pull for pulling an image.)
—
Reply to this email directly, view it on GitHub
<#1033 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAJXPA4CGAXNRFVQMAVMDD2MWXW3AVCNFSM6AAAAABV5CU4O2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJUHAYTSOJVHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't use Amazon's cloud so I cannot easily check. What does |
Here is the output of the both commands. ls -lah /var/run/docker.sock
docker context ls --format json
|
Since a few days I have the same issue. And it was working a few weeks ago. Ansible version
Collection version
Docker version (on target machine, not control node)
Steps to reproduce
And when I call |
I think the issue has been fixed in the 2.16.3 version |
I'm using 2.16.3, and it's not working. |
You could try to insert some debug statements to try to figure out what is going wrong. https://pypi.org/project/q/ is quite useful for that. Also please note that your community.docker versions are pretty old. The latest 3.x.y version is 3.13.5, while you seem to have 3.4.8 resp. 3.7.0. (The current version is 4.3.1.) |
This error message is misleading. The code where the exception is happens makes a mistake in assuming that in this code fragment
the only
(I got this by reraising the exception.) This is exactly the issue #860 that #861 fixes. I can tell that this is the fix by how it starts working after I apply it on my instance. However, if you inspect what versions
Nowhere near 2.32! But wait. If you look at the same file that this commit changes, you'll see familiar code:
So, some Amazon Linux 2023 guys (or maybe a single overworked guy) backported things in Given, however, that amazonlinux/amazon-linux-2023#893 even exists (they have pushed a fixed version now), my opinion of their packaging team is very uncharitable right now. |
I have filed amazonlinux/amazon-linux-2023#902 because it's really AL2023 issue, my comrade in suffering. |
@jafd thanks for debugging this! I agree that the assumption that the |
SUMMARY
The docker_image and docker_container modules do not work in Ansible 2.15.13, I got error
"Error connecting: Invalid response from docker daemon: key \"ApiVersion\" is missing."
ISSUE TYPE
COMPONENT NAME
docker_image
docker_container
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Docker version
pip list|grep docker
STEPS TO REPRODUCE
EXPECTED RESULTS
Can pull the docker image
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: