PBR

Activity log for bug #1356784

Date Who What changed Old value New value Message
2014-08-14 09:20:36 Bence Romsics bug added bug
2014-08-14 15:15:40 Jeremy Stanley pbr: status New In Progress
2014-08-14 15:19:06 Jeremy Stanley pbr: status In Progress Incomplete
2014-08-14 19:59:08 Robert Collins pbr: status Incomplete Confirmed
2014-08-14 20:07:36 Robert Collins summary Introduction of semantic versioning support breaks devstack if repository contains free-format tags free-format signed tags treated as versions
2014-08-14 20:16:14 Robert Collins description I started noticing yesterday (2014-08-14) that my previously working devstack environment was not able to start up nova-api any more. nova-api could not start with the following error message: stack.sh failed with the following error message: [ERROR] /home/ebenrom/src/github.com/openstack-dev/devstack/lib/nova:610 nova-api did not start While nova-api itself failed to start with the error message: $ cd /opt/stack/nova && /usr/local/bin/nova-api & echo $! >/opt/stack/status/stack/n-api.pid; fg || echo "n-api failed to start" | tee "/opt/stack/status/stack/n-api.failure" [1] 20962 cd /opt/stack/nova && /usr/local/bin/nova-api Traceback (most recent call last): File "/usr/local/bin/nova-api", line 10, in <module> sys.exit(main()) File "/opt/stack/nova/nova/cmd/api.py", line 40, in main config.parse_args(sys.argv) File "/opt/stack/nova/nova/config.py", line 36, in parse_args version=version.version_string(), File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 433, in version_string return self.semantic_version().brief_string() File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 428, in semantic_version self._semantic = self._get_version_from_pkg_resources() File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 416, in _get_version_from_pkg_resources return SemanticVersion.from_pip_string(result_string) File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 155, in from_pip_string major = int(components[0]) ValueError: invalid literal for int() with base 10: 'cee-trunkport' n-api failed to start After some investigation I believe pbr generates python package version numbers based on git tags (probably based on something like git describe). And my nova repository actually contains tags like 'cee/trunkport-rc2'. (Which may not be a good version number, but that's not my point here.) I am using the following version of pbr: $ pip freeze | grep -w pbr pbr==0.10.0.6.g07fe2e0 Now I have found a commit which is the likely cause of the changed behavior: https://github.com/openstack-dev/pbr/commit/5957364887da51d1133370b82d1d7d137ce85631 Which aims to implement the 'pbr-semver' blueprint: http://git.openstack.org/cgit/openstack/oslo-specs/plain/specs/juno/pbr-semver.rst So my question is: Is this behavior a feature or a bug? I understand that the blueprint aims at using version numbers compatible with semantic versioning. On the other hand it practically forces everybody in the world having a clone of the nova repository (or actually any repository using pbr) to use git tags compatible with semantic versioning. And prohibits people using free-format tags. Those clones may have local modifications, they may have local, company standard rules of tagging, etc. So I'm not sure if it's a good idea to break when pbr encounters a tag name which is not a valid version number according to the semantic version spec. What do you think? pbr (incorrectly) accepts free-form tags as versions and puts those in the pip metadata. until recently this was not very visible, but since pbr started validating the versions it created, bad tags result in bad versions. The symptom will look something like: Traceback (most recent call last):   File "/usr/local/bin/nova-api", line 10, in <module>     sys.exit(main())   File "/opt/stack/nova/nova/cmd/api.py", line 40, in main     config.parse_args(sys.argv)   File "/opt/stack/nova/nova/config.py", line 36, in parse_args     version=version.version_string(),   File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 433, in version_string     return self.semantic_version().brief_string()   File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 428, in semantic_version     self._semantic = self._get_version_from_pkg_resources()   File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 416, in _get_version_from_pkg_resources     return SemanticVersion.from_pip_string(result_string)   File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 155, in from_pip_string     major = int(components[0]) ValueError: invalid literal for int() with base 10: 'cee-trunkport' n-api failed to start (In this case the nova repository has a most recent signed tag 'cee/trunkport-rc2') WORKAROUNDS =========== In the source tree with the tag either: - convert the signed tag to an unsigned tag - add a newer tag that is a valid version - delete the signed tag Then sdist and install the resulting package PROPOSED FIX ============ Ignore such tags and walk history back to an actual usable tag
2014-08-14 20:23:45 Robert Collins pbr: status Confirmed Triaged
2014-08-14 20:23:48 Robert Collins pbr: importance Undecided Critical
2014-08-15 00:43:58 OpenStack Infra pbr: status Triaged In Progress
2014-08-15 00:43:58 OpenStack Infra pbr: assignee Robert Collins (lifeless)
2014-09-08 21:09:35 Doug Hellmann pbr: milestone next-juno
2014-09-09 12:46:33 Doug Hellmann pbr: milestone next-juno juno-rc1
2014-09-09 12:48:25 Thierry Carrez pbr: milestone juno-rc1 next-juno
2014-09-09 12:50:55 Doug Hellmann pbr: milestone next-juno juno-rc1
2014-09-16 16:29:01 OpenStack Infra pbr: status In Progress Fix Committed
2014-09-23 18:07:23 Doug Hellmann pbr: milestone next-juno next-kilo
2015-05-05 18:22:35 Robert Collins pbr: status Fix Committed Fix Released