ERROR:root:ImportError: cannot import name ensure_text

Bug #1862724 reported by wes hayutin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Sorin Sbarnea

Bug Description

2020-02-11 05:01:51.450675 | primary | Running install_deps
2020-02-11 05:01:51.486193 | primary | sudo-1.8.23-4.el7_7.1.x86_64
2020-02-11 05:01:51.509552 | primary | Installing RPM packages libselinux-python python2-setuptools python2-virtualenv python-pip
2020-02-11 05:01:51.665331 | primary | Loaded plugins: fastestmirror
2020-02-11 05:01:51.730654 | primary | Loading mirror speeds from cached hostfile
2020-02-11 05:01:51.926509 | primary | Package libselinux-python-2.5-14.1.el7.x86_64 already installed and latest version
2020-02-11 05:01:51.970658 | primary | Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
2020-02-11 05:01:52.013673 | primary | Package python-virtualenv-15.1.0-2.el7.noarch already installed and latest version
2020-02-11 05:01:52.116135 | primary | Nothing to do
2020-02-11 05:01:52.370709 | primary | checking python modules
2020-02-11 05:01:52.639606 | primary | pip:20.0.2 virtualenv:20.0.1 setuptools:44.0.0
2020-02-11 05:01:52.639794 | primary |  SUCCESS: install-deps succeeded. 
2020-02-11 05:01:52.639925 | primary | Creating virtualenv at /home/zuul/workspace/.quickstart
2020-02-11 05:01:52.709109 | primary | ERROR:root:ImportError: cannot import name ensure_text
2020-02-11 05:01:53.021742 | primary | ERROR
2020-02-11 05:01:53.022158 | primary | {
2020-02-11 05:01:53.022278 | primary | "delta": "0:00:17.590613",
2020-02-11 05:01:53.022387 | primary | "end": "2020-02-11 05:01:52.716927",
2020-02-11 05:01:53.022492 | primary | "msg": "non-zero return code",
2020-02-11 05:01:53.022595 | primary | "rc": 1,
2020-02-11 05:01:53.022696 | primary | "start": "2020-02-11 05:01:35.126314"
2020-02-11 05:01:53.022806 | primary | }
2020-02-11 05:01:53.141775 |

https://00e428506f7eac65100a-ddf59c340d436068994b44c0bf057be9.ssl.cf1.rackcdn.com/705953/2/gate/tripleo-ci-centos-7-standalone/55b0ccf/job-output.txt

multiple examples.. python27 death march

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-quickstart (master)

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

Changed in tripleo:
assignee: nobody → chandan kumar (chkumar246)
status: Triaged → In Progress
Revision history for this message
chandan kumar (chkumar246) wrote :

Recent release of virtualenv is causing that https://github.com/pypa/virtualenv/commit/2b09fe3ec7dc00f36fab3d8d81dc570d57fbe04c it adds ensure text

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-quickstart (master)

Change abandoned by Chandan Kumar (raukadah) (<email address hidden>) on branch: master
Review: https://review.opendev.org/707061
Reason: not needed

Revision history for this message
chandan kumar (chkumar246) wrote :

2020-02-11 05:01:51.509552 | primary | Installing RPM packages libselinux-python python2-setuptools python2-virtualenv python-pip
2020-02-11 05:01:51.665331 | primary | Loaded plugins: fastestmirror
2020-02-11 05:01:51.730654 | primary | Loading mirror speeds from cached hostfile
2020-02-11 05:01:51.926509 | primary | Package libselinux-python-2.5-14.1.el7.x86_64 already installed and latest version
2020-02-11 05:01:51.970658 | primary | Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
2020-02-11 05:01:52.013673 | primary | Package python-virtualenv-15.1.0-2.el7.noarch already installed and latest version
2020-02-11 05:01:52.116135 | primary | Nothing to do
2020-02-11 05:01:52.370709 | primary | checking python modules
2020-02-11 05:01:52.639606 | primary | pip:20.0.2 virtualenv:20.0.1 setuptools:44.0.0
2020-02-11 05:01:52.639794 | primary |  SUCCESS: install-deps succeeded.

If we look at above output. virtualev version is getting updated and it is causing it

Revision history for this message
chandan kumar (chkumar246) wrote :
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

Check https://github.com/pypa/virtualenv/issues/1551 for workarounds, is caused by virtualenv being installed with outdated/wrong dependencies.

Changed in tripleo:
assignee: chandan kumar (chkumar246) → Sorin Sbarnea (ssbarnea)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-quickstart (master)

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

Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

I'm not so sure that it's virtualenv [1]. I think it may be setuptools [2].

[1] https://github.com/pypa/virtualenv/issues/1576
[2] https://github.com/pypa/setuptools/issues/1990

We certainly found that downgrading setuptools in the virtualenv made everything work.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-quickstart (master)

Reviewed: https://review.opendev.org/707062
Committed: https://git.openstack.org/cgit/openstack/tripleo-quickstart/commit/?id=65ab3aa516e336a50ceee9efde1e302f8443eeb3
Submitter: Zuul
Branch: master

commit 65ab3aa516e336a50ceee9efde1e302f8443eeb3
Author: Chandan Kumar (raukadah) <email address hidden>
Date: Tue Feb 11 12:57:46 2020 +0530

    [install-deps]Install "virtualenv<20.0.1"

    New release of virtualenv broke the venv creation and
    started returning 'ensure_text' module not found.
    Here is the related issue:
    https://github.com/pypa/virtualenv/issues/1551

    In order to fix that, we need to lower the version.
    Removing python-virtualenv from bindep as we are
    installing it from pip.

    Includes pinning of molecule as newer pre-release broke the job
    while at gate.

    Closes-Bug: #1862724

    Change-Id: Iaf77a6009947f2eb767307b5434b60bdaf25783e
    Signed-off-by: Chandan Kumar (raukadah) <email address hidden>

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-quickstart (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/708380

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-quickstart (master)

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

commit a949829391254d5b8b59f65ed8350a7bf3d2fcd0
Author: Wes Hayutin <email address hidden>
Date: Mon Feb 17 14:57:47 2020 -0700

    Revert sudo and six workarounds for virtualenv 20.0.1 issues

    Reverts the workarounds added for the Partial-Bug below.
    This is to fix issues described in Related-Bug.

    * ensure sudo is not called in ci.centos
    * remove patches to fix lp#1862724
    * add python-virtualenv for queens branch centos-7

    Partial-Bug: #1862724
    Related-Bug: #1863632
    Depends-On: https://review.opendev.org/708791
    Change-Id: I3d9bd1aa3b498890a2a773a838df78b53d2c30e6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-quickstart (master)

Change abandoned by Sorin Sbarnea (<email address hidden>) on branch: master
Review: https://review.opendev.org/708380
Reason: I think all changes are obsoleted.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-quickstart (master)

Reviewed: https://review.opendev.org/707215
Committed: https://git.openstack.org/cgit/openstack/tripleo-quickstart/commit/?id=44eb8aec9865d3436876ec1385da592cd811006c
Submitter: Zuul
Branch: master

commit 44eb8aec9865d3436876ec1385da592cd811006c
Author: Chandan Kumar (raukadah) <email address hidden>
Date: Tue Feb 11 12:57:46 2020 +0530

    [install-deps] Use venv instead of virtualenv when possible

    Avoids using virtualenv on python3 where venv is natively built-in. This will also
    make sure that we're not pip linstalling virtualenv when its not required.

    Change-Id: I7a9d536c27b588ae4345b87f6436d8b449356ca5
    Related-Bug: #1862724

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.