Devstack fails with oslo.policy version mismatch

841 Views Asked by At

I am trying to install devstack(stable/newton). I am getting the following error:

Traceback (most recent call last):
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
2016-11-29 16:36:55.348 |     status = self.run(options, args)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
2016-11-29 16:36:55.348 |     wb.build(autobuilding=True)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
2016-11-29 16:36:55.348 |     self.requirement_set.prepare_files(self.finder)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
2016-11-29 16:36:55.348 |     ignore_dependencies=self.ignore_dependencies))
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 521, in _prepare_file
2016-11-29 16:36:55.348 |     req_to_install.check_if_exists()
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1036, in check_if_exists
2016-11-29 16:36:55.348 |     self.req.name
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 558, in get_distribution
2016-11-29 16:36:55.348 |     dist = get_provider(dist)
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 432, in get_provider
2016-11-29 16:36:55.348 |     return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 968, in require
2016-11-29 16:36:55.348 |     needed = self.resolve(parse_requirements(requirements))
2016-11-29 16:36:55.348 |   File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 859, in resolve
2016-11-29 16:36:55.348 |     raise VersionConflict(dist, req).with_context(dependent_req)
2016-11-29 16:36:55.348 | ContextualVersionConflict: (oslo.policy 1.14.0 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('oslo.policy>=1.15.0'), set(['neutron-lib']))

I tried upgrading oslo.policy using pip but the issue still persists. Any pointers on how to resolve this?

1

There are 1 best solutions below

3
On BEST ANSWER

This is caused by a global requirements change. Some projects will merge the requirements faster than others. If you haven't done so already, get the latest clone from master. Then you can grep for "oslo.policy>" and see which project's requirements file is bringing the version down.

To see the version number run this command in the /opt/stack/ directory:

    grep -r "oslo.policy>"

NOTE: After this point the solution will only work at the time the question was asked. The following can be considered as an example on how to make your own grep and sed command to make the updates. The goal is to make all your requirements files have the same oslo.policy version.

I see version 1.14.0 is bringing you down so what you want to do is:

    grep -r -l "oslo.policy>=1.14.0" | xargs -l sed -i -e "s/oslo.policy>=1.14.0/oslo.policy>=1.15.0/g"

This will do a find and replace for you. After that you should verify the files were indeed changed by running the first grep again. You may have to change the pattern to match the version, sometimes it is 1.14.0 and other times it can be just 1.14

Finally, upgrade oslo.policy and try again.