# Ansible Invalid response from docker daemon: key \\"ApiVersion\\" is missing

**URL:** <https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092>\
**Category:** Get Help\
**Tags:** fedora, ansible, docker, ansible-core\
**Created:** [March 17, 2025, 4:17pm UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092 "2025-03-17T16:17:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seetharam](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@seetharam](https://forum.ansible.com/u/seetharam)\
**Post date:** [March 17, 2025, 4:17pm UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/1 "2025-03-17T16:17:15Z")

</div>

Hi,

While trying to deploy docker container we are facing:  
FAILED! =\> {“changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}

Please give some suggestions if any one encounter this kind of issue.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [March 17, 2025, 4:41pm UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/2 "2025-03-17T16:41:16Z")

</div>

Hard to tell since you provide almost no information. If you’re using Amazon Linux 2023 and certain modules/plugins from the community.docker collection, you might be hit by a bug in Amazon Linux 2023: [Amazon Linux 2023: Invalid response from docker daemon: key \"ApiVersion\" is missing."} · Issue #1033 · ansible-collections/community.docker · GitHub](https://github.com/ansible-collections/community.docker/issues/1033)

---

<div class="post-metadata">

**Author:** ![seetharam](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@seetharam](https://forum.ansible.com/u/seetharam)\
**Post date:** [March 18, 2025, 6:25am UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/3 "2025-03-18T06:25:23Z")

</div>

Earlier, I was able to restart and redeploy Docker containers through Ansible without any issues. However, suddenly, we’re encountering an **API version issue** , and we’re no longer able to start or redeploy containers on the target machines.

This our ansible and python version:  
ansible [core 2.11.3]  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/home/user/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible  
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections  
executable location = /usr/local/bin/ansible  
python version = 3.6.8 (default, Nov 15 2024, 08:11:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)]  
jinja version = 2.10.1  
libyaml = True

Here is an example of the playbook I used to retrieve Docker information from the target machines.

- name: Test Ansible-Docker Connection  
hosts: all  
gather\_facts: no  
tasks:
  - name: Get Docker Info  
community.docker.docker\_host\_info:  
register: docker\_info

  - name: Show Docker Info  
debug:  
var: docker\_info

fatal: [IP: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/libexec/platform-python”}, “can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/libexec/platform-python”}, “can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/libexec/platform-python”}, “can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/libexec/platform-python”}, “can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/libexec/platform-python”}, “can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}  
fatal: [IP]: FAILED! =\> {“can\_talk\_to\_docker”: false, “changed”: false, “msg”: “Error connecting: Invalid response from docker daemon: key "ApiVersion" is missing.”}

---

<div class="post-metadata">

**Author:** ![Nikhil\_Gedekar](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nikhil_gedekar/32/8112_2.png) [@Nikhil\_Gedekar](https://forum.ansible.com/u/Nikhil_Gedekar)\
**Post date:** [April 11, 2025, 8:10am UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/4 "2025-04-11T08:10:14Z")

</div>

Any solutions on this issue plz?? We are facing same issue is our env as well

---

<div class="post-metadata">

**Author:** ![seetharam](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@seetharam](https://forum.ansible.com/u/seetharam)\
**Post date:** [April 11, 2025, 8:56am UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/5 "2025-04-11T08:56:43Z")

</div>

Hi Nikhil,

It fixed for me when I upgraded our Ansible docker community modules.  
I removed complete collections path and downloaded another later version fixed  
.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 11, 2025, 8:57am UTC](https://forum.ansible.com/t/ansible-invalid-response-from-docker-daemon-key-apiversion-is-missing/41092/6 "2025-05-11T08:57:18Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
