Reproducer script fails with Ansible ImportError

Bug #1831877 reported by Carlos Goncalves
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Sagi (Sergey) Shnaidman

Bug Description

The Zuul reproducer script fails during deployment on a clean CentOS 7 install. It started happening around 2-3 weeks ago, at least. Looking a bit into the error message, I think this is related to Ansible 2.8 release which is being installed on the base OS and that conflicts with Ansible 2.7 installed on the Python virtual environment.

http://logs.openstack.org/63/648963/4/check/tripleo-ci-centos-7-scenario010-standalone/106fc88/logs/reproducer-quickstart/reproducer-zuul-based-quickstart.tar

$ ./reproducer-zuul-based-quickstart.sh --libvirt

[...]

TASK [tripleo-inventory : regenerate ssh config, if no undercloud has been launched.] ********************************************************************************************************************************************************
task path: /tmp/reproduce-tmp.EU4pO/roles/tripleo-inventory/tasks/inventory.yml:177
changed: [localhost] => {"changed": true, "checksum": "9e36e7ea0ca5ef29bf856f73d57868711bdff266", "dest": "/home/vagrant/tripleo-ci-reproducer//ssh.config.ansible", "gid": 1000, "group": "vagrant", "md5sum": "6b3e81edbbcf9f9daabaafd750e87b54", "mode": "0644", "owner": "vagrant", "secontext": "unconfined_u:object_r:user_home_t:s0", "size": 121, "src": "/home/vagrant/.ansible/tmp/ansible-tmp-1559808405.66-235132842112797/source", "state": "file", "uid": 1000}

TASK [tripleo-inventory : include_tasks] *****************************************************************************************************************************************************************************************************
task path: /tmp/reproduce-tmp.EU4pO/roles/tripleo-inventory/tasks/main.yml:13
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [ansible-role-tripleo-ci-reproducer : prepare nodes] ************************************************************************************************************************************************************************************
task path: /tmp/reproduce-tmp.EU4pO/roles/ansible-role-tripleo-ci-reproducer/tasks/libvirt/main.yaml:51
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "set -e\nPATH=$PATH:$HOME/.local/bin\nANSIBLE_STDOUT_CALLBACK=debug\nansible-playbook -i /home/vagrant/tripleo-ci-reproducer//hosts -vv /tmp/reproduce-tmp.EU4pO/roles/ansible-role-tripleo-ci-reproducer/tasks/libvirt/prepare.yaml\n", "delta": "0:00:00.015373", "end": "2019-06-06 08:06:46.065185", "msg": "non-zero return code", "rc": 1, "start": "2019-06-06 08:06:46.049812", "stderr": "Traceback (most recent call last):\n File \"/usr/bin/ansible-playbook\", line 32, in <module>\n from ansible import context\nImportError: cannot import name context", "stderr_lines": ["Traceback (most recent call last):", " File \"/usr/bin/ansible-playbook\", line 32, in <module>", " from ansible import context", "ImportError: cannot import name context"], "stdout": "", "stdout_lines": []}

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
localhost : ok=109 changed=64 unreachable=0 failed=1 skipped=61 rescued=0 ignored=10

[vagrant@vanilla-1 ~]$ ansible --version
Traceback (most recent call last):
  File "/usr/bin/ansible", line 32, in <module>
    from ansible import context
ImportError: cannot import name context

Revision history for this message
Marios Andreou (marios-b) wrote :

also with non libvirt running it via rdo cloud vm for rdo cloud nodes:

http://paste.openstack.org/raw/752528 (while that lasts but like below)

Traceback (most recent call last):
  File "/bin/ansible-playbook", line 32, in <module>
    from ansible import context
ImportError: cannot import name context

run like: ./reproducer-zuul-based-quickstart.sh --workspace WORKSPACE -ug slim -rg shady

Revision history for this message
Sagi (Sergey) Shnaidman (sshnaidm) wrote :

[centos@test ~]$ rpm -qi ansible
Name : ansible
Version : 2.8.0
Release : 2.el7

ansible 2.8 is installed globally with yum and ansible 2.7.5 is installed in local user directory .local/bin, which creates a conflict.

Changed in tripleo:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Sagi (Sergey) Shnaidman (sshnaidm)
milestone: none → train-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-quickstart-extras (master)

Fix proposed to branch: master
Review: https://review.opendev.org/663697

Changed in tripleo:
status: Triaged → In Progress
Changed in tripleo:
milestone: train-1 → train-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-quickstart-extras (master)

Reviewed: https://review.opendev.org/663697
Committed: https://git.openstack.org/cgit/openstack/tripleo-quickstart-extras/commit/?id=d89990d5bae920ced083a0e808acfb716c4dea2c
Submitter: Zuul
Branch: master

commit d89990d5bae920ced083a0e808acfb716c4dea2c
Author: Sagi Shnaidman <email address hidden>
Date: Thu Jun 6 18:12:08 2019 +0300

    Always prefer local ansible install in reproducer

    we can have different ansible versions in the host, installed both
    globally and locally (with pip install --user). Let's prefer local
    version that we control with pip.

    Change-Id: Ibb1dc97aa210919f7846eac0670b678d97abdade
    Closes-Bug: #1831877

Changed in tripleo:
status: In Progress → Fix Released
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.