salt: Salt 2015.8.5 incompatible with Pip v8.1.2
Description of Issue/Question
Pip 8.1.2 was just released and the poorly timed upgrade to it broke all of our salt states that rely on pip. Force downgrading and locking pip to version 8.1.1 resolves the issue for now.
Setup
admin@jay-dev-001:~$ pip --version
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)
config['upgrade-pip'] = {
'pip.installed': [
{'name': 'pip'},
{'reload_modules': True},
{'upgrade': True},
{'require': [{'pkg': 'core_packages'}]}
]
}
config['upgrade-requests'] = {
'pip.installed': [
{'name': 'requests'},
{'reload_modules': True},
{'upgrade': True},
{'require': [
{'pkg': 'core_packages'},
{'pip': 'pip'}
]}
]
}
config['docker-py'] = {
'pip.installed': [
{'name': 'docker-py == 1.4.0'},
{'reload_modules': True},
{'require': [
{'pip': 'requests'},
{'pip': 'pip'}
]}
]
}
Steps to Reproduce Issue
salt * state.apply
----------
ID: upgrade-pip
Function: pip.installed
Name: pip
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 592, in installed
out = _check_pkg_version_format(pkg)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 176, in _check_pkg_version_format
ret['prefix'] = install_req.req.project_name
AttributeError: 'Requirement' object has no attribute 'project_name'
Started: 02:02:36.041407
Duration: 55.199 ms
Changes:
----------
ID: upgrade-requests
Function: pip.installed
Name: requests
Result: False
Comment: One or more requisite failed: core.docker_setup.upgrade-pip
Started:
Duration:
Changes:
----------
ID: install-python-requests
Function: pip.installed
Name: requests
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 592, in installed
out = _check_pkg_version_format(pkg)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 176, in _check_pkg_version_format
ret['prefix'] = install_req.req.project_name
AttributeError: 'Requirement' object has no attribute 'project_name'
Started: 02:02:36.484286
Duration: 56.197 ms
Changes:
----------
ID: docker-py
Function: pip.installed
Name: docker-py == 1.4.0
Result: False
Comment: One or more requisite failed: core.docker_setup.upgrade-pip, core.docker_setup.upgrade-requests, consul.install.install-python-requests
Started:
Duration:
Changes:
----------
ID: install-python-consul
Function: pip.installed
Name: python-consul
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 592, in installed
out = _check_pkg_version_format(pkg)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 176, in _check_pkg_version_format
ret['prefix'] = install_req.req.project_name
AttributeError: 'Requirement' object has no attribute 'project_name'
Started: 02:02:46.170152
Duration: 58.18 ms
Changes:
Versions Report
admin@saltshaker-001:~$ salt --versions-report
Salt Version:
Salt: 2015.8.5
Dependency Versions:
Jinja2: 2.7.3
M2Crypto: Not Installed
Mako: 1.0.0
PyYAML: 3.11
PyZMQ: 14.4.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: 0.3.6
smmap: 0.8.2
timelib: Not Installed
System Versions:
dist: debian 8.3
machine: x86_64
release: 3.16.0-4-amd64
system: debian 8.3
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 15
- Comments: 18 (7 by maintainers)
Commits related to this issue
- Set pip version explicitly Due to a bug in salt, pip version 8.1.2 breaks the salt state. This change set the pip version explicitly to 8.1.1. See https://github.com/saltstack/salt/issues/33163 for a... — committed to ministryofjustice/python-formula by deleted user 8 years ago
- fix salt-pip version problem in demo - as a result of this bug in salt: https://github.com/saltstack/salt/issues/33163 — committed to xBrite/flyingcloud by deleted user 8 years ago
- Freeze pip version. Newer version breaks Salt: https://github.com/saltstack/salt/issues/33163 — committed to tozd/salt by mitar 8 years ago
- use pip 8.1.1 instead, 8.2.2 does not work well with salt https://github.com/saltstack/salt/issues/33163 — committed to hvnsweeting/states by deleted user 8 years ago
- Merge branch 'hotfix-pip811' into 'develop' use pip 8.1.1 instead, 8.2.2 does not work well with salt https://github.com/saltstack/salt/issues/33163 See merge request !192 — committed to hvnsweeting/states by deleted user 8 years ago
Downgrading Pip with
pip install pip==8.1.1
seemed to fix it for now.I was still experiencing this issue with Ubuntu’s python-pip (8.1.1). I had to run
pip install pip==8.1.1 --force --upgrade
to fix the issue.sudo patch /usr/lib/python2.7/dist-packages/salt/states/pip_state.py file
The problem goes away
FYI, this also shows up in Ubuntu Xenial package ‘8.1.1-2ubuntu0.1’ even though “pip --version” returns “8.1.1”. Installing the older version “python-pip=8.1.1-2” works.