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_service ignore timeout #22358

Closed
boskiv opened this issue Mar 7, 2017 · 10 comments
Closed

docker_service ignore timeout #22358

boskiv opened this issue Mar 7, 2017 · 10 comments
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bot_closed bug This issue/PR relates to a bug. cloud collection:community.general collection Related to Ansible Collections work docker module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community.

Comments

@boskiv
Copy link

boskiv commented Mar 7, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_service

ANSIBLE VERSION
➜  release-managment git:(CB-1450) ✗ ansible --version
ansible 2.2.1.0
  config file = /Users/ivan.skiridomov/exness/devops/release-managment/ansible.cfg
  configured module search path = Default w/o overrides
CONFIGURATION
[defaults]
vault_password_file = .vaultpass
host_key_checking = False
OS / ENVIRONMENT

I'm running on OSX localy next task:

- hosts: app
  vars:
    ansible_ssh_private_key_file: release_key
    ansible_user: exness
    project_dir: '/home/exness/projects/web'
  tasks:
    - name: Create project dir 
      file:
        path: "{{ project_dir }}"
        state: directory
    
    - name: Sync compose file
      synchronize:
       src: "{{ playbook_dir }}/docker-compose.yml"
       dest: "{{ project_dir }}/docker-compose.yml"
    
    - name: Clean project
      docker_service:
        project_src: "{{ project_dir }}"
        state: absent

    - name: Run project
      docker_service:
        project_src: "{{ project_dir }}"
        timeout: 120
      register: output

    - debug:
        var: output
SUMMARY
STEPS TO REPRODUCE
TASK [Run project] *************************************************************
fatal: [dev-v2-02.dev.env]: FAILED! => {"changed": false, "failed": true, "msg": "Error starting project - UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)"}
        to retry, use: --limit @/Users/ivan.skiridomov/exness/devops/release-managment/deploy-dev.retry
EXPECTED RESULTS

I expect that timeout will be increased to 120s

ACTUAL RESULTS
TASK [Run project] *************************************************************
task path: /Users/ivan.skiridomov/exness/devops/release-managment/deploy-dev.yml:51
Using module file /usr/local/lib/python2.7/site-packages/ansible/modules/core/cloud/docker/docker_service.py
<dev-v2-02.dev.env> ESTABLISH SSH CONNECTION FOR USER: exness
<dev-v2-02.dev.env> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="release_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssa
pi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=exness -o ConnectTimeout=10 -o ControlPath=/Users/ivan.skiridomov/.ansible/cp/ansible-ssh-%h-%p-%r dev-v2-02.dev.env '/bin/sh -c '"
'"'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247 `" && echo ansible-tmp-1488892428.12-172808551646247="` echo ~/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247 `" )
 && sleep 0'"'"''
<dev-v2-02.dev.env> PUT /var/folders/n1/kd2bd2ms59928mwsl9k_hm8m0000gn/T/tmpm62B0t TO /home/exness/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247/docker_service.py
<dev-v2-02.dev.env> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="release_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentication
s=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=exness -o ConnectTimeout=10 -o ControlPath=/Users/ivan.skiridomov/.ansible/cp/ansible-ssh-%h-%p-%r '[dev-v2-02.dev.env]'
<dev-v2-02.dev.env> ESTABLISH SSH CONNECTION FOR USER: exness
<dev-v2-02.dev.env> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="release_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssa
pi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=exness -o ConnectTimeout=10 -o ControlPath=/Users/ivan.skiridomov/.ansible/cp/ansible-ssh-%h-%p-%r dev-v2-02.dev.env '/bin/sh -c '"
'"'chmod u+x /home/exness/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247/ /home/exness/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247/docker_service.py && sleep 0'"'"''
<dev-v2-02.dev.env> ESTABLISH SSH CONNECTION FOR USER: exness
<dev-v2-02.dev.env> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="release_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssa
pi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=exness -o ConnectTimeout=10 -o ControlPath=/Users/ivan.skiridomov/.ansible/cp/ansible-ssh-%h-%p-%r -tt dev-v2-02.dev.env '/bin/sh -
c '"'"'/usr/bin/python /home/exness/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247/docker_service.py; rm -rf "/home/exness/.ansible/tmp/ansible-tmp-1488892428.12-172808551646247/" > /dev/null 2>&1 && sleep
 0'"'"''
fatal: [dev-v2-02.dev.env]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "api_version": null,
            "build": false,
            "cacert_path": null,
            "cert_path": null,
            "debug": false,
            "definition": null,
            "dependencies": true,
            "docker_host": null,
            "files": null,
            "filter_logger": false,
            "hostname_check": false,
            "key_path": null,
            "nocache": false,
            "project_name": null,
            "project_src": "/home/exness/projects/web",
            "pull": false,
            "recreate": "smart",
            "remove_images": null,
            "remove_orphans": false,
            "remove_volumes": false,
            "restarted": false,
            "scale": null,
            "services": null,
            "ssl_version": null,
            "state": "present",
            "stopped": false,
            "timeout": 120,
            "tls": null,
            "tls_hostname": null,
            "tls_verify": null
        },
        "module_name": "docker_service"
    },
    "msg": "Error starting project - UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)"
}
        to retry, use: --limit @/Users/ivan.skiridomov/exness/devops/release-managment/deploy-dev.retry
@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 bug_report cloud docker module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Mar 7, 2017
@boskiv
Copy link
Author

boskiv commented Mar 7, 2017

Solve it with .env file for docker-compose

COMPOSE_HTTP_TIMEOUT=50000
- name: Sync .env file
      synchronize:
       src: "{{ playbook_dir }}/files/.env"
       dest: "{{ project_dir }}/.env"

@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Mar 7, 2017
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 18, 2017

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 3, 2018

@ansibot
Copy link
Contributor

ansibot commented Nov 2, 2018

@felixfontein
Copy link
Contributor

Part of the problem seems to be that timeout has two different usages. There's already a global docker_* parameter called timeout, and docker_service adds another timeout which does something else. It also looks to me that the timeout you want to set is a third one.

Since I'm not using docker_service and don't really know its code, I won't look into it, but maybe someone else wants to do this?

@ansibot
Copy link
Contributor

ansibot commented Dec 15, 2018

@felixfontein
Copy link
Contributor

Please note that the docker_service module will be renamed to docker_compose in Ansible 2.8. You will be able to still use the old name, but you will receive a warning when doing so.

!component =lib/ansible/modules/cloud/docker/docker_compose.py

Also, please note that currently, nobody is actively maintaining the Ansible docker_service/docker_compose modules. If you are interested in working on this issue, please feel free to create a PR :) If you need any help, feel free to ping me or any other of the current docker_* module maintainers.

@ansibot
Copy link
Contributor

ansibot commented Feb 4, 2019

@ansibot
Copy link
Contributor

ansibot commented Apr 9, 2019

@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. labels Apr 17, 2019
@ansibot ansibot added module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 25, 2019
@ansibot ansibot added collection Related to Ansible Collections work collection:community.general needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 17, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this as completed Aug 17, 2020
@ansible ansible locked and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bot_closed bug This issue/PR relates to a bug. cloud collection:community.general collection Related to Ansible Collections work docker module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

4 participants