Repository navigation
Closed
Labels
Execution-ModuleP1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-ModuleUpstream-Bugis a result of an upstream issue, not in saltfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
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
Reacted by Bo Blanton UACF, Josh VanderLinden, Denis, Nicolas Fillot, Peter Baumgartner, Ryan Rubin, Tony Ghita, Ryan Ashcraft, Blake Miller, Martin Wicks and 5 more
Metadata
Metadata
Assignees
Labels
Execution-ModuleP1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-ModuleUpstream-Bugis a result of an upstream issue, not in saltfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
[-]Salt incompatible with Pip v8.1.2 [/-][+]Salt 2015.8.5 incompatible with Pip v8.1.2[/+]uacfboblanton commentedon May 11, 2016
can verify this as well, same error
codekoala commentedon May 11, 2016
Affects 2015.8.8.2 as well.
james9k commentedon May 11, 2016
Can confirm downgrading to pip 8.1.1 for Salt 2015.8.8.2 works.
tom-aa commentedon May 11, 2016
same error here with 8.1.2, downgrade to 8.1.1 works fine
rrei commentedon May 11, 2016
This affects the 'develop' branch too. Downgrading pip works, but the virtualenv state module is not working for me anymore (perhaps unrelated...).
5 remaining items
lietu commentedon May 12, 2016
Downgrading Pip with
pip install pip==8.1.1seemed to fix it for now.Set pip version explicitly
cachedout commentedon May 12, 2016
We should have this all wrapped up with the merge of #33180. I'm going to go ahead and close this.
moloney commentedon May 25, 2016
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.
fix salt-pip version problem in demo
Freeze pip version.
haraldrudell commentedon Aug 5, 2016
23a24 > import re 176,177c177,182 < ret['prefix'] = install_req.req.project_name < ret['version_spec'] = install_req.req.specs --- > ret['prefix'] = re.sub('[^A-Za-z0-9.]+', '-', install_req.name) > if hasattr(install_req, "specifier"): > specifier = install_req.specifier > else: > specifier = install_req.req.specifier > ret['version_spec'] = [(spec.operator, spec.version) for spec in specifier]and doessudo patch /usr/lib/python2.7/dist-packages/salt/states/pip_state.py fileThe problem goes away
moloney commentedon Oct 1, 2016
This is still broken in 2015.8.12
use pip 8.1.1 instead, 8.2.2 does not work well with salt
Merge branch 'hotfix-pip811' into 'develop'
bernielomax commentedon Apr 5, 2017
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 --upgradeto fix the issue.brentsmyth commentedon Jun 6, 2017
So is the idea that on ubuntu one needs to first install the
python-pipapt package and then reinstall pip with pip?servomac commentedon Jun 14, 2017
I have the same problem with pip 9.0.1. It only fails with
salt-minion 2015.8.8, butsalt-minion 2015.8.13works. The recipe is extremely simple: