Red Hat Bugzilla – Bug 1519267
tracebacks in etcd and haproxy plugins
Last modified: 2018-04-10 14:07:13 EDT
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)
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.
Steve, could you pls. pm_ack this small regression to 7.5?
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