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.

Bug 2119536

Summary: Standard REX commands fail with the error 'Unmatched '"'.' if the login shell of the SSH user is /usr/bin/csh on the target system
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Remote ExecutionAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.11.1CC: aruzicka, pdwyer, smajumda
Target Milestone: UnspecifiedKeywords: MigratedToJIRA, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-06 12:26:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sayan Das 2022-08-18 18:08:25 UTC
Description of problem:

Standard REX commands fail with the error 'Unmatched '"'.' if the login shell of the SSH user is /usr/bin/csh on the target system


Version-Release number of selected component (if applicable):

Satellite 6.10.7
Satellite 6.11.1.1-1

How reproducible:

Always


Steps to Reproduce:

1. Install the affected version of satellite

2. Enable + sync some basic repos

3. Register a RHEL 8 system with satellite

4. Follow https://access.redhat.com/solutions/2650071 to setup REX via non-root user called rexuser

5. In Satellite settings:
   Effective user: root
   SSH user: rexuser

6. Run "uptime" command on the host using the "Commands" job category and ensure that the SSH happened to ansible user and then the command was executed. 


7. Go to target system and 

   Instal;l tcsh package

   Become rexuser user

   Use chsh to set the /usr/bin/csh as the default login shell for rexuser user


8. COme back to satellite and re-run the same uptime job on the host.

9. Again re-run the same job using "Ansible Commands" job category 


Actual results:


Step 6: Success

Step 8: Error 

###
  1:
Unmatched '"'.
   2:
Unmatched '"'.
   3:
Exit status: 1
###

Step 9: Success



Expected results:


The Default REX should be able to work with csh shell as well similar to how Ansible-based REX can.  


Additional info:

I tested with zsh as well and I don't see this behavior. It's only with csh.

Comment 1 Adam Ruzicka 2022-08-19 09:45:17 UTC
Yes, csh has its own syntax which is sufficiently different from what other shells (sh/bash/ash/dash/zsh) use to cause problems. You would run into a similar sort of issues if you used fish shell.

Is there a reason why a user dedicated to remote execution has to use this somewhat exotic shell?

Comment 2 Sayan Das 2022-08-19 09:58:39 UTC
Hello Adam,

No idea. Because there was an escalation raised on the support case just because of this issue and No one was able to identify it initially, I had to raise the BZ.

The user gladly changed the shell when I pointed out the issue to the case engineer. So I would assume the csh shell was not a dependency for the user.

But my testing shows that Ansible-based REX worked just fine, not the REX that uses the SSH rubygem . Perhaps the error can be improved a bit rather than saying "Unmatched '"'." which basically is not at all helpful.



-- Sayan

Comment 3 Adam Ruzicka 2023-06-14 11:57:32 UTC
It is slightly better on stream. Running `id` as a user with csh set as shell the job still fails, but slightly differently

1: uid=1000(rex) gid=1000(rex) groups=1000(rex) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
2: Illegal variable name.
3: »Exit status: 1«
4: StandardError: »Job execution failed«

Comment 7 Eric Helms 2024-06-06 12:26:05 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.