Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionJoniel Pasqualetto
2022-01-31 13:45:01 UTC
Description of problem:
- Have option async_ssh set to true
- Have /var/tmp mounted with option noexec on clients
- Try to run any remote execution job will result in the job stuck on "running" forever.
- Looking at the target server logs, we can see repeatedly connections calling the retrieve.sh:
~~~
Jan 31 08:09:50 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:10:50 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:11:51 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:12:51 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:13:52 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:14:52 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:15:52 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:16:53 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:17:53 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:18:54 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:19:54 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:20:55 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:21:55 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:22:55 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:23:56 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:24:56 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:25:57 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:26:57 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
Jan 31 08:27:58 nodename sudo: rex : TTY=unknown ; PWD=/home/rex ; USER=root ; COMMAND=/var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
~~~
- Running the script manually, we can see that it never runs due to noexec:
~~~
# /var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh
-bash: /var/tmp/foreman-ssh-cmd-c5227fef-dd73-4ee9-b6cf-6be9226e0191/retrieve.sh: Permission denied
~~~
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Configure foreman-proxy to use async_ssh
~~~
# grep async /etc/foreman-proxy/settings.d/remote_execution_ssh.yml
# Whether to run remote execution jobs asynchronously
:async_ssh: true
~~~
2. Have a client configured with its remote_working_dir (/var/tmp by default) in a mountpoint with "noexec"
~~~
# mount |grep /var/tmp
tmpfs on /var/tmp type tmpfs (rw,noexec,relatime,seclabel,size=524288k)
~~~
3. Launch any command to be executed with remote execution.
Actual results:
Job is initiated, but never ends. Doesn't return any errors either.
Expected results:
It should return an error, because the script is not being executed at all.
Additional info:
When using async_false, the jobs fails and returns the permission denied returned by the script execution.
Comment 2Joniel Pasqualetto
2022-01-31 13:56:43 UTC
Agreed, but that's not the problem I'm reporting.
The problem is that if someone does that, the rex execution don't fail. It should fail, like it does when the async_ssh is false.
Verified on Satellite 6.12 sn 13, the rex job now fails with: "Error initializing command: RuntimeError - Failed to execute script on remote machine, exit code: 126" in described circumstances (async-ssh). The same goes for ssh provider, pull-mqtt still hangs but that is expected and tracked in https://bugzilla.redhat.com/show_bug.cgi?id=2118651
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2022:8506