tripleo-ci promoter server fails to import docker properly

Bug #1846432 reported by wes hayutin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Sorin Sbarnea

Bug Description

[centos@promoter ~]$ source promoter_venv/bin/activate │···················
(promoter_venv)[centos@promoter ~]$ python │···················Python 2.7.5 (default, Aug 4 2017, 00:39:18) │···················
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2 │···················
Type "help", "copyright", "credits" or "license" for more information. │···················>>> import docker │···················
Traceback (most recent call last): │···················
  File "<stdin>", line 1, in <module> │···················
ImportError: No module named docker │···················
>>> │···················(promoter_venv)[centos@promoter ~]$ deactivate │···················[centos@promoter ~]$ python │···················Python 2.7.5 (default, Aug 4 2017, 00:39:18) │···················[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2 │···················Type "help", "copyright", "credits" or "license" for more information. │···················
>>> import docker │···················
>>> │···················
                                                                                                                                                                                                 │···················
                                                                                                                                                                                                 │···················
                                                                                                                                                                                                 │···················

"Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on promoter's Python /home/centos/promoter_venv/bin/python. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named docker"}
failed: [localhost] (item=[u'skydive-agent', u'current-tripleo']) => {"ansible_loop_var": "item", "changed": false, "item": ["skydive-agent", "current-tripleo"], "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on promoter's Python /home/centos/promoter_venv/bin/python. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named docker"}
failed: [localhost] (item=[u'skydive-analyzer', u'a361c5edd5734320f781e10358a602f4ba57fc04_647b08e4']) => {"ansible_loop_var": "item", "changed": false, "item": ["skydive-analyzer", "a361c5edd5734320f781e10358a602f4ba57fc04_647b08e4"], "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on promoter's Python /home/centos/promoter_venv/bin/python. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named docker"}
failed: [localhost] (item=[u'skydive-analyzer', u'current-tripleo']) => {"ansible_loop_var": "item", "changed": false, "item": ["skydive-analyzer", "current-tripleo"], "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on promoter's Python /home/centos/promoter_venv/bin/python. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named docker"}

http://promoter.rdoproject.org/centos7_stein.log

Revision history for this message
Gabriele Cerami (gcerami) wrote :
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

Fixed manually via:

sudo chown -R centos:centos /home/centos/promoter_venv
as centos: source /promoter_venv/bin/activate && pip install docker

This likely happened because someone installed some packages inside this venv as root. Maybe a manual mistake during hands-on attempts to fix it?

PS. Even the service script can so this if run by root instead of centos.

Changed in tripleo:
assignee: nobody → Sorin Sbarnea (ssbarnea)
status: Triaged → Fix Released
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

The link posted by gcerami sends to a change that is totally unrelated and clearly would not have fixed our problem.

The reality is that:
* virtualenv is used
* it needs docker inside venv
* having docker module installed on system does not bring it to the venv (is isolated!)
* it does not fix permissions on the venv
* it does neither install docker module

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

Other bug subscribers

Remote bug watches

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