openstack commands fail in stable/mitaka caused by openstack.__version__ attribute not found

Bug #1651292 reported by Jerry Zhao
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
OpenStack SDK
Confirmed
Undecided
Unassigned
devstack
Won't Fix
Undecided
Unassigned

Bug Description

install devstack mitaka version on ubuntu trusty on Dec 19 2016. devstack script failed when executing openstack command.
++userrc_early:source:11 export OS_REGION_NAME=RegionOne
++userrc_early:source:11 OS_REGION_NAME=RegionOne
+./stack.sh:main:1033 create_keystone_accounts
+lib/keystone:create_keystone_accounts:372 local admin_tenant
++lib/keystone:create_keystone_accounts:373 openstack project show admin -f value -c id
Traceback (most recent call last):
  File "/usr/local/bin/openstack", line 7, in <module>
    from openstackclient.shell import main
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/shell.py", line 32, in <module>
    from openstackclient.common import clientmanager
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/clientmanager.py", line 293, in <module>
    'openstack.cli.base',
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/common/clientmanager.py", line 264, in get_plugin_modules
    __import__(ep.module_name)
  File "/usr/local/lib/python2.7/dist-packages/openstackclient/network/client.py", line 16, in <module>
    from openstack import connection
  File "/usr/local/lib/python2.7/dist-packages/openstack/connection.py", line 68, in <module>
    from openstack import session as _session
  File "/usr/local/lib/python2.7/dist-packages/openstack/session.py", line 29, in <module>
    DEFAULT_USER_AGENT = "openstacksdk/%s" % openstack.__version__
AttributeError: 'module' object has no attribute '__version__'
+lib/keystone:create_keystone_accounts:373 admin_tenant=
+lib/keystone:create_keystone_accounts:1 exit_trap
+./stack.sh:exit_trap:474 local r=1
++./stack.sh:exit_trap:475 jobs -p
+./stack.sh:exit_trap:475 jobs=
+./stack.sh:exit_trap:478 [[ -n '' ]]
+./stack.sh:exit_trap:484 kill_spinner
+./stack.sh:kill_spinner:370 '[' '!' -z '' ']'
+./stack.sh:exit_trap:486 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:487 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:488 generate-subunit 1482198689 247 fail
+./stack.sh:exit_trap:489 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:492 /home/jenkins/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2016-12-20-015537.txt for details
+./stack.sh:exit_trap:498 exit 1
jenkins@test-dsvm-mitaka:~/devstack$
jenkins@test-dsvm-mitaka:~/devstack$
jenkins@test-dsvm-mitaka:~/devstack$
jenkins@test-dsvm-mitaka:~/devstack$
jenkins@test-dsvm-mitaka:~/devstack$

upgraded openstacksdk to 0.9.* fixed the issue. but requirements has capped openstacksdk to 0.8.1 for stable/mitaka. something must have changed. Setuptools is 32.1.2 which is upgdated on Dec 18 2016, not sure if that is the issue.

Revision history for this message
Jerry Zhao (zhaoxinyu) wrote :
Download full text (11.5 KiB)

openstack client commands failed right after horizon test-requirements were installed.

ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$ openstack
(openstack) quit
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$
ubuntu@test3:~$ sudo pip install -c requirements/upper-constraints.txt -r horizon/test-requirements.txt
sudo: unable to resolve host test3
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Ignoring dnspython3: markers 'python_version == "3.4"' don't match your environment
Collecting Sphinx===1.2.3 (from -c requirements/upper-constraints.txt (line 25))
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading Sphinx-1.2.3-py2-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 400kB/s
Collecting coverage===4.0.3 (from -c requirements/upper-constraints.txt (line 94))
  Downloading coverage-4.0.3.tar.gz (354kB)
    100% |████████████████████████████████| 358kB 2.2MB/s
Collecting django-nose===1.4.3 (from -c requirements/upper-constraints.txt (line 110))
  Downloading django_nose-1.4.3-py2.py3-none-any.whl
Collecting docutils===0.12 (from -c requirements/upper-constraints.txt (line 117))
  Downloading docutils-0.12.tar.gz (1.6MB)
    100% |████████████████████████████████| 1.6MB 513kB/s
Collecting mock===1.3.0 (from -c requirements/upper-constraints.txt (line 177))
  Downloading mock-1.3.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 6.2MB/s
Collecting mox3===0.14.0 (from -c requirements/upper-constraints.txt (line 180))
  Downloading mox3-0.14.0-py2.py3-none-any.whl (40kB)
    100% |████████████████████████████████| 40kB 6.0MB/s
Collecting nodeenv===0.13.6 (from -c requirements/upper-constraints.txt (line 187))
  Downloading nodeenv-0.13.6.tar....

Revision history for this message
Jerry Zhao (zhaoxinyu) wrote :

openstack.nose-plugin-0.11 seems to be the culprit. after uninstalling it, openstack client worked again.

Revision history for this message
Jerry Zhao (zhaoxinyu) wrote :

i think they have conflicting namespace. openstack-infra doesn't have this failure because it install from wheel.

2016-12-20 20:03:48.492 | Collecting openstack.nose-plugin===0.11 (from -c /opt/stack/new/requirements/upper-constraints.txt (line 204))
2016-12-20 20:03:48.508 | Downloading http://mirror.regionone.osic-cloud1.openstack.org/wheel/ubuntu-14.04-x86_64/openstack-nose-plugin/openstack.nose_plugin-0.11-py2-none-any.whl

Revision history for this message
Jerry Zhao (zhaoxinyu) wrote :

found a workaround, install setuptools below 31.0.0, such as 30.4.0. this won't let openstack.nose-plugin break openstacksdk.

Revision history for this message
Jerry Zhao (zhaoxinyu) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/428262

Revision history for this message
Johannes Grassler (jgr-launchpad) wrote :

Heads-up: I took the liberty of submitting your workaround as a change, Jerry - I hope that's ok with you. I currently need a working stable/mitaka Devstack and setuptools upstream doesn't look terribly inclined to fix this problem :-(

Revision history for this message
mengalong (mengalong) wrote :

Today I try to install openstack via devstack stable/mitaka in Centos7.
I met this error.
I find the patch https://review.openstack.org/428262, and modify the install_pip.sh manually.
But it seems that the patch does not work.

The error messages is:
2017-02-11 12:47:20.167 | +tools/install_pip.sh:main:136 set -x
2017-02-11 12:47:20.172 | +tools/install_pip.sh:main:137 pip_install -U setuptools==30.4.0
2017-02-11 12:47:20.255 | Traceback (most recent call last):
2017-02-11 12:47:20.255 | File "<string>", line 1, in <module>
2017-02-11 12:47:20.255 | AttributeError: 'module' object has no attribute '__version__'
2017-02-11 12:47:20.260 | ++./stack.sh:main:717 err_trap
2017-02-11 12:47:20.265 | ++./stack.sh:err_trap:504 local r=1
2017-02-11 12:47:20.272 | stack.sh failed: full log in /opt/stack/logs/stack.sh.log.2017-02-11-204659
2017-02-11 12:47:20.274 | Error on exit

[stack@along-client devstack]$ grep -n setuptool tools/install_pip.sh
137:pip_install -U setuptools==30.4.0

[root@along-client devstack]# pip list | grep setup
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
initial-setup (0.3.9.30)
setuptools (30.4.0)

Revision history for this message
mengalong (mengalong) wrote :

Now I have fix my problem use this patch:

[root@along-client devstack]# diff inc/python inc/python.bak
143c143
< pip_version=$(sudo python -c "import pip; \
---
> pip_version=$(python -c "import pip; \

sonu (sonu-bhumca11)
Changed in python-openstacksdk:
status: New → Confirmed
Changed in devstack:
status: New → Confirmed
Revision history for this message
Karolis (rusenask) wrote :

Getting this issue while trying to install devstack with stable/mitaka. I am aware that Mitaka is now EOL but the workaround listed here does not work anymore as the tools/install_pip.sh changed and the global-requirements.txt holds the info on versions. Any ideas how to fix this?

Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version mitaka in description. If this is incorrect, please update the description to include 'https://api.launchpad.net/1.0/devstack version: ...'

Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version mitaka in description. If this is incorrect, please update the description to include 'devstack version: ...'

Sean Dague (sdague)
tags: added: openstack-version.mitaka
Sean Dague (sdague)
Changed in devstack:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (stable/mitaka)

Change abandoned by Ian Wienand (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/428262
Reason: not necessary any more

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Mitaka is EOL for some time now. Please create a new bug report if the issue still exists for a supported release.

Changed in devstack:
status: In Progress → Won't Fix
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.