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 1250200

Summary: gunziped message log is tailed
Product: Red Hat Enterprise Linux 7 Reporter: Jack Waterworth <jwaterwo>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Jakub Heger <jheger>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.1CC: agk, bmr, bubrown, cww, dkutalek, gavin, jheger, jhouska, mhradile, pcaruana, plambri, sbradley
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://github.com/sosreport/sos/issues/907
Whiteboard:
Fixed In Version: sos-3.5-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:00:19 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: 1203710, 1295396, 1298112, 1420851, 1464262, 1473612    

Description Jack Waterworth 2015-08-04 17:53:18 UTC
Description of problem:
sosreport from customer contains a gunzip file that has been tailed.

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

sos-3.2-15.el7_1.5.noarch
Red Hat Enterprise Linux Server release 7.1 (Maipo)

How reproducible:
unknown

Steps to Reproduce:
1. run sosreport

Actual results:

--------------------
$ ll var/log/messages*
-rwxrwxrwx 1 jwaterwo jwaterwo      733 Jul 22 10:51 var/log/messages
-rwxrwxrwx 1 jwaterwo jwaterwo 16058057 Apr 19 02:17 var/log/messages-20150419
-rwxrwxrwx 1 jwaterwo jwaterwo 60401880 Apr 27 02:40 var/log/messages-20150427
-rwxrwxrwx 1 jwaterwo jwaterwo 42692864 May  3 02:19 var/log/messages-20150503
lrwxrwxrwx 1 jwaterwo jwaterwo       58 May 10 02:30 var/log/messages-20150510.gz -> ../../sos_strings/logs/var.log.messages-20150510.gz.tailed
--------------------
$ file sos_strings/logs/var.log.messages-20150510.gz.tailed 
sos_strings/logs/var.log.messages-20150510.gz.tailed: empty
--------------------


Expected results:
file should either be gunzipped then tailed, or not tailed at all

Comment 2 Pavel Moravec 2015-08-05 07:28:21 UTC
Reproducer:

1) Create bigger logfile (content doesnt matter):

# ll /var/log/messages-20150701.gz
-rw-r--r--. 1 root root 2825972 Aug  5 09:17 /var/log/messages-20150701.gz
#

2) 
sosreport -o logs -e logs --batch --log-size=1 --build
..
sosreport build tree is located at : /var/tmp/sosreport-pmoravec-sat61-rhel7.gsslab.brq.redhat.com-20150805091835
..

3)
# cd /var/tmp/sosreport-pmoravec-sat61-rhel7.gsslab.brq.redhat.com-20150805091835
# file var/log/messages-20150701.gz
var/log/messages-20150701.gz: symbolic link to `../../sos_strings/logs/var.log.messages-20150701.gz.tailed'
# file sos_strings/logs/var.log.messages-20150701.gz.tailed
sos_strings/logs/var.log.messages-20150701.gz.tailed: empty

4) sos_logs/sos.log having:

2015-08-05 09:18:35,271 INFO: [plugin:logs] collecting string '...^CP^H^NnJ B^@^N^D^UOA)'5.WJ^E"' as 'var.log.messages-20150701.gz.tailed'

Comment 4 Pavel Moravec 2015-11-04 07:11:25 UTC
Scope of RHEL7.2 is closed. Re-scheduling to RHEL7.3.

Comment 6 Pavel Moravec 2016-12-28 13:04:14 UTC
This is works different in sos 3.3. At least I can reproduce on sos-3.2-35.el7_2.3.noarch but differently on sos-3.3-5.el7_3.noarch :

# rpm -qa | grep sos
sos-3.2-35.el7_2.3.noarch
# sosreport -o logs -e logs --batch --log-size=1 --build
..
# file /var/tmp/$(ls -tr /var/tmp/ | grep sosreport | tail -n1)/sos_strings/logs/var.log.messages-20161212.gz.tailed 
/var/tmp/sosreport-pmoravec-rhel72.gsslab.brq.redhat.com-20161228135738/sos_strings/logs/var.log.messages-20161212.gz.tailed: empty
#
#
# yum upgrade sos -y
..
Updated:
  sos.noarch 0:3.3-5.el7_3                                                                                                                                                                    

Complete!
# sosreport -o logs -e logs --batch --log-size=1 --build
..
# file /var/tmp/$(ls -tr /var/tmp/ | grep sosreport | tail -n1)/sos_strings/logs/var.log.messages-20161212.gz.tailed 
/var/tmp/sosreport-pmoravec-rhel72.gsslab.brq.redhat.com-20161228135851/sos_strings/logs/var.log.messages-20161212.gz.tailed: data
# zcat /var/tmp/sosreport-pmoravec-rhel72.gsslab.brq.redhat.com-20161228135851/sos_strings/logs/var.log.messages-20161212.gz.tailed

gzip: /var/tmp/sosreport-pmoravec-rhel72.gsslab.brq.redhat.com-20161228135851/sos_strings/logs/var.log.messages-20161212.gz.tailed: not in gzip format
#



I.e. originally we were collecting empty file. Now we collect tail of gz file, i.e. damaged archive.

Comment 8 Pavel Moravec 2017-11-02 15:14:50 UTC
Fixed via sos 3.5 rebase.

Comment 15 errata-xmlrpc 2018-04-10 18:00:19 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:0963