Repository navigation
Closed
Labels
Corerelates to code central or existential to SaltP1Priority 1bugbroken, incorrect, or confusing behaviorseverity-high2nd top severity, seen by most users, causes major problems
Description
Description
pip state fails with AttributeError in Salt 2015.8.9 with pip < 6.0
Setup
Ubuntu Trusty
python-pip installed from mainline apt (pip 1.5.4)
Steps to Reproduce Issue
Run a state with pip.installed in it with pip 1.5.4 installed on the system.
Versions Report
# salt-call --versions-report
Salt Version:
Salt: 2015.8.9
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: Not Installed
Mako: 0.9.1
PyYAML: 3.10
PyZMQ: 14.0.1
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.4
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.5
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: Ubuntu 14.04 trusty
machine: x86_64
release: 4.2.0-35-generic
system: Ubuntu 14.04 trusty
Stack trace from the minion output:
Function: pip.installed
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 1492, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 597, in installed
out = _check_pkg_version_format(pkg)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 181, in _check_pkg_version_format
specifier = install_req.req.specifier
AttributeError: Requirement instance has no attribute 'specifier'
Started: 20:19:45.883326
Duration: 3.61 ms
Changes:
Relevant code in pip: https://github.com/pypa/pip/blob/1.5.6/pip/req.py#L170
As you can see, req is a string.
I posted all this as comments on #33180, then realized I should open an issue. Sorry about that.
Metadata
Metadata
Assignees
Labels
Corerelates to code central or existential to SaltP1Priority 1bugbroken, incorrect, or confusing behaviorseverity-high2nd top severity, seen by most users, causes major problems
Activity
shawnbutts commentedon May 19, 2016
I'm also seeing something simalar with pip 6.1.1
shawnbutts commentedon May 19, 2016
I have confirmed that reverting #33180 fixes this issue.
tmehlinger commentedon May 19, 2016
For what it's worth, I've managed to work around this with a (rather convoluted) set of states that guarantee the latest available pip is installed as the system pip. I would not consider this safe to use in the general case but it's working for me on fresh systems:
doberloh commentedon May 19, 2016
+1 on a fix for this ASAP.
thatch45 commentedon May 19, 2016
Yes, for the record this hit us out of nowhere because of an upstream change and are working on this right now
thatch45 commentedon May 19, 2016
ok, can you try this patch out? It is not the most elegant, but should be safe
#33383
shawnbutts commentedon May 19, 2016
#33383 did not work for me.
thatch45 commentedon May 19, 2016
Thanks @shawnbutts , can you try this again> I moved the try/execpt to the right spot:
#33383
shawnbutts commentedon May 19, 2016
That did it! Thanks for the quick work.
@tmehlinger can you confirm as well?
tmehlinger commentedon May 19, 2016
Like a champ here. :)
@thatch45 are you referring to the upstream change in pip? Don't sweat it... it also caught me out with devpi. :(
thatch45 commentedon May 20, 2016
thanks @tmehlinger ! Glad this got things working again, and thanks for letting me vent a little!
tmehlinger commentedon May 20, 2016
Sure thing man, nice running into you again, one way or another. :)
thatch45 commentedon May 20, 2016
it is, looks like life has been a ride since firehost for you!
thatch45 commentedon May 20, 2016
This is serious enough that I think we will cut a 2015.8.10, upstream apis changed at the last minute can really throw us for a loop :)
cachedout commentedon May 23, 2016
This should be fully resolved, per @thatch45