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 1519267

Summary: tracebacks in etcd and haproxy plugins
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.5CC: agk, bmr, bperkins, gavin, lmiksik, plambri, salmy, sbradley
Target Milestone: betaKeywords: Regression
Target Release: 7.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-3.5-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:05:49 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:

Description Miroslav Hradílek 2017-11-30 14:10:14 UTC
Description of problem:
Plugins when run manually should not end with traceback. Instead they should collect what they can and end. In current build of sosreport haproxy and etcd plugins fail to run because of missing packages and files they are trying to collect.

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

How reproducible:
100%

Steps to Reproduce:
1. sosreport --batch --all-logs -a  --debug -o etcd -e etcd
2. sosreport --batch --all-logs -a  --debug -o haproxy -e haproxy

Actual results:
# sosreport --batch --all-logs -a  --debug -o etcd -e etcd
. . .
 Setting up archive ...
 Setting up plugins ...
Traceback (most recent call last):
  File "/usr/sbin/sosreport", line 25, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1634, in main
    sos.execute()
KeyError: 'etcd'

> /usr/lib/python2.7/site-packages/sos/plugins/etcd.py(64)get_etcd_url()
-> ver = self.policy().package_manager.get_pkg_list()['etcd']
(Pdb)


# sosreport --batch --all-logs -a  --debug -o haproxy -e haproxy
. . .
 Setting up archive ...
 Setting up plugins ...
Traceback (most recent call last):
  File "/usr/sbin/sosreport", line 25, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1634, in main
    sos.execute()
IOError: [Errno 2] No such file or directory: '/etc/haproxy/haproxy.cfg'

> /usr/lib/python2.7/site-packages/sos/plugins/haproxy.py(48)setup()
-> for line in open("/etc/haproxy/haproxy.cfg").read().splitlines():
(Pdb)

Expected results:
Run and collect what you can and end gracefully with no tracebacks.

Additional info:
After installing haproxy and etcd haproxy plugin passes but etcd still fails but on different error...

# sosreport --batch --all-logs -a  --debug -o etcd -e etcd

sosreport (version 3.5)

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.JAKqXx 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 ...
Traceback (most recent call last):
  File "/usr/sbin/sosreport", line 25, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1634, in main
    sos.execute()
NameError: global name 'subcmd' is not defined

> /usr/lib/python2.7/site-packages/sos/plugins/etcd.py(43)setup()
-> self.add_cmd_output(['%s %s' % (self.cmd, sub) for sub in subcmd])
(Pdb)

Comment 2 Pavel Moravec 2017-12-05 12:12:43 UTC
Technically, both reported issues are regressions (though I dont expect them happening (often) at customers) - running same tests with sos 3.4 does not raise an exception.

Comment 4 Pavel Moravec 2017-12-05 12:15:51 UTC
Steve, could you pls. pm_ack this small regression to 7.5?

Comment 11 errata-xmlrpc 2018-04-10 18:05:49 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