<?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: Error when importing custom python modules in splunk V9.x.x+ in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656945#M17315</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp; yes we are getting a full trace back, Its from our 3rd party app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 10:18:05 GMT</pubDate>
    <dc:creator>jabezds</dc:creator>
    <dc:date>2023-09-07T10:18:05Z</dc:date>
    <item>
      <title>Why is there an Error when importing custom python modules in splunk V9.x.x+?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656670#M17297</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Hi,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;while importing custom modules&amp;nbsp; (e.g. `from logger import Logger`) i&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;n the splunkd.log we are able to see&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;`ModuleNotFoundError: No module named 'logger'`&lt;/STRONG&gt;&amp;nbsp;error&amp;nbsp; and this is generated by this file "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py" .We suspect s&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;omehow library is not able to identify internal modules and hence throwing error. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;We are also able to see warning `DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses` in same log file.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;This issue seems to be on &lt;STRONG&gt;splunk version 9.0.x&lt;/STRONG&gt;. For splunk version 8.2.x it is working fine. As we have noticed main difference in these 2 versions is python 2.7 support is removed from version 9.0.x.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;We will like to know the possible&amp;nbsp;solution in solving this error.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 16:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656670#M17297</guid>
      <dc:creator>jabezds</dc:creator>
      <dc:date>2023-09-11T16:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error when importing custom python modules in splunk V9.x.x+</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656758#M17300</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223356"&gt;@jabezds&lt;/a&gt;&amp;nbsp;- Are you getting the full exception trace? Is the error originating from any Python file you have or from a third-party App?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 05:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656758#M17300</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-09-06T05:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error when importing custom python modules in splunk V9.x.x+</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656945#M17315</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp; yes we are getting a full trace back, Its from our 3rd party app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 10:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656945#M17315</guid>
      <dc:creator>jabezds</dc:creator>
      <dc:date>2023-09-07T10:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error when importing custom python modules in splunk V9.x.x+</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656946#M17316</link>
      <description>&lt;P&gt;Traceback Part-1&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;08-02-2023 16:15:01.256 +0530 ERROR HttpListener [77650 TcpChannelThread] - Exception while processing request from 127.0.0.1:43332 for /en-US/splunkd/__raw/servicesNS/nobody/CustomApp/umbrella?type=dns&amp;amp;from=1690929026000&amp;amp;to=1690972226000&amp;amp;_=1690972792543: Error starting: No module named 'logger'
08-02-2023 16:15:01.493 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
08-02-2023 16:15:01.493 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   import imp
08-02-2023 16:15:01.493 +0530 WARN  PersistentScript [77745 PersistentScriptIo] - Process {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: PID 78576 exited with code 1
08-02-2023 16:15:01.493 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: Traceback (most recent call last):
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 114, in &amp;lt;module&amp;gt;
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     h.run()
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/packet.py", line 191, in run
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self.handle_packet(in_packet)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/handle_loop.py", line 36, in handle_packet
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self._current_handler = self.load(in_packet.command, in_packet.command_arg, in_packet.allow_stream())
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 22, in load
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     class_and_meths = self._get_class_and_methods(command[0], stream_allowed)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 31, in _get_class_and_methods
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     meths = self._cached_load_file(filename)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 42, in _cached_load_file
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     rv = PersistentServerConnectionApplicationServer._load_file(filename)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 57, in _load_file
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     m = imp.load_module(munged_name, filehandle, filename, data)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 234, in load_module
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     return load_source(name, filename, file)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 171, in load_source
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     module = _load(spec)
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 696, in _load
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 677, in _load_unlocked
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap_external&amp;gt;", line 728, in exec_module
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 219, in _call_with_frames_removed
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/etc/apps/CustomApp/bin/umbrella_dashboard_api_client.py", line 13, in &amp;lt;module&amp;gt;
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     from logger import Logger
08-02-2023 16:15:01.494 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: ModuleNotFoundError: No module named 'logger'
08-02-2023 16:15:01.494 +0530 ERROR HttpListener [77650 TcpChannelThread] - Exception while processing request from 127.0.0.1:37186 for /en-US/splunkd/__raw/servicesNS/nobody/CustomApp/umbrella?type=dns&amp;amp;from=1690929026000&amp;amp;to=1690972226000&amp;amp;_=1690972792546: Error starting: No module named 'logger'
08-02-2023 16:15:01.641 +0530 WARN  PersistentScript [77745 PersistentScriptIo] - Process {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: PID 78582 exited with code 1
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: Traceback (most recent call last):
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 114, in &amp;lt;module&amp;gt;
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     h.run()
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/packet.py", line 191, in run
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self.handle_packet(in_packet)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/handle_loop.py", line 36, in handle_packet
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self._current_handler = self.load(in_packet.command, in_packet.command_arg, in_packet.allow_stream())
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 22, in load
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     class_and_meths = self._get_class_and_methods(command[0], stream_allowed)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 31, in _get_class_and_methods
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     meths = self._cached_load_file(filename)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 42, in _cached_load_file&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 10:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656946#M17316</guid>
      <dc:creator>jabezds</dc:creator>
      <dc:date>2023-09-07T10:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error when importing custom python modules in splunk V9.x.x+</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656947#M17317</link>
      <description>&lt;P&gt;Traceback Part-2&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     rv = PersistentServerConnectionApplicationServer._load_file(filename)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 57, in _load_file
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     m = imp.load_module(munged_name, filehandle, filename, data)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 234, in load_module
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     return load_source(name, filename, file)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 171, in load_source
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     module = _load(spec)
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 696, in _load
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 677, in _load_unlocked
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap_external&amp;gt;", line 728, in exec_module
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 219, in _call_with_frames_removed
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/etc/apps/CustomApp/bin/umbrella_dashboard_api_client.py", line 13, in &amp;lt;module&amp;gt;
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     from logger import Logger
08-02-2023 16:15:01.641 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: ModuleNotFoundError: No module named 'logger'
08-02-2023 16:15:01.806 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
08-02-2023 16:15:01.806 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   import imp
08-02-2023 16:15:01.808 +0530 ERROR HttpListener [77650 TcpChannelThread] - Exception while processing request from 127.0.0.1:37198 for /en-US/splunkd/__raw/servicesNS/nobody/CustomApp/umbrella?type=dns&amp;amp;from=1690929026000&amp;amp;to=1690972226000&amp;amp;_=1690972792547: Error starting: No module named 'logger'
08-02-2023 16:15:02.059 +0530 WARN  PersistentScript [77745 PersistentScriptIo] - Process {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: PID 78587 exited with code 1
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: Traceback (most recent call last):
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 114, in &amp;lt;module&amp;gt;
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     h.run()
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/packet.py", line 191, in run
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self.handle_packet(in_packet)
08-02-2023 16:15:02.059 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/handle_loop.py", line 36, in handle_packet
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     self._current_handler = self.load(in_packet.command, in_packet.command_arg, in_packet.allow_stream())
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 22, in load
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     class_and_meths = self._get_class_and_methods(command[0], stream_allowed)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 31, in _get_class_and_methods
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     meths = self._cached_load_file(filename)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 42, in _cached_load_file
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     rv = PersistentServerConnectionApplicationServer._load_file(filename)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py", line 57, in _load_file
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     m = imp.load_module(munged_name, filehandle, filename, data)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 234, in load_module
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     return load_source(name, filename, file)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/lib/python3.7/imp.py", line 171, in load_source
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     module = _load(spec)
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 696, in _load
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 677, in _load_unlocked
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap_external&amp;gt;", line 728, in exec_module
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "&amp;lt;frozen importlib._bootstrap&amp;gt;", line 219, in _call_with_frames_removed
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:   File "/opt/splunk/etc/apps/CustomApp/bin/umbrella_dashboard_api_client.py", line 13, in &amp;lt;module&amp;gt;
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}:     from logger import Logger
08-02-2023 16:15:02.060 +0530 ERROR PersistentScript [77745 PersistentScriptIo] - From {/opt/splunk/bin/python3.7 /opt/splunk/lib/python3.7/site-packages/splunk/persistconn/appserver.py}: ModuleNotFoundError: No module named 'logger'&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 07 Sep 2023 10:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/656947#M17317</guid>
      <dc:creator>jabezds</dc:creator>
      <dc:date>2023-09-07T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error when importing custom python modules in splunk V9.x.x+</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/657142#M17332</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223356"&gt;@jabezds&lt;/a&gt;&amp;nbsp;- Please check what is in line no. 13 of&amp;nbsp;umbrella_dashboard_api_client.py file. I think that's what is causing this error.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 06:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Why-is-there-an-Error-when-importing-custom-python-modules-in/m-p/657142#M17332</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-09-11T06:13:32Z</dc:date>
    </item>
  </channel>
</rss>

