Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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.
This happens to any sos-4.* version I tried:
# sos report -o qpid --upload --case-id 02732787
..
..
Your sosreport has been generated and saved in:
/var/tmp/sosreport-pmoravec-rhel8-02732787-2023-01-18-wwyaytq.tar.xz
Size 4.10KiB
Owner root
sha256 7176170d965de5c3192b3f13ba55c1bfb4da215d4cebed9a8281c956e07bb108
Please send this file to your support representative.
Attempting upload to Red Hat Customer Portal
Upload to Red Hat Customer Portal failed. Trying sftp://sftp.access.redhat.com
Attempting upload to Red Hat Secure FTP
User 'OBFUSCATED'used for anonymous upload. Please inform your support engineer so they may retrieve the data.
Uploaded archive successfully
#
Here, sos in interactive mode (no --batch option used) properly attempts to upload the tarball to Red Hat Customer Portal, BUT forgets to ask for credentials. Empty credentials dont work, so it fails over to SFTP - where again no credentials are silently assumed.
So, the fix should be "when not using batch mode, and when credentials are not set, query for them before any upload".
I am going to check the code for this.
I think this should be a fix:
--- a/sos/policies/distros/__init__.py
+++ b/sos/policies/distros/__init__.py
@@ -296,6 +296,15 @@ class LinuxPolicy(Policy):
_("Optionally, please enter the case id that you are "
"generating this report for [%s]: ") % caseid
)
+ except KeyboardInterrupt:
+ self._print()
+ raise
+ if cmdline_opts.case_id:
+ self.case_id = cmdline_opts.case_id
+
+ if not cmdline_opts.batch and not \
+ cmdline_opts.quiet:
+ try:
# Policies will need to handle the prompts for user information
if cmdline_opts.upload and self.get_upload_url():
self.prompt_for_upload_user()
@@ -305,9 +314,6 @@ class LinuxPolicy(Policy):
self._print()
raise
- if cmdline_opts.case_id:
- self.case_id = cmdline_opts.case_id
-
return
def prompt_for_upload_user(self):
As this causes https://github.com/sosreport/sos/blob/main/sos/policies/distros/redhat.py#L269 will be properly evaluated with self.case_id filled.
I will review it tomorrow..