Bug 893570

Summary: sos generates broken tarballs when no data is collected
Product: Red Hat Enterprise Linux 6 Reporter: Bryn M. Reeves <bmr>
Component: sosAssignee: Bryn M. Reeves <bmr>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: low    
Version: 6.4CC: agk, bmr, dkutalek, gavin, sos-team
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-22 17:08:53 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: 906066    

Description Bryn M. Reeves 2013-01-09 13:35:38 UTC
Description of problem:
When no module collects command or file data the generated tarball is a bit strange:

# tar xf sosreport-rhn-support-bmr-20130109133156-ce9c.tar.xz
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

It _is_ a valid tar archive:

# unxz sosreport-rhn-support-bmr-20130109133156-ce9c.tar.xz
# file sosreport-rhn-support-bmr-20130109133156-ce9c.tar
sosreport-rhn-support-bmr-20130109133156-ce9c.tar: POSIX tar archive (GNU)


Version-Release number of selected component (if applicable):
2.2-*.el6

How reproducible:
100% with an affected module

Steps to Reproduce:
1. Create a "null" plugin that does nothing in setup()
2. Run sosreport with -o null
3. Check generated tarball with tar xf
  
Actual results:
# tar xf sosreport-rhn-support-bmr-20130109133156-ce9c.tar.xz
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

Expected results:
<tarball unpacks>

Additional info:
Found during testing of the Postgres module (bug 852049) but not related to those changes.

This also seems to relate to a strange effect where we collect some SELinux information even when no modules are enabled. I noticed this some time ago but it's never been a high priority since it does not actually break anything.

Comment 4 Bryn M. Reeves 2013-07-25 14:24:50 UTC
Still had no time to track this down properly. It's also very low prio.

Comment 6 Bryn M. Reeves 2014-01-22 14:46:59 UTC
I can reproduce this with straight GNU tar/xz; it's straightforward to reproduce even with a single dir/file:

# mkdir foo
# touch foo/bar
# tar cf foo.tar foo
# tar tf foo.tar 
foo/
foo/bar
# xz foo.tar
# file foo.tar.xz 
foo.tar.xz: xz compressed data
# tar tf foo.tar.xz
tar: This does not look like a tar archive
foo/
foo/bar
tar: Exiting with failure status due to previous errors

I'm still not clear on the exact conditions needed to trigger the behaviour though.

Comment 7 Bryn M. Reeves 2014-01-22 17:08:53 UTC
This turns out to be a problem in GNU tar (that was fixed upstream in 2010 just after RHEL6's 1.23 came out). I've filed bug 1056672 to get this included in RHEL.