<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why am I getting &amp;quot;ImportError: undefined symbol: PyUnicodeUCS2_Decode&amp;quot; with Splunk on Red Hat Linux 7? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235372#M2993</link>
    <description>&lt;P&gt;In a nutshell, Red Hat's python is built differently from splunk's python.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;In other words, if you're going to do Red Hat admin work, don't load /opt/splunk/bin/setSplunkEnv&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2015 21:28:18 GMT</pubDate>
    <dc:creator>sjalexander</dc:creator>
    <dc:date>2015-11-13T21:28:18Z</dc:date>
    <item>
      <title>Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235369#M2990</link>
      <description>&lt;P&gt;This isn't a question, but a heads-up.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;This can become an issue if you load &lt;CODE&gt;/opt/splunk/bin/setSplunkEnv&lt;/CODE&gt; 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.&lt;/P&gt;

&lt;P&gt;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:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;backtrace:
:__init__.py:36:&amp;lt;module&amp;gt;: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 &amp;lt;module&amp;gt;
:    from up2date_client import up2dateAuth
:  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 4, in &amp;lt;module&amp;gt;
:    import rhnserver
:  File "/usr/share/rhn/up2date_client/rhnserver.py", line 34, in &amp;lt;module&amp;gt;
:    import rpcServer
:  File "/usr/share/rhn/up2date_client/rpcServer.py", line 6, in &amp;lt;module&amp;gt;
:    import config
:  File "/usr/share/rhn/up2date_client/config.py", line 18, in &amp;lt;module&amp;gt;
:    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 &amp;lt;module&amp;gt;
:    import SSL
:  File "/usr/lib/python2.7/site-packages/rhn/SSL.py", line 27, in &amp;lt;module&amp;gt;
:    from OpenSSL import SSL
:  File "/opt/splunk/lib/python2.7/site-packages/OpenSSL/__init__.py", line 36, in &amp;lt;module&amp;gt;
:    from OpenSSL import crypto
:ImportError: /opt/splunk/lib/python2.7/site-packages/OpenSSL/crypto.so: undefined symbol: PyUnicodeUCS2_Decode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's how I found the error - the stack trace points to the Splunk Python.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;undefined symbol: PyUnicodeUCS2_Decode&lt;/CODE&gt; issue is detailed here: &lt;A href="https://docs.python.org/2/faq/extending.html#when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2"&gt;https://docs.python.org/2/faq/extending.html#when-importing-module-x-why-do-i-get-undefined-symbol-pyunicodeucs2&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235369#M2990</guid>
      <dc:creator>sjalexander</dc:creator>
      <dc:date>2015-11-13T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235370#M2991</link>
      <description>&lt;P&gt;Hey there @sjalexander&lt;/P&gt;

&lt;P&gt;Thanks for sharing this. Would you actually be able to post your "Answer" explaining why this error occurs in the "Enter your answer here..." box below and officially accept? Otherwise, this will float around in limbo as unresolved with no answer. &lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235370#M2991</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-11-13T21:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235371#M2992</link>
      <description>&lt;P&gt;yeah can do.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:27:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235371#M2992</guid>
      <dc:creator>sjalexander</dc:creator>
      <dc:date>2015-11-13T21:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235372#M2993</link>
      <description>&lt;P&gt;In a nutshell, Red Hat's python is built differently from splunk's python.&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;In other words, if you're going to do Red Hat admin work, don't load /opt/splunk/bin/setSplunkEnv&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235372#M2993</guid>
      <dc:creator>sjalexander</dc:creator>
      <dc:date>2015-11-13T21:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235373#M2994</link>
      <description>&lt;P&gt;@ppablo since you're here - is there a cleaner way of formatting code blocks? I gave up after trying maybe 5 times. The preview and the actual output don't match.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235373#M2994</guid>
      <dc:creator>sjalexander</dc:creator>
      <dc:date>2015-11-13T21:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235374#M2995</link>
      <description>&lt;P&gt;Ah yeah, so I actually did fix the formatting for you already, but I think you were editing at the same time, so your recent save overwrote my changes lol. I'll go ahead and fix it up for you.&lt;/P&gt;

&lt;P&gt;For any sample code, error messages, searches, and conf file stanzas (especially ones with regular expressions), it's best to highlight the entire block of that content and click the Code Sample button in the text editing tools like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[stanza...]
REGEX = \*blahregex*s\\*\*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you're trying to render special characters properly inline within a sentence/paragraph, you just need to surround it with backticks like this: &lt;CODE&gt;\*blahregex*s\\*\*&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;The only characters that don't display properly within backticks are &amp;lt; and &amp;gt; and a bug is filed for that.&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 21:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235374#M2995</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-11-13T21:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235375#M2996</link>
      <description>&lt;P&gt;It helps a lot. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2015 23:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235375#M2996</guid>
      <dc:creator>sjalexander</dc:creator>
      <dc:date>2015-11-13T23:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "ImportError: undefined symbol: PyUnicodeUCS2_Decode" with Splunk on Red Hat Linux 7?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235376#M2997</link>
      <description>&lt;P&gt;Awesome, no problem. And thanks for sharing this post/tip with the rest of the Splunk community. Cheers!&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 02:14:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Why-am-I-getting-quot-ImportError-undefined-symbol-PyUnicodeUCS2/m-p/235376#M2997</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-11-17T02:14:42Z</dc:date>
    </item>
  </channel>
</rss>

