Bug 1325765

Summary: "Virt backend 'env/cmdline' fails with exception" when re-register hypervisor to satellite
Product: Red Hat Enterprise Linux 6 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Chris Snyder <csnyder>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: ldai, rbalakri, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.18-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 10:30:21 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 2016-04-11 07:04:34 UTC
Description of problem:
Run virt-who with CLI mode after delete hypervisor from satellite webUI, it will show some exception in the log.

Version-Release number of selected component (if applicable):
virt-who-0.16-8.el6.noarch
subscription-manager-1.16.8-8.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite6.1
2. Configure virt-who run at esx mode and check esx hypervisor has been registered to satellite. 
3. Stop virt-who service
4. Open satellite WebUI, delete hyperviosr from content-host.
5. Run virt-who with CLI and check virt-who's log.
[root@dell-per720xd-01 virt-who.d]# virt-who --esx --esx-owner=ACME_Corporation --esx-env=Library --esx-server=10.73.2.95 --esx-username=Administrator --esx-password=Welcome1! -o -d
2016-04-11 02:12:48,037 [virtwho.init INFO] MainProcess(16428):MainThread @virtwho.py:parseOptions:638 - Using reporter_id='dell-per720xd-01.rhts.eng.bos.redhat.com'
2016-04-11 02:12:48,044 [virtwho.init INFO] MainProcess(16428):MainThread @virtwho.py:main:730 - Using configuration "env/cmdline" ("esx" mode)
2016-04-11 02:12:48,326 [virtwho.env_cmdline DEBUG] Esx-1(16434):MainThread @virt.py:run:358 - Virt backend 'env/cmdline' started
2016-04-11 02:12:48,327 [virtwho.env_cmdline DEBUG] Esx-1(16434):MainThread @esx.py:_prepare:55 - Log into ESX
2016-04-11 02:12:51,739 [virtwho.env_cmdline DEBUG] Esx-1(16434):MainThread @esx.py:_prepare:58 - Creating ESX event filter
2016-04-11 02:12:54,972 [virtwho.env_cmdline DEBUG] Esx-1(16434):MainThread @virt.py:enqueue:351 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-04-11 02:12:55,007 [virtwho.main DEBUG] MainProcess(16428):MainThread @subscriptionmanager.py:_connect:121 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2016-04-11 02:12:55,187 [virtwho.main DEBUG] MainProcess(16428):MainThread @subscriptionmanager.py:hypervisorCheckIn:162 - Checking if server has capability 'hypervisor_async'
2016-04-11 02:12:55,358 [virtwho.main DEBUG] MainProcess(16428):MainThread @subscriptionmanager.py:hypervisorCheckIn:174 - Server does not have 'hypervisors_async' capability
2016-04-11 02:12:55,359 [virtwho.main INFO] MainProcess(16428):MainThread @subscriptionmanager.py:hypervisorCheckIn:185 - Sending update in hosts-to-guests mapping for config "env/cmdline": 2 hypervisors and 1 guests found
2016-04-11 02:12:55,359 [virtwho.main DEBUG] MainProcess(16428):MainThread @subscriptionmanager.py:hypervisorCheckIn:186 - Host-to-guest mapping: {
    "7a384d56-085c-0e32-c7ad-f7181c3f6ddf": [], 
    "3e504d56-3982-037b-f3e6-669289892fa1": [
        {
            "guestId": "4206405a-4133-bd0c-f8a5-9c7bc1355837", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "hypervisorVersion": "6.0.0", 
                "virtWhoType": "esx", 
                "hypervisorType": "VMware ESXi"
            }
        }
    ]
}
2016-04-11 02:12:56,852 [virtwho.main DEBUG] MainProcess(16428):MainThread @virtwho.py:send_report:161 - Report for config "env/cmdline" sent
No handlers could be found for logger "suds.client"
2016-04-11 02:13:02,412 [virtwho.env_cmdline ERROR] Esx-1(16434):MainThread @virt.py:run:371 - Virt backend 'env/cmdline' fails with exception:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt/virt.py", line 366, in run
    self._run()
  File "/usr/share/virt-who/virt/esx/esx.py", line 146, in _run
    self.cleanup()
  File "/usr/share/virt-who/virt/esx/esx.py", line 152, in cleanup
    self.client.service.DestroyPropertyFilter(self.filter)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 542, in __call__
    return client.invoke(args, kwargs)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 602, in invoke
    result = self.send(soapenv)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 657, in send
    result = self.failed(binding, e)
  File "/usr/lib/python2.6/site-packages/suds/client.py", line 712, in failed
    r, p = binding.get_fault(reply)
  File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 265, in get_fault
    raise WebFault(p, faultroot)
WebFault: Server raised fault: 'The object has already been deleted or has not been completely created'

Actual results:
Although virt-who can send h/g mapping info to satellite, it still show exception in the log.

Expected results:
virt-who can send h/g mapping info to satellite and it also shouldn't show error info in the log.

Additional info:

Comment 3 Radek Novacek 2016-10-13 08:17:14 UTC
Fixed in virt-who-0.18-1.el6.

Comment 5 Eko 2017-01-23 08:42:27 UTC
verified in virt-who-0.18-2.el6

Comment 7 errata-xmlrpc 2017-03-21 10:30:21 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://rhn.redhat.com/errata/RHBA-2017-0675.html