Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: input helper not found #1217

Closed
Benni0 opened this issue May 29, 2024 · 5 comments
Closed

BUG: input helper not found #1217

Benni0 opened this issue May 29, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Benni0
Copy link

Benni0 commented May 29, 2024

Description

I've created an input with the inputHelperModule attribute. During build process, both files were created, the input.py and the input_helper.py. But during Splunk startup the input.py were unable to find the input_helper module.

05-29-2024 22:53:43.929 +0200 ERROR ModularInputs [0000 MainThread] - <stderr> Introspecting scheme=input:  Traceback (most recent call last):
05-29-2024 22:53:43.929 +0200 ERROR ModularInputs [0000 MainThread] - <stderr> Introspecting scheme=input:    File "/opt/splunk/etc/apps/TA_app/bin/input.py", line 6, in <module>
05-29-2024 22:53:43.929 +0200 ERROR ModularInputs [0000 MainThread] - <stderr> Introspecting scheme=input:      from intput_helper import stream_events, validate_input
05-29-2024 22:53:43.929 +0200 ERROR ModularInputs [0000 MainThread] - <stderr> Introspecting scheme=input:  ModuleNotFoundError: No module named 'input_helper'
05-29-2024 22:53:43.929 +0200 ERROR ModularInputs [0000 MainThread] - Introspecting scheme=input: script running failed (PID 0000 with code 1).
05-29-2024 22:53:43.930 +0200 ERROR ModularInputs [0000 MainThread] - Unable to initialize modular input "input" defined in the app "TA_app": Introspecting scheme=input: script running failed (PID 0000 exited with code 1)

It seems import_declare_test.py is missing the current bin path.
If I add the current files path in import_declare_test.py, it works.

What UCC version are you using?

5.45.0

Additional System Info

Linux

@Benni0 Benni0 added bug Something isn't working triage Pending triage from maintainers labels May 29, 2024
@artemrys
Copy link
Member

Thanks @Benni0 for reporting it, I believe this bug should have been introduced with the last release. I'll reproduce it tomorrow and prepare a quick fix for this issue.

@artemrys artemrys self-assigned this May 29, 2024
@artemrys artemrys removed the triage Pending triage from maintainers label May 29, 2024
@artemrys
Copy link
Member

@Benni0 I just tried to reproduce the issue, I run the following commands:

ucc-gen init --addon-name test_addon --addon-rest-root test_addon --addon-display-name TestAddon2 --addon-input-name test_input_name_two
ucc-gen build --source test_addon/package
ucc-gen package --path output/test_addon

Then I installed this TA and it works in my Splunk instance.

Can you please provide the commands you run so I can reproduce it locally?

@Benni0
Copy link
Author

Benni0 commented May 31, 2024

@artemrys, sure if you don't modify the your globalConfig.json, the input doesn't use an inputHelperModule. In this case it works. But if you add an inputHelperModule to the input, you should get his error and an HTTP Error will be shown on the Inputs page in the App.
I should have mentioned this in the description - sorry.

@kkedziak-splunk
Copy link
Contributor

@Benni0 could you send us your package? I cannot reproduce the error. import_declare_test.py adds TA_app/bin and TA_app/lib to path so this should work.

Also, I see that your logs contain discrepancies.
Line 3: inTput_helper
Line 4: input_helper

What is the input name?

@Benni0
Copy link
Author

Benni0 commented Jun 4, 2024

@kkedziak-splunk sorry, the I added the typo as I cleaned the logs.

I've checked the problem another time and found my issue. I had modified the nameattribute in globalConfig.json but not the name in app.manifest, which caused that the app folder name differs from ta_name variable in import_declare_test.py. Due to this, the apps bin folder was not added to the path and the input helper was not found.

Sorry for the inconvenience.

@Benni0 Benni0 closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants