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-py version is checked incorrectly #17495

Closed
rcoh opened this issue Sep 10, 2016 · 44 comments · Fixed by #17496
Closed

docker-py version is checked incorrectly #17495

rcoh opened this issue Sep 10, 2016 · 44 comments · Fixed by #17496
Assignees
Labels
affects_2.1 This issue/PR affects Ansible v2.1 affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. docker

Comments

@rcoh
Copy link

rcoh commented Sep 10, 2016

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker integration (but not the docker module) (https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/docker_common.py#L154)

ANSIBLE VERSION
ansible 2.1.1.0
CONFIGURATION

None

OS / ENVIRONMENT

OS X, El Cap

SUMMARY

docker-py just bumped its version to 1.10. This is the code that checks the version:

  154         if docker_version < MIN_DOCKER_VERSION:
  155             self.fail("Error: docker-py version is %s. Minimum version required is %s." % (docker_version,
  156      

This is how python compares strings:

>>> "1.5" < "1.7"
True
>>> "1.9" < "1.7"
False
>>> "1.10.1" < "1.7"
True
>>> "1.10.1" < "1.7.0"
True
>>> "1.10" < "1.7.0"
True

STEPS TO REPRODUCE
  1. Install latest docker-py on target machine.
  2. Run any docker command:
docker_service:
   ...
EXPECTED RESULTS

Run docker

ACTUAL RESULTS
fatal: [demos]: FAILED! => {"changed": false, "failed": true, "msg": "Error: docker-py version is 1.10.1. Minimum version required is 1.7.0."}
@rcoh
Copy link
Author

rcoh commented Sep 10, 2016

See also docker/docker-py#1200 (comment)

@srstsavage
Copy link
Contributor

Confirmed, Debian Jessie. Seems...urgent.

@srstsavage
Copy link
Contributor

Note that docker-compose 1.8.0 requires docker-py >1.9,<2.0, so if you're specifically setting docker-py to a version lower than 1.9.0 and installing docker-compose 1.8.0 it will upgrade docker-py all the way to 1.10.1 which presently breaks the string version comparison. Set docker-py to 1.9.0 prevent this.

@rcoh
Copy link
Author

rcoh commented Sep 10, 2016

Most people using the normal galaxy package for docker will be getting the
latest version by default -- could definitely break a lot of stuff

On Fri, Sep 9, 2016, 7:09 PM Shane StClair notifications@github.com wrote:

Note that docker-compose 1.8.0 requires docker-py >1.9,<2.0, so if you're
specifically setting docker-py to a version lower than 1.9.0 and installing
docker-compose 1.8.0 it will upgrade docker-py all the way to 1.10.1 which
presently breaks the string version comparison. Set docker-py to 1.9.0
prevent this.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#17495 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeFZ-OYb5eZHpd8TFlSrX7Z9WimPuIwks5qohE9gaJpZM4J5lx9
.

@nictuku
Copy link

nictuku commented Sep 10, 2016

FWIW, I'm not setting docker-py to any specific version and this broke me anyway.

@juanluisbaptiste
Copy link

Yup, I can confirm it on Ubuntu 16.04.

@kiview
Copy link

kiview commented Sep 12, 2016

Does a temporary workaround exist?

@rcoh
Copy link
Author

rcoh commented Sep 12, 2016

A downgrade of docker-py to 1.9.0 is probably the easiest

On Mon, Sep 12, 2016, 7:59 AM Kevin Wittek notifications@github.com wrote:

Does a temporary workaround exist?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#17495 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeFZ0KPLl-PYEN80CH6YRvAwuVekYq1ks5qpWjLgaJpZM4J5lx9
.

@vietbui
Copy link

vietbui commented Sep 12, 2016

@kiview
In case you use pip to install docker-py:
pip install 'docker-py==1.9.0'
Or if version 1.10.1 has already been installed:
pip install 'docker-py==1.9.0' --force-reinstall

@kiview
Copy link

kiview commented Sep 13, 2016

@vietbui Thanks, even worked by specifying a specific docker-py version in the angstwad.docker_ubuntu role.

@jhita
Copy link

jhita commented Sep 23, 2016

Hello guys, when are you going to release a new version with this change merged? Are you planning to do it soon? Thanks!

@trennepohl
Copy link

Facing this issue as well
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Error: docker-py version is 1.10.3. Minimum version required is 1.7.0."}

Downgraded docker-py as suggested by @vietbui and it's working!

In case you use pip to install docker-py:
pip install 'docker-py==1.9.0'
Or if version 1.10.1 has already been installed:
pip install 'docker-py==1.9.0' --force-reinstall

@jaccoh
Copy link

jaccoh commented Sep 30, 2016

I thought this would be fixed in 2.1.2.0 but I tried today:
"Error: docker-py version is 1.10.3. Minimum version required is 1.7.0."

This is, in my opinion, an urgent problem!

@nitzmahone
Copy link
Member

This change has been backported to stable-2.1 for 2.1.3RC3. Will backport to stable-2.2 if there's another 2.2.0 release candidate, otherwise, it should be in for 2.2.1.

@markusthoemmes
Copy link

nice @nitzmahone, exactly what most of us are looking for 👍

@splitice
Copy link

splitice commented Oct 26, 2016

👍

@nitzmahone
Copy link
Member

... aaand there's going to be a 2.2.0RC4, so this one's been cherry-picked to go along for the ride.

@Asher256
Copy link
Contributor

+1

@dbrgn
Copy link
Contributor

dbrgn commented Nov 3, 2016

Looks like ansible 2.2.0 is out, which fixes this issue. Right?

@lukasged
Copy link

lukasged commented Nov 3, 2016

@dbrgn Right! That's great, although switching to ansible 2.2.0 gave me another problem. It seems to break one popular ansible galaxy role for mysql . So be careful if you use that role.

@dbrgn
Copy link
Contributor

dbrgn commented Nov 3, 2016

Yeah, and 2.2 seems to break docker_service too 🤕 ansible/ansible-modules-core#5159

@jaccoh
Copy link

jaccoh commented Nov 4, 2016

Right

Op 3 nov. 2016 om 23:55 heeft lukasged notifications@github.com het volgende geschreven:

@dbrgn Right! That's great, although switching to ansible 2.2.0 gave me another problem. It seems to break one popular ansible galaxy role for mysql . So be careful if you use that role.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ansible/ansible","title":"ansible/ansible","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/ansible/ansible"}},"updates":{"snippets":[{"icon":"PERSON","message":"@lukasged in #17495: @dbrgn Right! That's great, although switching to ansible 2.2.0 gave me another problem. It seems to break one popular ansible galaxy role for mysql . So be careful if you use that role."}],"action":{"name":"View Issue","url":"https://github.com/ansible/ansible/issues/17495#issuecomment-258298370"}}}

@gvilarino
Copy link

gvilarino commented Nov 4, 2016

It's honestly awe-striking how fragile ansible is as an environment and the amount of effort it demands its users for keeping basic functionalities working with just a minor upgrade. Remarkable.

@darkn3rd
Copy link

Not able to verify fix in Ansible 2.2 as it breaks for another reason on Mac OS X:

Traceback (most recent call last):\n  File \"/var/folders/79/4dttv20s6p30d78_yqmr3jjh0000gn/T/ansible_c_jdw536/ansible_module_docker_container.py\", line 652, in <module>\n    from ansible.module_utils.docker_common import *\n  File \"/var/folders/79/4dttv20s6p30d78_yqmr3jjh0000gn/T/ansible_c_jdw536/ansible_modlib.zip/ansible/module_utils/docker_common.py\", line 26, in <module>\nImportError: No module named 'urlparse'\n

@abadger
Copy link
Contributor

abadger commented Jan 30, 2017

Because this ticket is closed, no one is likely to see comments on it. Please open a new ticket if you are having issues.

@darkn3rd -- it looks like your problem is an incompatibility between the docker_common.py command and python3 on the managed machine. Workaround would be to run with python2. I'll look at making a PR for the python3 problem.

abadger added a commit to abadger/ansible that referenced this issue Jan 30, 2017
Should fix the error reported here:
ansible#17495 (comment)
abadger added a commit that referenced this issue Jan 30, 2017
Should fix the error reported here:
#17495 (comment)
abadger added a commit that referenced this issue Jan 30, 2017
Should fix the error reported here:
#17495 (comment)

(cherry picked from commit 4f960a4)
prakashsurya added a commit to prakashsurya/reptar.prakashsurya.com that referenced this issue Feb 4, 2017
We must specify the version of "docker-py" explicitly to workaround the
following ansible issue: ansible/ansible#17495
fspegni added a commit to fspegni/ansible-full that referenced this issue Apr 18, 2017
probably lowering ansible version raised this bug:

ansible/ansible#17495
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.1 This issue/PR affects Ansible v2.1 affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. docker
Projects
None yet
Development

Successfully merging a pull request may close this issue.