This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

(action file most likely doesn't exist or contains invalid syntax): No module named cx_Oracle

Hi all, pretty new to stackstorm, I was making a custom pack on stackstorm for a oracle use case in stackstorm, tried all sought of things but no luck.
Pack is been made just during execution getting an error for this.

st2 execution get 5f5904b5e6db36c03ea812db

id: 5f5904b5e6db36c03ea812db
action.ref: oracle_test.Oracledbcheck
context.user: st2admin
parameters:
DBName: ****
Hostname: ****
Password: *****
Port: ‘1526’
ServiceName:****
Username:*****
log_level: DEBUG
status: failed (1s elapsed)
start_timestamp: Wed, 09 Sep 2020 16:37:08 UTC
end_timestamp: Wed, 09 Sep 2020 16:37:09 UTC
result:
exit_code: 1
result: None
stderr: "Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py”, line 333, in
obj.run()
File “/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py”, line 191, in run
action = self._get_action_instance()
File “/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py”, line 244, in _get_action_instance
raise exc_cls(msg)
ImportError: Failed to load action class from file “/opt/stackstorm/packs/oracle_test/actions/Oracledbcheck.py” (action file most likely doesn’t exist or contains invalid syntax): No module named cx_Oracle

Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python2.7/site-packages/python_runner/python_action_wrapper.py”, line 237, in _get_action_instance
actions_cls = action_loader.register_plugin(Action, self._file_path)
File “/opt/stackstorm/st2/lib/python2.7/site-packages/st2common/util/loader.py”, line 167, in register_plugin
module = imp.load_source(module_name, plugin_abs_file_path)
File “/opt/stackstorm/packs/oracle_test/actions/Oracledbcheck.py”, line 3, in
import cx_Oracle
ImportError: No module named cx_Oracle

it has the cx_oracle installed on the machine.
Most likely seems stackstorm isn’t picking it up.

Any suggestion???

Packs run in their own Python Virtual Environment. They do not use system installed Python modules, which means you will need to install your Python module dependencies as part of the pack installation. Dependencies can be declared in the packs requirements.txt file. For example, here is the consul pack dependencies: stackstorm-consul/requirements.txt at master · StackStorm-Exchange/stackstorm-consul · GitHub

I have the same issue.
I already specify the required fabric>=2.0 in requirements.txt of Linux pack.
I setup virtualenv by packs.setup_virtualenv. And the packs does exist under the path/opt/stackstorm/virtualenvs/linux/lib/python3.6/site-packages/
I’m using st2 3.4.1, on Python 3.6.8
What should we do next?

I Fix my issue by develop a new pack