PBR

nova list crashes on startup

Bug #1369179 reported by Ken Sheedlo
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PBR
Fix Released
High
melanie witt

Bug Description

I'm running OSX Mavericks. I just installed novaclient via a git clone + easy_install. This is the stack trace I get when I try to list my servers:

┌─[ken][Kens-MacBook-Pro][2.1.2][~]
└─▪ nova list --status active
Traceback (most recent call last):
  File "/usr/local/bin/nova", line 6, in <module>
    from novaclient.shell import main
  File "/Library/Python/2.7/site-packages/novaclient/shell.py", line 47, in <module>
    from novaclient import client
  File "/Library/Python/2.7/site-packages/novaclient/client.py", line 33, in <module>
    from keystoneclient import adapter
  File "/Library/Python/2.7/site-packages/keystoneclient/__init__.py", line 37, in <module>
    __version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 78, in version_string
    for part in self.release_string().split('.'):
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 70, in release_string
    self.release = self._get_version_from_pkg_resources()
  File "/Library/Python/2.7/site-packages/pbr/version.py", line 62, in _get_version_from_pkg_resources
    return packaging.get_version(self.package)
  File "/Library/Python/2.7/site-packages/pbr/packaging.py", line 870, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

Revision history for this message
b.sudhakoushik (b-sudhakoushik) wrote :

Is .git folder present in the python-novaclient folder ?

Revision history for this message
Ken Sheedlo (ken-sheedlo) wrote :

I found a workaround by installing both python-novaclient and pbr manually using setup.py install.

Revision history for this message
b.sudhakoushik (b-sudhakoushik) wrote :

one more work around....you can just give git init in the python-novaclient where you ahve the error. it will work :-)

Revision history for this message
melanie witt (melwitt) wrote :

I'm able to reproduce the problem on OS X 10.9.4 using the instructions for installing client via pip:

http://docs.openstack.org/user-guide/content/install_clients.html

Changed in python-novaclient:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
melanie witt (melwitt) wrote :

Clients should use pkg_resources instead of pbr to get package version.

Changed in pbr:
assignee: nobody → melanie witt (melwitt)
status: New → Confirmed
no longer affects: python-novaclient
Changed in python-novaclient:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
melanie witt (melwitt) wrote :

This is happening because currently pbr looks to read the PKG-INFO file and if it fails, it tries to get the version information from git. In packages that use package metadata 2.0, there is a METADATA file instead of a PKG-INFO file and pbr doesn't know yet to look for it. Then the fallback to git will fail if pbr can't find a way to query it.

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

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

Changed in pbr:
status: Confirmed → In Progress
Changed in pbr:
milestone: none → next-juno
importance: Undecided → High
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

melwitt reports that the problem occurs with setuptools version 0.6c11 on precise and 0.6c12dev-r88846 on OS X

Revision history for this message
Robert Collins (lifeless) wrote :

BTW I completely disagree that clients should use pkg_resources. While we read version metadata from multiple sources in pbr, the version a client exposes at $client.version or $client.__version__ *must* match, which means either a complete copy of the pbr logic (including git checks), or using pbr.

Revision history for this message
melanie witt (melwitt) wrote :

I learned from chatting with lifeless and dstufft that the PKG-INFO vs METADATA file isn't related to package metadata version at all -- it's two different packaging formats described in PEP 0376 [1] and PEP 0427 [2].

[1] http://legacy.python.org/dev/peps/pep-0376/#how-distributions-are-installed
[2] http://legacy.python.org/dev/peps/pep-0427/#the-dist-info-directory

Revision history for this message
melanie witt (melwitt) wrote :

To correct my earlier comment, the way in which clients query package version is still up for debate!

no longer affects: python-novaclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/121751
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=eb7238725ed1837bd69d957f711087a45b82b8ab
Submitter: Jenkins
Branch: master

commit eb7238725ed1837bd69d957f711087a45b82b8ab
Author: melanie witt <email address hidden>
Date: Tue Sep 16 04:53:36 2014 +0000

    Support reading versions from wheels

    This change adds the ability for pbr to read the package version from
    the METADATA file as well as the PKG-INFO file. The PKG-INFO file
    is present for sdist packages but for wheel packages (PEP 427),
    there is a METADATA file instead of a PKG-INFO file.

    Closes-Bug: #1369179
    Change-Id: I2fe52c846fd88d37a4ab78de87eec9defce1ba0a

Changed in pbr:
status: In Progress → Fix Committed
Changed in pbr:
milestone: next-juno → next-kilo
Revision history for this message
Stanislaw Pitucha (viraptor-gmail) wrote :

So is this not going to make any close release? None of the nova clients > 2.17 (up to the current 2.20) are installable via pip.

In practice `pip install python-novaclient` fails for new users with only reference to this bug being via google.

Changed in pbr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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