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 version check error #43639

Closed
bitozoid opened this issue Aug 3, 2018 · 18 comments · Fixed by #56947
Closed

Docker version check error #43639

bitozoid opened this issue Aug 3, 2018 · 18 comments · Fixed by #56947
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. cloud deprecated This issue/PR relates to a deprecated module. docker needs_info This issue requires further information. Please answer any outstanding questions. python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.

Comments

@bitozoid
Copy link

bitozoid commented Aug 3, 2018

SUMMARY

Docker component is querying version the wrong way. The component asks for:

$ docker version --format "'{{.Server.Version}}'"
'dev'

but IMHO should ask for:

$ docker version --format "'{{.Server.APIVersion}}'"
'1.37'

new_version_subcommand = ['version', '--format', "'{{.Server.Version}}'"]

ISSUE TYPE
  • Bug Report
COMPONENT NAME

plugins/connection/docker.py

ANSIBLE VERSION
ansible 2.6.2
  config file = /home/bitozoid/.ansible.cfg
  configured module search path = ['/home/eduardo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']                                                                            
  ansible python module location = /usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible                                                                           
  executable location = /usr/local/virtual/python/virtualenv/ansible/bin/ansible
  python version = 3.6.5 (default, Apr  3 2018, 10:42:08) [GCC 7.3.0]
CONFIGURATION
DEFAULT_ROLES_PATH(/home/bitozoid/.ansible.cfg) = ['/home/bitozoid/grow/setup/ansible/roles']
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/bitozoid/.vaults/test.txt
RETRY_FILES_ENABLED(/home/bitozoid/.ansible.cfg) = False
OS / ENVIRONMENT
$ cat /etc/os-release
NAME="Exherbo"
PRETTY_NAME="Exherbo Linux"
ID="exherbo"
ANSI_COLOR="0;32"
HOME_URL="https://www.exherbo.org/"
SUPPORT_URL="irc://irc.freenode.net/#exherbo"
BUG_REPORT_URL="https://bugs.exherbo.org/"
$ docker version
Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.10.3
 Git commit:   18.05.0-ce
 Built:        Fri Aug  3 12:13:56 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      dev
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.10.3
  Git commit:   18.05.0-ce
  Built:        Mon Jun 25 12:33:52 2018
  OS/Arch:      linux/amd64
  Experimental: false
STEPS TO REPRODUCE

Just use a docker image as driver for molecule. May paste the hole project if needed.

EXPECTED RESULTS

No error.

ACTUAL RESULTS
    TASK [Install EPEL repository for lighttpd] ************************************
    task path: /home/bitozoid/grow/setup/ansible/roles/ansible-dokuwiki/molecule/docker/prepare.yml:6
    The full traceback is:
    Traceback (most recent call last):
      File "/usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 138, in run
        res = self._execute()
      File "/usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 522, in _execute
        self._connection = self._get_connection(variables=variables, templar=templar)
      File "/usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 808, in _get_connection
        ansible_playbook_pid=to_text(os.getppid())
      File "/usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible/plugins/loader.py", line 397, in get
        obj = obj(*args, **kwargs)
      File "/usr/local/virtual/python/virtualenv/ansible/lib/python3.6/site-packages/ansible/plugins/connection/docker.py", line 92, in __init__
        if LooseVersion(docker_version) < LooseVersion(u'1.3'):
      File "/usr/lib/python3.6/distutils/version.py", line 52, in __lt__
        c = self._cmp(other)
      File "/usr/lib/python3.6/distutils/version.py", line 337, in _cmp
        if self.version < other.version:
    TypeError: '<' not supported between instances of 'str' and 'int'

    fatal: [ddokuwiki]: FAILED! => {
        "msg": "Unexpected failure during module execution.",
        "stdout": ""
    }
@ansibot
Copy link
Contributor

ansibot commented Aug 3, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Aug 3, 2018

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. cloud deprecated This issue/PR relates to a deprecated module. docker module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Aug 3, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Aug 3, 2018
@ansibot ansibot added the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Aug 27, 2018
@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) support:community This issue/PR relates to code supported by the Ansible community. labels Sep 20, 2018
@ansibot
Copy link
Contributor

ansibot commented Oct 6, 2018

@felixfontein
Copy link
Contributor

!component =lib/ansible/plugins/connection/docker.py

@felixfontein
Copy link
Contributor

I think it is querying the correct version. It doesn't know about the "dev" version, though. Do you use a custom build of the Docker server, or a development version?

Usually, installed versions output something else, like '18.06.1-ce'. And that can be parsed correctly.

If 'dev' is returned by the development version, we could include some logic which detects it and treats it as "new enough".

@ansibot
Copy link
Contributor

ansibot commented Oct 6, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 6, 2018

@ansibot ansibot removed the module This issue/PR relates to a module. label Oct 6, 2018
@bitozoid
Copy link
Author

bitozoid commented Oct 9, 2018

Docker installation comes from the following recipe (for Exherbo Linux, similar to bash syntax):

https://git.exherbo.org/virtualization.git/tree/packages/app-virtualization/moby/moby-18.06.1.exheres-0

I guess version name comes from the VERSION file:

https://github.com/docker/docker-ce/commits/master/VERSION

However the v18.06.1-ce tag has no dev in it:

https://github.com/docker/docker-ce/blob/v18.06.1-ce/VERSION

@bitozoid
Copy link
Author

@bitozoid
Copy link
Author

Fixed upstream:

https://gitlab.exherbo.org/exherbo/virtualization/merge_requests/26

@felixfontein
Copy link
Contributor

@bitozoid Awesame! That's probably the best solution.

@drewmullen
Copy link
Contributor

drewmullen commented Oct 17, 2018

has this been baked into a release yet? the latest im seeing on https://download.docker.com/linux/debian/dists/ is 10/5. im new to docker though, not sure how exherbo/virtualization relates to the overall moby/moby project or if i can roll this into my local system ahead of time

@felixfontein
Copy link
Contributor

@drewmullen about what releases are you speaking? Releases of docker? Regular docker releases never have dev as a version, but something meaningful which doesn't cause this problem (AFAIK).

@ansibot
Copy link
Contributor

ansibot commented Oct 29, 2018

@ansibot ansibot added 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 Nov 26, 2018
@felixfontein
Copy link
Contributor

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Nov 29, 2018
@ansibot
Copy link
Contributor

ansibot commented Dec 15, 2018

@ansibot
Copy link
Contributor

ansibot commented Jan 1, 2019

@bitozoid This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 2, 2019

@bitozoid You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. cloud deprecated This issue/PR relates to a deprecated module. docker needs_info This issue requires further information. Please answer any outstanding questions. python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants