Skip to content
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

Docker container command throws timeout error #526

Closed
mohd-akram opened this issue Dec 7, 2022 · 5 comments · Fixed by #527
Closed

Docker container command throws timeout error #526

mohd-akram opened this issue Dec 7, 2022 · 5 comments · Fixed by #527
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)

Comments

@mohd-akram
Copy link

SUMMARY

Long-running docker commands seem to throw a "read timed out" error despite them processing. This did not happen with previous versions.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_container

ANSIBLE VERSION
ansible [core 2.14.0]
  config file = /home/user/.ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.0 (main, Oct 24 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION
Collection       Version
---------------- -------
community.docker 3.2.1
CONFIGURATION
CONFIG_FILE() = /home/user/.ansible.cfg
OS / ENVIRONMENT

Fedora 37

STEPS TO REPRODUCE
  1. sudo dnf install podman-docker && sudo systemctl start podman
  2. Run ansible-playbook -K test-docker-command.yml
  3. The command will throw an error, despite it still running fine (sudo docker logs -f osm-import).
- name: Deploy
  hosts: localhost
  become: yes
  tasks:
    - name: Import data
      docker_container:
        name: osm-import
        command: import
        detach: no
        cleanup: yes
        image: overv/openstreetmap-tile-server
EXPECTED RESULTS

Completes successfully.

ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: requests.exceptions.ConnectionError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.
fatal: [localhost]: FAILED! => {"changed": false, "msg": "An unexpected requests error occurred when trying to talk to the Docker daemon: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out."}
@felixfontein
Copy link
Collaborator

This did not happen with previous versions.

Do you mean previous 3.x.y releases, or 2.x.y/1.x.y?

@felixfontein felixfontein added bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack) labels Dec 7, 2022
@mohd-akram
Copy link
Author

The problem exists in 3.0.0 per my testing. The 2.x branch doesn't have this issue. I was on Fedora 35 probably when it worked, I assume it carried 2.x.

@felixfontein
Copy link
Collaborator

- hosts: localhost
  gather_facts: false
  tasks:
    - name: Wait
      docker_container:
        name: test
        command: sleep 2m
        detach: false
        cleanup: true
        image: ubuntu:latest

reproduces this with main (times out after one minute). With stable-2, this works fine.

@felixfontein
Copy link
Collaborator

#527 fixes this.

@mohd-akram
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker-plain plain Docker (no swarm, no compose, no stack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants