action linux.service or linux.check_processes cannot be executed on remote host
docbyte86 opened this issue · 8 comments
SUMMARY
Get error "/opt/stackstorm/st2/bin/python: bad interpreter: No such file or directory" while using the corresponding actions.
The actions will be executed on a remote host and not on the stack storm controller.
On the remote host is stackstorm not installed and therefore the path does not exist.
The path exists on my stackstorm controller.
STACKSTORM VERSION
Paste the output of st2 --version
: st2 3.8.0, on Python 3.8.13
OS, environment, install method
Post what OS you are running this on, along with any other relevant information/
- Red Hat Enterprise Linux release 8.7 (Ootpa)
- Installed via Ansible Collection
Steps to reproduce the problem
Affected (tested) actions: linux.service and linux.check_processes
Error notification:
{
"***********": {
"stdout": "",
"stderr": "bash: /tmp/6479d198cc128630e940fb88/service.py: /opt/stackstorm/st2/bin/python: bad interpreter: No such file or directory",
"return_code": 126,
"succeeded": false,
"failed": true
}
}
Expected Results
Get status of the services in linux.services or status of the process in linux.check_processes.
Actual Results
See Error notification.
Further info/output:
st2 run linux.check_processes search=name username=****** hosts=****** criteria=****** ~
.
id: 6479d5c4cc128630e940fb91
action.ref: linux.check_processes
context.user: *****
parameters:
criteria: ******
hosts: *****
search: name
username: ******
status: failed
start_timestamp: Fri, 02 Jun 2023 11:42:59 UTC
end_timestamp: Fri, 02 Jun 2023 11:43:01 UTC
result:
******:
failed: true
return_code: 126
stderr: 'bash: /tmp/6479d5c4cc128630e940fb90/check_processes.py: /opt/stackstorm/st2/bin/python: bad interpreter: No such file or directory'
stdout: ''
succeeded: false
The actions in the Linux Pack
can only be executed on linux host with st2
installed. Is this by design?
The python interpreter was deliberately altered:
50f2774?diff=split
I don't know the reason.
That sounds like a bug. The intent I believe is to have the pack actions working remotely.
If you folks change the shebang python path in the script header, does the action work properly?
I modify shebang python path to #!/usr/bin/python3
, the result is ok. I think the problem is different linux distributions may have different python environments
That sounds like a bug. The intent I believe is to have the pack actions working remotely.
If you folks change the shebang python path in the script header, does the action work properly?
The python interpreter was deliberately altered:
I don't know the reason.
Why not switch back?
#!/usr/bin/env python3