Red Hat Bugzilla – Bug 1444641
virsh plugin uncaught exception when unable to connect to the hypervisor
Last modified: 2017-08-01 19:10:42 EDT
Description of problem: When virsh -r <subcommand> fails to connect to the hypervisor, and virsh plugin is enabled in sosreport, then it produces backtrace: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1252, in setup plug.setup() File "/usr/lib/python2.7/site-packages/sos/plugins/virsh.py", line 59, in setup pos = k_lines[0].split().index('Name') ValueError: 'Name' is not in list Reason: 53 for k in ['net', 'nwfilter', 'pool']: 54 self.add_cmd_output('%s %s-list' % (cmd, k)) 55 k_file = self.get_cmd_output_now('%s %s-list' % (cmd, k)) 56 if k_file: 57 k_lines = open(k_file, 'r').read().splitlines() 58 # the 'name' column position changes between virsh cmds 59 pos = k_lines[0].split().index('Name') cmd on line 54 calls virsh that returns the failure: ['error: failed to connect to the hypervisor', "error: Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory", ''] that does not contain 'Name' substring either where. Version-Release number of selected component (if applicable): sos-3.4-2.el7.noarch How reproducible: 100% Steps to Reproduce: 1. Switch off libvirt hypervisor / in some other means, cause the "virsh -r net-list" command generates the above error. 2. sosreport --batch -o virsh Actual results: caught exception in plugin method "virsh.setup()" writing traceback to sos_logs/virsh-plugin-errors.txt .. and the virsh-plugin-errors.txt has: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1252, in setup plug.setup() File "/usr/lib/python2.7/site-packages/sos/plugins/virsh.py", line 59, in setup pos = k_lines[0].split().index('Name') ValueError: 'Name' is not in list Expected results: no such error Additional info:
In fact this is a regression: current sos-3.3-5.el7_3.noarch does not generate the traceback / exception, in the same situation.
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