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

action linux.service or linux.check_processes cannot be executed on remote host #5983

Closed
docbyte86 opened this issue Jun 2, 2023 · 8 comments · Fixed by #6042
Closed

action linux.service or linux.check_processes cannot be executed on remote host #5983

docbyte86 opened this issue Jun 2, 2023 · 8 comments · Fixed by #6042
Labels

Comments

@docbyte86
Copy link

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.

@docbyte86
Copy link
Author

docbyte86 commented Jun 2, 2023

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

@DesireWithin
Copy link

The actions in the Linux Pack can only be executed on linux host with st2 installed. Is this by design?

@DesireWithin
Copy link

The python interpreter was deliberately altered:
50f2774?diff=split
I don't know the reason.

@arm4b arm4b added the bug label Sep 5, 2023
@arm4b
Copy link
Member

arm4b commented Sep 5, 2023

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?

@DesireWithin
Copy link

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?

@ZoeLeah
Copy link
Contributor

ZoeLeah commented Sep 14, 2023

The python interpreter was deliberately altered:

50f2774?diff=split

I don't know the reason.

Why not switch back?

#!/usr/bin/env python3

@arm4b
Copy link
Member

arm4b commented Sep 15, 2023

Yep, please open a PR and it's worth checking if pack still works in CentOS8 per #5035.

@ZoeLeah
Copy link
Contributor

ZoeLeah commented Sep 16, 2023

@armab
Okay, I will test the changes next week and then create the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants