Bug 726121

Summary: Excessive writing to /var/log/messages
Product: Red Hat Enterprise Linux 6 Reporter: Michal Nowak <mnowak>
Component: abrtAssignee: Denys Vlasenko <dvlasenk>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: ahecox, ddumas, dvlasenk, gavin, jmoskovc, kklic, mnowak, npajkovs, ohudlick, rvokal, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: abrt-2.0.4-14.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 12:14:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 750914    
Attachments:
Description Flags
Proposed patch none

Description Michal Nowak 2011-07-27 15:22:14 UTC
Description of problem:

This is the log from abrt processing crash I have in /var/log/messages:

Jul 27 17:13:14 dhcp-25-35 abrt[918]: saved core dump of pid 913 (/usr/bin/gcalctool) to /var/spool/abrt/ccpp-2011-07-27-17:13:13-913.new/coredump (5079040 bytes)
Jul 27 17:13:14 dhcp-25-35 abrtd: Directory 'ccpp-2011-07-27-17:13:13-913' creation detected
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:15 dhcp-25-35 abrtd: sosreport (version 2.2)
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:15 dhcp-25-35 abrtd: This utility will collect some detailed  information about the
Jul 27 17:13:15 dhcp-25-35 abrtd: hardware and setup of your Red Hat Enterprise Linux system.
Jul 27 17:13:15 dhcp-25-35 abrtd: The information is collected and an archive is  packaged under
Jul 27 17:13:15 dhcp-25-35 abrtd: /tmp, which you can send to a support representative.
Jul 27 17:13:15 dhcp-25-35 abrtd: Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
Jul 27 17:13:15 dhcp-25-35 abrtd: and it will be considered confidential information.
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:15 dhcp-25-35 abrtd: This process may take a while to complete.
Jul 27 17:13:15 dhcp-25-35 abrtd: No changes will be made to your system.
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:15 dhcp-25-35 abrtd:   Running plugins. Please wait ...
Jul 27 17:13:15 dhcp-25-35 abrtd: 
Jul 27 17:13:20 dhcp-25-35 abrtd: #015  Completed [1/18] ...      #015  Completed [2/18] ...      #015  Completed [3/18] ...      #015  Completed [4/18] ...      #015  Completed [5/18] ...      #015  Completed [6/18] ...      #015  Completed [7/18] ...      #015  Completed [8/18] ...      #015  Completed [9/18] ...      #015  Completed [10/18] ...      #015  Completed [11/18] ...      #015  Completed [12/18] ...      #015  Completed [13/18] ...      #015  Completed [14/18] ...      #015  Completed [15/18] ...      #015  Completed [16/18] ...      #015  Completed [17/18] ...      #015  Completed [18/18] ...      
Jul 27 17:13:20 dhcp-25-35 abrtd: Creating compressed archive...
Jul 27 17:13:20 dhcp-25-35 abrtd: 
Jul 27 17:13:20 dhcp-25-35 abrtd: Your sosreport has been generated and saved in:
Jul 27 17:13:20 dhcp-25-35 abrtd:   /var/spool/abrt/ccpp-2011-07-27-17:13:13-913/sosreport-dhcp-25-35-20110727171320-1025.tar.xz
Jul 27 17:13:20 dhcp-25-35 abrtd: 
Jul 27 17:13:20 dhcp-25-35 abrtd: The md5sum is: 268b9d49e794d55cc2bd15cb06871025
Jul 27 17:13:20 dhcp-25-35 abrtd: 
Jul 27 17:13:20 dhcp-25-35 abrtd: Please send this file to your support representative.
Jul 27 17:13:20 dhcp-25-35 abrtd: 
Jul 27 17:13:20 dhcp-25-35 abrtd: Sending an email...
Jul 27 17:13:20 dhcp-25-35 abrtd: Email was sent to: root@localhost
Jul 27 17:13:21 dhcp-25-35 abrtd: Can't open file '/var/spool/abrt/ccpp-1310991931-5029/uuid': No such file or directory
Jul 27 17:13:21 dhcp-25-35 abrtd: New dump directory /var/spool/abrt/ccpp-2011-07-27-17:13:13-913, processing



I find it quite huge. The information from sosreport is mostly useless. And the "progress-bar" output is ugly indeed (I guess there's "no progress" option in sosreport).

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

abrt-2.0.4-1.el6.x86_64
libreport-2.0.5-1.el6.x86_64
btparser-0.13-1.el6.x86_64

Comment 2 Michal Nowak 2011-08-02 14:21:28 UTC
More on this

Jul 27 17:13:20 dhcp-25-35 abrtd: Your sosreport has been generated and saved in:
Jul 27 17:13:20 dhcp-25-35 abrtd: /var/spool/abrt/ccpp-2011-07-27-17:13:13-913 sosreport-dhcp-25-35-20110727171320-1025.tar.xz

is confusing since sosreport's tarball is (within abrt) always saved to $_PATH/sosreport.tar.xz.

Comment 3 Denys Vlasenko 2011-08-15 14:34:56 UTC
Does this happen when you uncomment this in abrt_event.conf?

# Example: if you want to save sosreport immediately at the moment of a crash:
# (alternatively, you can add similar command to EVENT=analyze_foo's,
# if you would rather perform this collection later):
#EVENT=post-create
        nice sosreport --tmp-dir "$DUMP_DIR" --batch \
                --only=anaconda --only=bootloader --only=devicemapper \
                --only=filesys --only=hardware --only=kernel --only=libraries \
                --only=memory --only=networking --only=nfsserver --only=pam \
                --only=process --only=rpm -k rpm.rpmva=off --only=ssh \
                --only=startup --only=yum --only=general --only=x11 \
        && {
                rm sosreport*.md5
                mv sosreport*.tar.bz2 sosreport.tar.bz2
                mv sosreport*.tar.xz sosreport.tar.xz
                true
        } 2>/dev/null

Comment 4 Denys Vlasenko 2011-08-15 14:48:55 UTC
If yes, try this instead:

EVENT=post-create
        nice sosreport --tmp-dir "$DUMP_DIR" --batch \
                --only=anaconda --only=bootloader --only=devicemapper \
                --only=filesys --only=hardware --only=kernel --only=libraries \
                --only=memory --only=networking --only=nfsserver --only=pam \
                --only=process --only=rpm -k rpm.rpmva=off --only=ssh \
                --only=startup --only=yum --only=general --only=x11 \
                >sosreport.log 2>&1
        && {
                rm sosreport.log
                rm sosreport*.md5
                mv sosreport*.tar.bz2 sosreport.tar.bz2
                mv sosreport*.tar.xz sosreport.tar.xz
                exit 0
        } 2>/dev/null
        # Error in sosreport run. Let user see the problem.
        echo "sosreport run failed, log follows:"
        # sosreport prints many useless empty lines, nuke them:
        # it looks awful in syslog otherwise.
        cat sosreport.log | sed 's/  *$//' | grep -v '^$'
        rm sosreport.log
        exit 1

Comment 5 Michal Nowak 2011-08-15 15:19:21 UTC
(In reply to comment #4)
> If yes, try this instead:
> 
> EVENT=post-create
>         nice sosreport --tmp-dir "$DUMP_DIR" --batch \
[...]
>                 >sosreport.log 2>&1
[...]

Don't forget to add '\' at the end of the line, otherwise it fails with:

Aug 15 17:04:30 dhcp-25-35 abrtd: /bin/sh: -c: line 7: syntax error near unexpected token `&&'
Aug 15 17:04:30 dhcp-25-35 abrtd: /bin/sh: -c: line 7: `        && {'


Second problem is that, when I kill `sosreport' it spits the sosreport.log but each line is there twice:

Aug 15 17:12:12 dhcp-25-35 abrt[16887]: saved core dump of pid 16886 (/bin/sleep) to /var/spool/abrt/ccpp-2011-08-15-17:12:11-16886.new/coredump (319488 bytes)
Aug 15 17:12:12 dhcp-25-35 abrtd: Directory 'ccpp-2011-08-15-17:12:11-16886' creation detected
Aug 15 17:12:13 dhcp-25-35 abrtd: /bin/sh: line 13: 16895 Killed                  nice sosreport --tmp-dir "$DUMP_DIR" --batch --only=anaconda --only=bootloader --only=devicemapper --only=filesys --only=hardware --only=kernel --only=libraries --only=memory --only=networking --only=nfsserver --only=pam --only=process --only=rpm -k rpm.rpmva=off --only=ssh --only=startup --only=yum --only=general --only=x11 > sosreport.log 2>&1
Aug 15 17:12:13 dhcp-25-35 abrtd: sosreport run failed, log follows:
Aug 15 17:12:13 dhcp-25-35 abrtd: sosreport (version 2.2)
Aug 15 17:12:13 dhcp-25-35 abrtd: This utility will collect some detailed  information about the
Aug 15 17:12:13 dhcp-25-35 abrtd: This utility will collect some detailed  information about the
Aug 15 17:12:13 dhcp-25-35 abrtd: hardware and setup of your Red Hat Enterprise Linux system.
Aug 15 17:12:13 dhcp-25-35 abrtd: The information is collected and an archive is  packaged under
Aug 15 17:12:13 dhcp-25-35 abrtd: The information is collected and an archive is  packaged under
Aug 15 17:12:13 dhcp-25-35 abrtd: /tmp, which you can send to a support representative.
Aug 15 17:12:13 dhcp-25-35 abrtd: /tmp, which you can send to a support representative.
Aug 15 17:12:13 dhcp-25-35 abrtd: Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
Aug 15 17:12:13 dhcp-25-35 abrtd: and it will be considered confidential information.
Aug 15 17:12:13 dhcp-25-35 abrtd: This process may take a while to complete.
Aug 15 17:12:13 dhcp-25-35 abrtd: This process may take a while to complete.
Aug 15 17:12:13 dhcp-25-35 abrtd: No changes will be made to your system.
Aug 15 17:12:13 dhcp-25-35 abrtd:   Running plugins. Please wait ...
Aug 15 17:12:13 dhcp-25-35 abrtd: #015  Completed [1/18] ...      #015  Completed [2/18] ...      #015  Completed [3/18] ...
Aug 15 17:12:13 dhcp-25-35 abrtd:   Running plugins. Please wait ...
Aug 15 17:12:13 dhcp-25-35 abrtd: #015  Completed [1/18] ...      #015  Completed [2/18] ...      #015  Completed [3/18] ...
Aug 15 17:12:13 dhcp-25-35 abrtd: Corrupted or bad dump /var/spool/abrt/ccpp-2011-08-15-17:12:11-16886 (res:2), deleting


Not sure why is that so.



As a small RFE: since sosreport run may take a while, I'd ask you to echo that sosreport is being started, e.g.:

EVENT=post-create
        echo "Starting sosreport..."
        nice sosreport --tmp-dir "$DUMP_DIR" --batch \

Comment 6 Denys Vlasenko 2011-08-15 15:33:32 UTC
Should be 
       >sosreport.log 2>&1 \

(a slash should be added at the end of that line).

Comment 7 Denys Vlasenko 2011-08-15 15:35:59 UTC
Are these lines duplicated in sosreport.log, or only in the syslog?

Comment 8 Michal Nowak 2011-08-15 15:45:04 UTC
(In reply to comment #7)
> Are these lines duplicated in sosreport.log, or only in the syslog?

I had `tailf' on /var/log/messages, so syslog. When I backup sosreport.log by that hook to /tmp I can see it's OK -- no double lines.

Comment 9 Denys Vlasenko 2011-08-26 11:52:54 UTC
Can't reproduce it. I uncommented sosreport event in abrt_event.conf and amde it artificially "fail" by adding a line with "false" cmd here:

                >sosreport.log 2>&1 \
                && false \
        && {
                rm sosreport.log

and my syslog looks like this:

abrtd: sosreport run failed with exit code 1, log follows:
abrtd: sosreport (version 2.1)
abrtd: This utility will collect some detailed  information about the
abrtd: hardware and setup of your Fedora system.
abrtd: The information is collected and an archive is  packaged under
abrtd: /tmp, which you can send to a support representative.
abrtd: Fedora will use this information for diagnostic purposes ONLY
abrtd: and it will be considered confidential information.
abrtd: This process may take a while to complete.
abrtd: No changes will be made to your system.
abrtd:   Running plugins. Please wait ...
abrtd: ^M  Completed [1/18] ...      ^M  Completed [2/18] ...      ^M  Completed [3/18] ...      ^M  Completed [4/18] ...      ^M  Completed [5/18] ...      ^M  Completed [6/
abrtd: Creating compressed archive...
abrtd: Your sosreport has been generated and saved in:
abrtd:   /var/spool/abrt/ccpp-2011-08-26-13:42:52-21543/sosreport-dhcp-25-63-20110826134256-697c.tar.xz
abrtd: The md5sum is: dfce63c777d3194e4bad2c24bc65697c
abrtd: Please send this file to your support representative.
abrtd: Corrupted or bad dump /var/spool/abrt/ccpp-2011-08-26-13:42:52-21543 (res:2), deleting
abrtd: Directory 'ccpp-2011-08-26-13:42:52-21563' creation detected

IOW: no duplicate lines.


One theory I have is that you killed sosreport via "killall sosreport", but you might have _two_ sosreports running, they got killed simultaneously, and got their log lines interspersed in syslog. This might explain what you see, but it's not very likely...

Michal, if you are able to reliably reproduce this, ping me on IRC and we can debug it in real time.

Comment 10 Michal Nowak 2011-09-06 08:13:12 UTC
Unable to reproduce. Core issue should be fixed. Thanks. Add it to erratum, please.

Comment 14 Denys Vlasenko 2011-10-14 15:02:09 UTC
Created attachment 528221 [details]
Proposed patch

Indeed, this fix didn't make it to RHEL6 build.
See attached patch with the fix.

Comment 15 Michal Nowak 2011-10-17 12:56:04 UTC
Yeah, that's the patch we are interested in.

Comment 16 Denys Vlasenko 2011-10-18 15:48:19 UTC
Applied to git rhel6 branch:

commit 3f6e9a1161fd2fa21a6018bd617fb0c9d2957926
Author: Denys Vlasenko <dvlasenk>
Date:   Tue Oct 18 17:47:14 2011 +0200

    Fix sosreport example to not emit gobs of output

Comment 23 errata-xmlrpc 2011-12-06 12:14:28 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.

http://rhn.redhat.com/errata/RHBA-2011-1598.html