Prechecks fail while checking docker version.

Bug #1742869 reported by Akshay Arora
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
High
Chason Chan
Ocata
Fix Released
Undecided
zhongshengping
Pike
Fix Released
Undecided
zhongshengping

Bug Description

Hi all,

Previously with docker version 17.12 this error was not reproduced
but now after the docker-ce version is updated which is 18.01
The prechecks fail with the following error.

Logs in Verbose mode:

TASK [prechecks : Checking Docker version] **************************************************************************************************************************************************************************************************
task path: /usr/local/share/kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml:2
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False",
    "skipped": true
}
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py
<192.168.0.16> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.16> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3ef988f96 192.168.0.16 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py
<192.168.0.20> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.20> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/505563c6ef 192.168.0.20 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<192.168.0.16> (0, '/root\n', '')
<192.168.0.16> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.16> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3ef988f96 192.168.0.16 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322 `" && echo ansible-tmp-1515663389.35-208892213749322="` echo /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322 `" ) && sleep 0'"'"''
<192.168.0.20> (0, '/root\n', '')
<192.168.0.20> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.20> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/505563c6ef 192.168.0.20 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880 `" && echo ansible-tmp-1515663389.37-16642865815880="` echo /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880 `" ) && sleep 0'"'"''
<192.168.0.16> (0, 'ansible-tmp-1515663389.35-208892213749322=/root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322\n', '')
<192.168.0.16> PUT /tmp/tmpjplqyL TO /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/command.py
<192.168.0.16> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3ef988f96 '[192.168.0.16]'
<192.168.0.20> (0, 'ansible-tmp-1515663389.37-16642865815880=/root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880\n', '')
<192.168.0.20> PUT /tmp/tmpdEH1aP TO /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/command.py
<192.168.0.20> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/505563c6ef '[192.168.0.20]'
<192.168.0.16> (0, 'sftp> put /tmp/tmpjplqyL /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/command.py\n', '')
<192.168.0.16> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.16> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3ef988f96 192.168.0.16 '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/ /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/command.py && sleep 0'"'"''
<192.168.0.20> (0, 'sftp> put /tmp/tmpdEH1aP /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/command.py\n', '')
<192.168.0.20> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.20> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/505563c6ef 192.168.0.20 '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/ /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/command.py && sleep 0'"'"''
<192.168.0.16> (0, '', '')
<192.168.0.16> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.16> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/b3ef988f96 -tt 192.168.0.16 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/command.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1515663389.35-208892213749322/" > /dev/null 2>&1 && sleep 0'"'"''
<192.168.0.20> (0, '', '')
<192.168.0.20> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.20> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/505563c6ef -tt 192.168.0.20 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/command.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1515663389.37-16642865815880/" > /dev/null 2>&1 && sleep 0'"'"''
<192.168.0.16> (0, '\r\n{"changed": true, "end": "2018-01-11 10:36:28.924521", "stdout": "Client:\\n Version:\\t18.01.0-ce\\n API version:\\t1.35\\n Go version:\\tgo1.9.2\\n Git commit:\\t03596f5\\n Built:\\tWed Jan 10 20:11:05 2018\\n OS/Arch:\\tlinux/amd64\\n Experimental:\\tfalse\\n Orchestrator:\\tswarm\\n\\nServer:\\n Engine:\\n Version:\\t18.01.0-ce\\n API version:\\t1.35 (minimum version 1.12)\\n Go version:\\tgo1.9.2\\n Git commit:\\t03596f5\\n Built:\\tWed Jan 10 20:09:37 2018\\n OS/Arch:\\tlinux/amd64\\n Experimental:\\tfalse", "cmd": ["docker", "version"], "rc": 0, "start": "2018-01-11 10:36:28.846038", "stderr": "", "delta": "0:00:00.078483", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "_raw_params": "docker version", "removes": null, "creates": null, "chdir": null, "stdin": null}}}\r\n', 'Shared connection to 192.168.0.16 closed.\r\n')
fatal: [192.168.0.16]: FAILED! => {
    "failed": true,
    "msg": "The conditional check 'result | failed or (result.stdout | from_yaml).Server.Version | regex_replace('(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*', '\\\\1') | version_compare(docker_version_min, '<')' failed. The error was: while scanning for the next token\nfound character '\\t' that cannot start any token\n in \"<unicode string>\", line 2, column 10:\n Version:\t18.01.0-ce\n ^"
}
<192.168.0.20> (0, '\r\n{"changed": true, "end": "2018-01-11 10:36:34.092049", "stdout": "Client:\\n Version:\\t18.01.0-ce\\n API version:\\t1.35\\n Go version:\\tgo1.9.2\\n Git commit:\\t03596f5\\n Built:\\tWed Jan 10 20:11:05 2018\\n OS/Arch:\\tlinux/amd64\\n Experimental:\\tfalse\\n Orchestrator:\\tswarm\\n\\nServer:\\n Engine:\\n Version:\\t18.01.0-ce\\n API version:\\t1.35 (minimum version 1.12)\\n Go version:\\tgo1.9.2\\n Git commit:\\t03596f5\\n Built:\\tWed Jan 10 20:09:37 2018\\n OS/Arch:\\tlinux/amd64\\n Experimental:\\tfalse", "cmd": ["docker", "version"], "rc": 0, "start": "2018-01-11 10:36:34.011192", "stderr": "", "delta": "0:00:00.080857", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": false, "_raw_params": "docker version", "removes": null, "creates": null, "chdir": null, "stdin": null}}}\r\n', 'Shared connection to 192.168.0.20 closed.\r\n')
fatal: [192.168.0.20]: FAILED! => {
    "failed": true,
    "msg": "The conditional check 'result | failed or (result.stdout | from_yaml).Server.Version | regex_replace('(\\\\d+\\\\.\\\\d+\\\\.\\\\d+).*', '\\\\1') | version_compare(docker_version_min, '<')' failed. The error was: while scanning for the next token\nfound character '\\t' that cannot start any token\n in \"<unicode string>\", line 2, column 10:\n Version:\t18.01.0-ce\n ^"
}

I feel it is probably because of this

Version:\t18.01.0-ce\n

Thanks in Advance.
Akshay.

Changed in kolla:
status: New → Confirmed
Changed in kolla:
importance: Undecided → High
affects: kolla → kolla-ansible
Chason Chan (chen-xing)
Changed in kolla-ansible:
assignee: nobody → Chason Chan (chen-xing)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/533339

Changed in kolla-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.openstack.org/533339
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=d1ddeddb67813923f335fa069c18d7b64e00742b
Submitter: Zuul
Branch: master

commit d1ddeddb67813923f335fa069c18d7b64e00742b
Author: chenxing <email address hidden>
Date: Sat Jan 13 14:22:40 2018 +0800

    Fix the Prechecks failed while checking docker version

    In Docker version 18.01.0-ce, "docker version" command uses the
    "\t" to format the result, which will cause the prechecks failed.
    There is a workaround that using "docker --version" command
    instead of "docker version" can get everything running.
    Also, using "docker --version" to check the version of docker is
    more specific and effective.

    backport: pike ocata

    Change-Id: Ie5efe1888afc3be11441a88d627db62e1575f3ed
    Closes-Bug: #1742869

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/544363

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/544364

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/ocata)

Reviewed: https://review.openstack.org/544364
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=16adb5fe6ff7f9891aa8e0b84e4be17bd11544a1
Submitter: Zuul
Branch: stable/ocata

commit 16adb5fe6ff7f9891aa8e0b84e4be17bd11544a1
Author: chenxing <email address hidden>
Date: Sat Jan 13 14:22:40 2018 +0800

    Fix the Prechecks failed while checking docker version

    In Docker version 18.01.0-ce, "docker version" command uses the
    "\t" to format the result, which will cause the prechecks failed.
    There is a workaround that using "docker --version" command
    instead of "docker version" can get everything running.
    Also, using "docker --version" to check the version of docker is
    more specific and effective.

    backport: pike ocata

    Change-Id: Ie5efe1888afc3be11441a88d627db62e1575f3ed
    Closes-Bug: #1742869
    (cherry picked from commit d1ddeddb67813923f335fa069c18d7b64e00742b)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/pike)

Reviewed: https://review.openstack.org/544363
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=daf0dd2b7697963006fa4a06824409a2dedbc03e
Submitter: Zuul
Branch: stable/pike

commit daf0dd2b7697963006fa4a06824409a2dedbc03e
Author: chenxing <email address hidden>
Date: Sat Jan 13 14:22:40 2018 +0800

    Fix the Prechecks failed while checking docker version

    In Docker version 18.01.0-ce, "docker version" command uses the
    "\t" to format the result, which will cause the prechecks failed.
    There is a workaround that using "docker --version" command
    instead of "docker version" can get everything running.
    Also, using "docker --version" to check the version of docker is
    more specific and effective.

    backport: pike ocata

    Change-Id: Ie5efe1888afc3be11441a88d627db62e1575f3ed
    Closes-Bug: #1742869
    (cherry picked from commit d1ddeddb67813923f335fa069c18d7b64e00742b)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 6.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 6.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 5.0.2

This issue was fixed in the openstack/kolla-ansible 5.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 4.0.4

This issue was fixed in the openstack/kolla-ansible 4.0.4 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.