Skip to content

BUG: Can't import third-party Python modules #1627

@joepalm4

Description

@joepalm4

Description

When attempting to import a third-party pip module for a UCC input, I'm getting a 404 on the inputs page. I have tested this with the following imports (separately).
import kubernetes
import pandas

When I perform these imports, they are also added to package/lib/requirements.txt.

Here are my steps, trying to recreate the problem as simply as possible:

  • I build the demo_addon_for_splunk, and run ucc-gen build to output to my etc/apps directory.
  • I restart Splunk, and confirm the demo app is working.
  • I put kubernetes in package/lib/requirements.txt. I run ucc-gen build and confirm kubernetes is now listed in the app's lib directory.
  • I add import kubernetes to the top of the demo_input_helper.py source.
  • I restart Splunk, and get the 404 on the inputs page.

I get the following ERROR logs.

03-10-2025 09:02:14.182 -0700 ERROR AdminManagerExternal [67760 TcpChannelThread] - Unexpected error "<class 'splunktaucclib.rest_handler.error.RestError'>" from python handler: "REST Error [404]: Not Found -- Not Found". See splunkd.log/python.log for more details.
	
03-10-2025 09:02:14.182 -0700 ERROR AdminManagerExternal [67760 TcpChannelThread] - Stack trace from python handler:\nTraceback (most recent call last):\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunktaucclib\rest_handler\handler.py", line 180, in wrapper\n    for name, data, acl in meth(self, *args, **kwargs):\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunktaucclib\rest_handler\handler.py", line 234, in all\n    **query,\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunklib\binding.py", line 321, in wrapper\n    return request_fun(self, *args, **kwargs)\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunklib\binding.py", line 76, in new_f\n    val = f(*args, **kwargs)\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunklib\binding.py", line 737, in get\n    response = self.http.get(path, all_headers, **query)\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunklib\binding.py", line 1272, in get\n    return self.request(url, {'method': "GET", 'headers': headers})\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunklib\binding.py", line 1344, in request\n    raise HTTPError(response)\nsplunklib.binding.HTTPError: HTTP 404 Not Found -- b'{"messages":[{"type":"ERROR","text":"Not Found"}]}'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "C:\Program Files\Splunk\Python-3.7\lib\site-packages\splunk\admin.py", line 114, in init_persistent\n    hand.execute(info)\n  File "C:\Program Files\Splunk\Python-3.7\lib\site-packages\splunk\admin.py", line 639, in execute\n    if self.requestedAction == ACTION_LIST:     self.handleList(confInfo)\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunktaucclib\rest_handler\admin_external.py", line 63, in wrapper\n    for entity in result:\n  File "C:\Program Files\Splunk\etc\apps\demo_addon_for_splunk\lib\splunktaucclib\rest_handler\handler.py", line 185, in wrapper\n    raise RestError(exc.status, _parse_error_msg(exc))\nsplunktaucclib.rest_handler.error.RestError: REST Error [404]: Not Found -- Not Found\n

What UCC version are you using?

5.59.0

Additional System Info

Windows 10

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds investigationIssues that need investigation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions