PBR

pbr is failing to parse versions

Bug #1361251 reported by Flavio Percoco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
Fix Released
Critical
Robert Collins

Bug Description

After tagging glance.store 0.0.1a2, this error was raised:

2014-08-25 11:03:21.216 | Syncing /opt/stack/new/glance.store/test-requirements.txt
2014-08-25 11:03:21.263 | Syncing setup.py
2014-08-25 11:03:21.279 | + setup_package /opt/stack/new/glance.store -e
2014-08-25 11:03:21.279 | + local project_dir=/opt/stack/new/glance.store
2014-08-25 11:03:21.279 | + local flags=-e
2014-08-25 11:03:21.279 | + pip_install -e /opt/stack/new/glance.store
2014-08-25 11:03:21.287 | + sudo PIP_DOWNLOAD_CACHE=/var/cache/pip http_proxy= https_proxy= no_proxy= /usr/local/bin/pip install --build=/tmp/pip-build.IZ7j7 -e /opt/stack/new/glance.store
2014-08-25 11:03:21.584 | DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated. See https://github.com/pypa/pip/issues/906.
2014-08-25 11:03:21.588 | Obtaining file:///opt/stack/new/glance.store
2014-08-25 11:03:21.669 | Running setup.py (path:/opt/stack/new/glance.store/setup.py) egg_info for package from file:///opt/stack/new/glance.store
2014-08-25 11:03:22.109 | ERROR:root:Error parsing
2014-08-25 11:03:22.109 | Traceback (most recent call last):
2014-08-25 11:03:22.109 | File "/usr/local/lib/python2.7/dist-packages/pbr/core.py", line 104, in pbr
2014-08-25 11:03:22.109 | attrs = util.cfg_to_args(path)
2014-08-25 11:03:22.110 | File "/usr/local/lib/python2.7/dist-packages/pbr/util.py", line 238, in cfg_to_args
2014-08-25 11:03:22.110 | pbr.hooks.setup_hook(config)
2014-08-25 11:03:22.110 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/__init__.py", line 27, in setup_hook
2014-08-25 11:03:22.110 | metadata_config.run()
2014-08-25 11:03:22.110 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/base.py", line 29, in run
2014-08-25 11:03:22.110 | self.hook()
2014-08-25 11:03:22.110 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/metadata.py", line 28, in hook
2014-08-25 11:03:22.110 | self.config['name'], self.config.get('version', None))
2014-08-25 11:03:22.111 | File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 895, in get_version
2014-08-25 11:03:22.111 | version = _get_version_from_git(pre_version)
2014-08-25 11:03:22.111 | File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 844, in _get_version_from_git
2014-08-25 11:03:22.111 | semver = version.SemanticVersion.from_pip_string(last_version)
2014-08-25 11:03:22.111 | File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 221, in from_pip_string
2014-08-25 11:03:22.111 | raise ValueError('Unknown remainder %r' % (remainder,))
2014-08-25 11:03:22.111 | ValueError: Unknown remainder [u'1a2']
2014-08-25 11:03:22.111 | error in setup command: Error parsing /opt/stack/new/glance.store/setup.cfg: ValueError: Unknown remainder [u'1a2']
2014-08-25 11:03:22.161 | Complete output from command python setup.py egg_info:
2014-08-25 11:03:22.161 | ERROR:root:Error parsing
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | Traceback (most recent call last):
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | File "/usr/local/lib/python2.7/dist-packages/pbr/core.py", line 104, in pbr
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | attrs = util.cfg_to_args(path)
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | File "/usr/local/lib/python2.7/dist-packages/pbr/util.py", line 238, in cfg_to_args
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | pbr.hooks.setup_hook(config)
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.161 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/__init__.py", line 27, in setup_hook
2014-08-25 11:03:22.161 |
2014-08-25 11:03:22.162 | metadata_config.run()
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/base.py", line 29, in run
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | self.hook()
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/metadata.py", line 28, in hook
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | self.config['name'], self.config.get('version', None))
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 895, in get_version
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | version = _get_version_from_git(pre_version)
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 844, in _get_version_from_git
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | semver = version.SemanticVersion.from_pip_string(last_version)
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 221, in from_pip_string
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | raise ValueError('Unknown remainder %r' % (remainder,))
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | ValueError: Unknown remainder [u'1a2']
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | error in setup command: Error parsing /opt/stack/new/glance.store/setup.cfg: ValueError: Unknown remainder [u'1a2']
2014-08-25 11:03:22.162 |
2014-08-25 11:03:22.162 | ----------------------------------------

Since the version is wrong - the first 3 parts of the version should be just numbers - we should just report the error when the sdist is created to avoid having issues installing it.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

logstash shows a bunch of errors from the past few day(s)

message:"ValueError: Unknown remainder" AND tags:"console"

Revision history for this message
Jeremy Stanley (fungi) wrote :

If that pattern really isn't considered valid, we should strongly consider updating the ref pattern for the pre-release pipeline at http://git.openstack.org/cgit/openstack-infra/config/tree/modules/openstack_project/files/zuul/layout.yaml#n96 so as to avoid uploading releases which will cause PBR to explode on people.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

The check in pbr that's failing was added fairly recently: https://review.openstack.org/#/c/114093/6/pbr/version.py

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

@fungi its not, see the semver spec in oslo.

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/116775

Changed in pbr:
assignee: nobody → Robert Collins (lifeless)
status: New → In Progress
Changed in pbr:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

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

commit 85ba9600b2009f47552ce35a7e7de02cda0c179e
Author: Robert Collins <email address hidden>
Date: Tue Aug 26 15:46:16 2014 +1200

    Handle more legacy version numbers

    We were not handling 1.2.1a1 or 2.1.0.rc1.

    Change-Id: I087ff6f0449d528ee86b8e16721d12fd9b231846
    Closes-Bug: #1361251

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

Other bug subscribers

Remote bug watches

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