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.

Bug 1608384

Summary: sosreport does not sanitize all parts of an archive name causing errors
Product: Red Hat Enterprise Linux 7 Reporter: Miroslav Hradílek <mhradile>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: agk, bmr, gavin, plambri, sbradley
Target Milestone: rc   
Target Release: 7.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-3.6-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1614956 (view as bug list) Environment:
Last Closed: 2018-10-30 10:33:42 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:
Bug Depends On:    
Bug Blocks: 1614956    

Description Miroslav Hradílek 2018-07-25 12:26:38 UTC
Description of problem:
In the past there was a function sanitizing the whole archive name that caused all characters like ' ' or '_' to be removed from archive name.
In the new release the method disappeared with the addition of new archivename format which causes sosreport to result in errors and wrongly named archive especially when --name ' ' is used.

Version-Release number of selected component (if applicable):
Unreleased! sos-3.6-3.el7.noarch

How reproducible:
100%

Steps to Reproduce:
sosreport -o filesys --batch --name 'lol rofl' --ticket-number 1234

Actual results:
sosreport (version 3.6)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

An archive containing the collected information will be generated in
/var/tmp/sos.0vWzWu and may be provided to a Red Hat support
representative.

Any information provided to Red Hat will be treated in accordance with
the published support policies at:

  https://access.redhat.com/support/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.


 Setting up archive ...
 Setting up plugins ...
 Running plugins. Please wait ...

  Starting 1/1   filesys         [Running: filesys]

  Finished running plugins

Creating compressed archive...
[archive:TarFileArchive] xz: /var/tmp/sos.0vWzWu/sosreport-sheep-7-lol: No such file or directory
xz: rofl-1234-2018-07-25-bhifiet.tar: No such file or directory

[archive:TarFileArchive] bzip2: Can't open input file /var/tmp/sos.0vWzWu/sosreport-sheep-7-lol: No such file or directory.
bzip2: Can't open input file rofl-1234-2018-07-25-bhifiet.tar: No such file or directory.

[archive:TarFileArchive] gzip: /var/tmp/sos.0vWzWu/sosreport-sheep-7-lol: No such file or directory
gzip: rofl-1234-2018-07-25-bhifiet.tar: No such file or directory

[archive:TarFileArchive] An error occurred compressing the archive:  gzip /var/tmp/sos.0vWzWu/sosreport-sheep-7-lol rofl-1234-2018-07-25-bhifiet.tar exited with 1

Your sosreport has been generated and saved in:
  /var/tmp/sosreport-sheep-7-lol rofl-1234-2018-07-25-bhifiet.tar

The checksum is: ddee5969dd55c7893e5e171adf1e5f97

Please send this file to your support representative.


Expected results:
. . .
Your sosreport has been generated and saved in:
  /var/tmp/sosreport-sheep-7-lolrofl-1234-2018-07-25-bhifiet.tar

The checksum is: ddee5969dd55c7893e5e171adf1e5f97

Please send this file to your support representative.

Comment 2 Pavel Moravec 2018-07-25 12:33:40 UTC
https://github.com/sosreport/sos/commit/333918cba972db00d524074491593a2b080a153c and removal of sanitize_report_name method/calling in particular seems to be responsible.

Comment 6 errata-xmlrpc 2018-10-30 10:33:42 UTC
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, 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/RHEA-2018:3144