Zun

Cannot import docker client

Bug #1693425 reported by Shunli Zhou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Released
Critical
hongbin

Bug Description

Refer to this patch https://github.com/docker/docker-py/commit/f5ac10c469fca252e69ae780749f4ec6fe369789,
Docker-py has renamed client.client to client.DockerClient.

2017-05-25 14:01:31.608 CRITICAL zun [-] AttributeError: 'module' object has no attribute 'Client'

Following error threw when start zun-compute as devstack restarted and update docker-py to latest version:

2017-05-25 14:01:31.608 TRACE zun Traceback (most recent call last):
2017-05-25 14:01:31.608 TRACE zun File "/usr/bin/zun-compute", line 10, in <module>
2017-05-25 14:01:31.608 TRACE zun sys.exit(main())
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/cmd/compute.py", line 39, in main
2017-05-25 14:01:31.608 TRACE zun compute_manager.Manager(),
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/compute/manager.py", line 40, in __init__
2017-05-25 14:01:31.608 TRACE zun self.driver = driver.load_container_driver(container_driver)
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/container/driver.py", line 49, in load_container_driver
2017-05-25 14:01:31.608 TRACE zun driver = importutils.import_object(container_driver)
2017-05-25 14:01:31.608 TRACE zun File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 44, in import_object
2017-05-25 14:01:31.608 TRACE zun return import_class(import_str)(*args, **kwargs)
2017-05-25 14:01:31.608 TRACE zun File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 30, in import_class
2017-05-25 14:01:31.608 TRACE zun __import__(mod_str)
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/container/docker/driver.py", line 31, in <module>
2017-05-25 14:01:31.608 TRACE zun from zun.container.docker import host
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/container/docker/host.py", line 20, in <module>
2017-05-25 14:01:31.608 TRACE zun from zun.container.docker import utils as docker_utils
2017-05-25 14:01:31.608 TRACE zun File "/opt/stack/zun/zun/container/docker/utils.py", line 44, in <module>
2017-05-25 14:01:31.608 TRACE zun class DockerHTTPClient(client.Client):
2017-05-25 14:01:31.608 TRACE zun AttributeError: 'module' object has no attribute 'Client'

docker-py version as below:
bash-4.2$ pip show docker-py
Name: docker-py
Version: 1.10.6
Summary: Python client for Docker.
Home-page: https://github.com/docker/docker-py/
Author: Joffrey F
Author-email: <email address hidden>
License: UNKNOWN
Location: /usr/lib/python2.7/site-packages
Requires: websocket-client, backports.ssl-match-hostname, ipaddress, six, requests, docker-pycreds

Shunli Zhou (shunliz)
Changed in zun:
assignee: nobody → Shunli Zhou (shunliz)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zun (master)

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

Changed in zun:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on zun (master)

Change abandoned by Shunli Zhou (<email address hidden>) on branch: master
Review: https://review.openstack.org/467915

Revision history for this message
Shunli Zhou (shunliz) wrote :

This is not a bug. The root cause is the 'docker' package is installed and not compatible with docker-py.
Without 'docker', everything works fine.

Changed in zun:
status: In Progress → Invalid
Changed in zun:
assignee: Shunli Zhou (shunliz) → hongbin (hongbin034)
status: Invalid → In Progress
hongbin (hongbin034)
Changed in zun:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zun (master)

Reviewed: https://review.openstack.org/475526
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=9180a8cb218ab4e1512859bae7540828bf5b471e
Submitter: Jenkins
Branch: master

commit 9180a8cb218ab4e1512859bae7540828bf5b471e
Author: Hongbin Lu <email address hidden>
Date: Mon Jun 19 20:38:35 2017 +0000

    Upgrade from docker-py to docker

    The docker python binding library has renamed from "docker-py"
    to "docker" . This commit will adopt the latest package. After this
    commit is merged, devstack users needs to perform the following steps:

    $ sudo pip uninstall docker-py docker-pycreds
    $ sudo pip install -c /opt/stack/requirements/upper-constraints.txt \
          -e /opt/stack/zun
    $ sudo systemctl restart devstack@zun*

    Depends-On: I9346112d8a495bc6b304647377f8da47017cc869
    Depends-On: I0a6fdb905016ff064d90b3170c3bcf90311aaaad
    Change-Id: I3d952f647f8235079f717256750c90cb9ddf9588
    Partial-Implements: blueprint adopt-docker-py-2.0-api
    Closes-Bug: #1671874
    Closes-Bug: #1693425

Changed in zun:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/zun 0.2.0

This issue was fixed in the openstack/zun 0.2.0 release.

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

Other bug subscribers

Related blueprints

Remote bug watches

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