Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1444641 - virsh plugin uncaught exception when unable to connect to the hypervisor
virsh plugin uncaught exception when unable to connect to the hypervisor
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sos (Show other bugs)
7.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Pavel Moravec
Miroslav Hradílek
https://github.com/sosreport/sos/pull...
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-23 10:22 EDT by Pavel Moravec
Modified: 2017-08-01 19:10 EDT (History)
6 users (show)

See Also:
Fixed In Version: sos-3.4-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 19:10:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2203 normal SHIPPED_LIVE sos bug fix and enhancement update 2017-08-01 15:41:56 EDT

  None (edit)
Description Pavel Moravec 2017-04-23 10:22:02 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:
Comment 2 Pavel Moravec 2017-04-25 11:12:25 EDT
In fact this is a regression: current sos-3.3-5.el7_3.noarch does not generate the traceback / exception, in the same situation.
Comment 6 errata-xmlrpc 2017-08-01 19:10:42 EDT
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

Note You need to log in before you can comment on or make changes to this bug.