You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exception loading pip_state on Ubuntu 12.04 #31025
P2Priority 2PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
We're seeing this error on any salt run on Ubuntu 12.04 with the system pip package (python-pip_1.0-1build1) installed.
[ERROR ] Failed to import states pip_state, this is due most likely to a syntax error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1135, in _load_module
), fn_, fpath, desc)
File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 51, in <module>
ver = pip.__version__.split('.')
AttributeError: 'module' object has no attribute '__version__'
Unlike later versions of pip, version 1.0 doesn't have a version string:
$ python
Python 2.7.3 (default, Jun 22 2015, 19:33:41)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> pip.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
It's probably best to wrap the pip.__version__ check in salt/states/pip_state.py in a hasattr call. Incidentally, the version check in that module appears to be duplicated.
Salt Version:
Salt: 2015.8.5
Dependency Versions:
Jinja2: 2.6
M2Crypto: 0.21.1
Mako: Not Installed
PyYAML: 3.10
PyZMQ: 14.0.1
Python: 2.7.3 (default, Jun 22 2015, 19:33:41)
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: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: Ubuntu 12.04 precise
machine: x86_64
release: 3.2.0-95-virtual
system: Ubuntu 12.04 precise
Hi @byronclark - apologies for not coming back to this issue sooner. Thank you for fixing this issue. We are no longer accepting fixes to that branch unless it is for a security issue, so I won't be merging this fix into 2015.8.
However, I did check and realized this fix is not in the 2016.3 branch yet either. I will back-port your fix to 2016.3 right now and it will be available in the 2016.3.5 release of Salt. After the back-port is merged in, are you OK closing this issue?
Oh! It looks like I spoke too soon. When attempting to backport your fix I discovered through a merge-conflict that your change was back-ported to 2015.8 with #33396, which also built on your work.
I'm going to go ahead and close this as resolved. Please let us know if this pops up again and we can take another look. Thanks!
P2Priority 2PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
ssgward commentedon Feb 8, 2016
@byronclark - what version of salt are you using?
salt --versions-reportWhat command are you running to get the error? Or can you add your state file contents to the bug?
Thanks for bringing this to our attention.
jfindlay commentedon Feb 8, 2016
@byronclark, also you're welcome to send in a pull request if you have a fix for this.
byronclark commentedon Feb 8, 2016
Versions:
byronclark commentedon Feb 8, 2016
The error appears on every
state.highstaterun if the python-pip package is installed.byronclark commentedon Feb 8, 2016
Linked pull request at least hides the error. Notably, none of our states are using the
pipstate.byronclark commentedon Feb 9, 2016
#31027 was merged. I'd love to see that merged to the 2015.8 branch as well so the next point release has that fix.
rallytime commentedon Nov 3, 2016
Hi @byronclark - apologies for not coming back to this issue sooner. Thank you for fixing this issue. We are no longer accepting fixes to that branch unless it is for a security issue, so I won't be merging this fix into 2015.8.
However, I did check and realized this fix is not in the 2016.3 branch yet either. I will back-port your fix to 2016.3 right now and it will be available in the 2016.3.5 release of Salt. After the back-port is merged in, are you OK closing this issue?
rallytime commentedon Nov 3, 2016
Oh! It looks like I spoke too soon. When attempting to backport your fix I discovered through a merge-conflict that your change was back-ported to 2015.8 with #33396, which also built on your work.
I'm going to go ahead and close this as resolved. Please let us know if this pops up again and we can take another look. Thanks!