Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?

$
0
0
This isn't a question, but a heads-up. On Red Hat 7, the distro Python and the Splunk Python don't get along. Red Hat's management tools are written in Python so this can be especially problematic. This can become an issue if you load `/opt/splunk/bin/setSplunkEnv` into your environment - the $PATH variable, among others, is modified so that Splunk's Python takes precedence; Red Hat's tools or anything else callingPython will try to use Splunk's python. Most operations don't throw stack traces, so "yum update" for example gave me nothing to go on. But I got the following stack trace on running rhn-profile-sync with the Splunk environment loaded: backtrace: :__init__.py:36::ImportError: /opt/splunk/lib/python2.7/site-packages/OpenSSL/crypto.so: undefined symbol: PyUnicodeUCS2_Decode : :Traceback (most recent call last): : File "/usr/sbin/rhn-profile-sync", line 20, in : from up2date_client import up2dateAuth : File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 4, in : import rhnserver : File "/usr/share/rhn/up2date_client/rhnserver.py", line 34, in : import rpcServer : File "/usr/share/rhn/up2date_client/rpcServer.py", line 6, in : import config : File "/usr/share/rhn/up2date_client/config.py", line 18, in : from rhn.connections import idn_ascii_to_pune, idn_pune_to_unicode : File "/usr/lib/python2.7/site-packages/rhn/connections.py", line 12, in : import SSL : File "/usr/lib/python2.7/site-packages/rhn/SSL.py", line 27, in : from OpenSSL import SSL : File "/opt/splunk/lib/python2.7/site-packages/OpenSSL/__init__.py", line 36, in : from OpenSSL import crypto :ImportError: /opt/splunk/lib/python2.7/site-packages/OpenSSL/crypto.so: undefined symbol: PyUnicodeUCS2_Decode That's how I found the error - the stack trace points to the Splunk Python. The `undefined symbol: PyUnicodeUCS2_Decode` issue is detailed here: https://docs.python.org/2/faq/extending.html#when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2 In a nutshell, Red Hat's Python is built differently from Splunk's Python, so make sure you use Splunk's Python for Splunk operations, and Red Hat's Python for Red Hat operations, and you should be good to go.

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>