Bug 1092811

Summary: It will generate error log after restart virt-who
Product: Red Hat Enterprise Linux 5 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: gaoshang <sgao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.11CC: liliu, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.9-4.el5 Doc Type: Bug Fix
Doc Text:
no docs needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-16 00:29:31 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 Liushihui 2014-04-30 03:16:34 UTC
Description of problem:
Although virt-who still run normally after restart it, it will generate some error log

Version-Release number of selected component (if applicable):
virt-who-0.9-2.el5
subscription-manager-1.8.22-1.el5
python-rhsm-1.8.18-1.el5

How reproducible:
50%

1. configure the virt-who with the following parameters:
   VIRTWHO_BACKGROUND=1
   VIRTWHO_DEBUG=1
   VIRTWHO_INTERVAL=1
   VIRTWHO_ESX=1
   VIRTWHO_ESX_OWNER=ACME_Corporation
   VIRTWHO_ESX_ENV=Library
   VIRTWHO_ESX_SERVER=10.66.78.16
   VIRTWHO_ESX_USERNAME=Administrator
   VIRTWHO_ESX_PASSWORD=qwer1234P!
2. Register system to SAM server and make sure virt-who run normally
[root@dhcp-128-110 libvirt-test-API]# subscription-manager register --username=admin --password=admin
[root@dhcp-128-110 libvirt-test-API]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who:                                         [  OK  ]
[root@dhcp-128-110 libvirt-test-API]# service virt-who status
virt-who (pid  31663) is running...
3. Restart virt-who again
[root@dhcp-128-110 libvirt-test-API]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who:                                         [  OK  ]
4. Check the virt-who log in the /var/log/rhsm/rhsm.log

Actual results:
virt-who run normally, However, It still generate error log in the log file 

2014-04-29 21:31:35,407 [WARNING]  @virt-who.py:515 - Listening for events is not available in VDSM, ESX, RHEV-M or Hyper-V mode
2014-04-29 21:31:35,506 [DEBUG]  @virt-who.py:528 - Virt-who is running in esx mode
2014-04-29 21:31:35,506 [DEBUG]  @virt-who.py:535 - Starting infinite loop with 1 seconds interval and event handling
2014-04-29 21:31:42,579 [DEBUG]  @subscriptionmanager.py:89 - Sending update in hosts-to-guests mapping: {aee4ff00-8c33-11e2-994a-6c3be51d959a: [564d1f59-71c6-57c8-62f0-607a7218d24c], 44454c4c-4200-1034-8039-b8c04f503258: []}
2014-04-29 21:31:52,245 [ERROR]  @virt-who.py:197 - Error in communication with virt backend, trying to recover:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 191, in _send
    virtualGuests = self.virt.getHostGuestMapping()
  File "/usr/share/virt-who/vsphere.py", line 288, in getHostGuestMapping
    self.scan()
  File "/usr/share/virt-who/vsphere.py", line 141, in scan
    self.client.service.Login(_this=self.sc.sessionManager, userName=self.username, password=self.password)
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 542, in __call__
    return client.invoke(args, kwargs)
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 602, in invoke
    result = self.send(soapenv)
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 643, in send
    reply = transport.send(request)
  File "/usr/lib/python2.4/site-packages/suds/transport/https.py", line 64, in send
    return  HttpTransport.send(self, request)
  File "/usr/lib/python2.4/site-packages/suds/transport/http.py", line 77, in send
    fp = self.u2open(u2request)
  File "/usr/lib/python2.4/site-packages/suds/transport/http.py", line 116, in u2open
    return url.open(u2request)
  File "/usr/lib64/python2.4/urllib2.py", line 358, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.4/urllib2.py", line 376, in _open
    '_open', req)
  File "/usr/lib64/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.4/urllib2.py", line 1126, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib64/python2.4/urllib2.py", line 1090, in do_open
    r = h.getresponse()
  File "/usr/lib64/python2.4/httplib.py", line 872, in getresponse
    response.begin()
  File "/usr/lib64/python2.4/httplib.py", line 336, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.4/httplib.py", line 294, in _read_status
    line = self.fp.readline()
  File "/usr/lib64/python2.4/httplib.py", line 991, in readline
    s = self._read()
  File "/usr/lib64/python2.4/httplib.py", line 947, in _read
    buf = self._ssl.read(self._bufsize)
  File "/usr/share/virt-who/virt-who.py", line 339, in cleanup
    sys.exit(0)
SystemExit: 0
2014-04-29 21:31:55,626 [WARNING]  @virt-who.py:515 - Listening for events is not available in VDSM, ESX, RHEV-M or Hyper-V mode
2014-04-29 21:31:55,731 [DEBUG]  @virt-who.py:528 - Virt-who is running in esx mode
2014-04-29 21:31:55,731 [DEBUG]  @virt-who.py:535 - Starting infinite loop with 1 seconds interval and event handling
2014-04-29 21:32:02,819 [DEBUG]  @subscriptionmanager.py:89 - Sending update in hosts-to-guests mapping: {aee4ff00-8c33-11e2-994a-6c3be51d959a: [564d1f59-71c6-57c8-62f0-607a7218d24c], 44454c4c-4200-1034-8039-b8c04f503258: []}

Expected results:
It shouldn't generate any error log after restart virt-who. BTW, it hasn't this problem in the RHEL7

Additional info:

Comment 1 Radek Novacek 2014-04-30 10:54:57 UTC
*** Bug 1092818 has been marked as a duplicate of this bug. ***

Comment 2 Radek Novacek 2014-05-06 08:12:26 UTC
This is caused by different handling of SystemExit and KeyboardInterrupt exceptions in python 2.4.

Fix is available upstream:

https://git.fedorahosted.org/cgit/virt-who.git/commit/?id=f99bb08e3fa8be840b9570ffa1ca9c4a770fdc48

Comment 3 RHEL Program Management 2014-05-19 08:29:27 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 4 Radek Novacek 2014-05-22 09:26:30 UTC
Fixed in virt-who-0.9-4.el5.

Comment 6 Liushihui 2014-06-05 09:30:11 UTC
verified it on virt-who-0.9-4.el5

Comment 8 errata-xmlrpc 2014-09-16 00:29:31 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.

http://rhn.redhat.com/errata/RHBA-2014-1206.html