salt icon indicating copy to clipboard operation
salt copied to clipboard

[salt-cloud] Throwing a lot of errors if python-simplejson is installed on system

Open nmadhok opened this issue 11 years ago • 10 comments

Getting a lot of errors on the server after installing salt-enterprise-cloud. Fixed the problem by removing python-simplejson from the server.

versions-report:

[root@nitin-develop salt]# salt-cloud --versions-report
            Salt: 4.0.0
          Python: 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
          Jinja2: 2.2.1
        M2Crypto: 0.20.2
  msgpack-python: 0.4.6
    msgpack-pure: Not Installed
        pycrypto: 2.6.1
         libnacl: Not Installed
          PyYAML: 3.10
           ioflo: Not Installed
           PyZMQ: 14.5.0
            RAET: Not Installed
             ZMQ: 4.0.5
            Mako: Not Installed
 Apache Libcloud: 0.17.0

Issue:

[root@nitin-develop salt]# salt-cloud
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
/usr/lib64/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)
[INFO    ] salt-cloud starting
[ERROR   ] Failed to import clouds openstack, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/loader.py", line 951, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.6/site-packages/salt/cloud/clouds/openstack.py", line 133, in <module>
    from libcloud.compute.base import NodeState
  File "/usr/lib/python2.6/site-packages/libcloud/compute/base.py", line 32, in <module>
    from libcloud.pricing import get_size_price
  File "/usr/lib/python2.6/site-packages/libcloud/pricing.py", line 26, in <module>
    JSONDecodeError = json.JSONDecodeError
AttributeError: 'module' object has no attribute 'JSONDecodeError'
[ERROR   ] Failed to import clouds linode, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/loader.py", line 951, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.6/site-packages/salt/cloud/clouds/linode.py", line 68, in <module>
    import linode
  File "/usr/lib/python2.6/site-packages/salt/cloud/clouds/linode.py", line 74, in <module>
    from libcloud.compute.base import NodeAuthPassword
  File "/usr/lib/python2.6/site-packages/libcloud/compute/base.py", line 32, in <module>
    from libcloud.pricing import get_size_price
  File "/usr/lib/python2.6/site-packages/libcloud/pricing.py", line 26, in <module>
    JSONDecodeError = json.JSONDecodeError
AttributeError: 'module' object has no attribute 'JSONDecodeError'
[ERROR   ] Failed to import clouds rackspace, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/loader.py", line 951, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.6/site-packages/salt/cloud/clouds/rackspace.py", line 46, in <module>
    from libcloud.compute.base import NodeState
  File "/usr/lib/python2.6/site-packages/libcloud/compute/base.py", line 32, in <module>
    from libcloud.pricing import get_size_price
  File "/usr/lib/python2.6/site-packages/libcloud/pricing.py", line 26, in <module>
    JSONDecodeError = json.JSONDecodeError
AttributeError: 'module' object has no attribute 'JSONDecodeError'
[ERROR   ] Failed to import clouds cloudstack, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/loader.py", line 951, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.6/site-packages/salt/cloud/clouds/cloudstack.py", line 41, in <module>
    from libcloud.compute.drivers.cloudstack import CloudStackNetwork
  File "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/cloudstack.py", line 26, in <module>
    from libcloud.compute.base import Node, NodeDriver, NodeImage, NodeLocation
  File "/usr/lib/python2.6/site-packages/libcloud/compute/base.py", line 32, in <module>
    from libcloud.pricing import get_size_price
  File "/usr/lib/python2.6/site-packages/libcloud/pricing.py", line 26, in <module>
    JSONDecodeError = json.JSONDecodeError
AttributeError: 'module' object has no attribute 'JSONDecodeError'
Usage: salt-cloud

salt-cloud: error: Nothing was done. Using the proper arguments?

Fixed by:

[root@nitin-develop salt]# yum erase python-simplejson

Is there a better fix for this? I don't like the idea of removing a package from the server since there are other applications that need that package.

nmadhok avatar May 23 '15 00:05 nmadhok

Why was this closed?

trebortech avatar Nov 05 '15 14:11 trebortech

@trebortech Since it was a salt enterprise related bug, I submitted the issue through the salt enterprise support portal instead. If you're having this issue, I would be happy to reopen this or you can submit a new issue.

nmadhok avatar Nov 05 '15 15:11 nmadhok

Thanks @nmadhok. Please reopen this issue since it's not only salt enterprise having the issue. I've already alerted engineering on this issue and they are looking at it. This will be a good place to track that work.

trebortech avatar Nov 05 '15 16:11 trebortech

This looks like a known libcloud issue: https://issues.apache.org/jira/browse/LIBCLOUD-714

techhat avatar Nov 05 '15 17:11 techhat

@techhat If I can recall correctly, @terminalmage fixed the issue and submitted a PR upstream for it. For some reason @trebortech is still seeing this issue.

nmadhok avatar Nov 05 '15 18:11 nmadhok

Hey, and it was fixed by one of our guys too! apache/libcloud#577

techhat avatar Nov 05 '15 18:11 techhat

@trebortech can you give us a salt-cloud --versions-report, and let us know which version of simplejson you're using?

techhat avatar Nov 05 '15 18:11 techhat

Salt Version: Salt: 2015.8.1

Dependency Versions: Apache Libcloud: 0.18.0 Jinja2: 2.2.1 M2Crypto: 0.20.2 Mako: Not Installed PyYAML: 3.11 PyZMQ: 14.5.0 Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51) RAET: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5 cffi: Not Installed cherrypy: Not Installed dateutil: 1.4.1 gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed libnacl: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 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: redhat 6.6 Santiago machine: x86_64 release: 2.6.32-504.8.1.el6.x86_64 system: Red Hat Enterprise Linux Server 6.6 Santiago

Working on getting the simplejson version. Will update when I have that.

trebortech avatar Nov 06 '15 13:11 trebortech

Thanks @trebortech. Libcloud 0.19.0 was released this month, so I would expect it to have the patch.

techhat avatar Nov 06 '15 14:11 techhat

@techhat Yep, my fix did indeed make it into libcloud 0.19.0: https://github.com/apache/libcloud/blob/v0.19.0/libcloud/pricing.py#L24-L33

We'll be packaging it soon for the next Salt release.

The options for working around this upstream bug are either to upgrade/remove simplejson, or upgrade libcloud.

Since there is nothing more that can be done on our end, I'm going to go ahead and close this.

terminalmage avatar Nov 06 '15 16:11 terminalmage