Bug 1438257

Summary: [regression] commands with return code 1 not further collected
Product: Red Hat Enterprise Linux 7 Reporter: Pavel Moravec <pmoravec>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: medium Docs Contact:
Priority: high    
Version: 7.4CC: agk, bmr, gavin, mhradile, plambri, sbradley
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://github.com/sosreport/sos/issues/986
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 23:10: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: 1443506    

Description Pavel Moravec 2017-04-02 13:23:44 UTC
Description of problem:

rpm -Va is not further collected, in case it detects something( * ). The regression is introduced by reasonable upstream commit 77eb4ab and the fact that rpm -Va returns 1 if it reports something(*):

# rpm -Va 2>&1 > rpm.va
# echo $?
1
# wc rpm.va
  1546   3166 130196 rpm.va
# 

(*) "something" - I would expect rpm -V to return 0 regardless whatever it detects, until something is seriously broken (i.e. its database). It is possible it returns nonzero on some types of verify checks only, but that command "failed" the same way on multiple systems. And practically any system has something changed from installed packages (like config files).

As is, I would see it as rpm bug but impacting primarily sos.


Version-Release number of selected component (if applicable):
sos-3.4-1.el7.noarch


How reproducible:
100%


Steps to Reproduce:
1. Have a system with more changes from installed packages (but I guess almost any system can be used). Ensure "rpm -Va" is completed within 180seconds (to prevent command timeout in sos)
2. sosreport --only-plugins rpm -k rpm.rpmva -vv --batch
3. check if resulted tarball contains file sos_commands/rpm/rpm-Va


Actual results:
No such file collected


Expected results:
The file shall be collected.


Additional info:

Comment 2 Bryn M. Reeves 2017-04-19 13:58:38 UTC
This is a much more serious regression than the title implies: this affects all commands that return a non-zero status but still produce output (it turns out there are a lot of them).

This change was made to address a problem in a single plugin: it's safer at this point to undo this and to deal with the problem in that plugin instead.

Comment 5 errata-xmlrpc 2017-08-01 23:10: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/RHBA-2017:2203