This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 857426 - Traceback when calling hypervisorCheckIn with empty dictionary
Traceback when calling hypervisorCheckIn with empty dictionary
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python-rhsm (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Michael Stead
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-09-14 07:35 EDT by Radek Novacek
Modified: 2016-11-30 19:31 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Post data was None due to an invalid 'if' statement. Consequence: An empty JSON struct was not being set as the body of the request. i.e [] Fix: Update the broken if statement to explicitly check that the data 'is not None' which will allow the empty mapping of hypervisors to be properly passed in the request. Result: Empty mapping of hypervisors is correctly sent to candlepin.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-08 02:18:46 EST
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)

  None (edit)
Description Radek Novacek 2012-09-14 07:35:54 EDT
python-rhsm crashes when calling method hypervisorCheckIn with empty host_guest_mapping dictionary.

Traceback (most recent call last):
  File "./virt-who.py", line 193, in _send
    result = self.subscriptionManager.hypervisorCheckIn(self.options.owner, self.options.env, virtualGuests)
  File "/home/radek/vAgent/virt-who/subscriptionmanager.py", line 92, in hypervisorCheckIn
    return self.connection.hypervisorCheckIn(owner, env, mapping)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 590, in hypervisorCheckIn
    return self.conn.request_post(url, host_guest_mapping)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 403, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 362, in _request
    self.validateResponse(result)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 387, in validateResponse
    raise RestlibException(response['status'], error_msg)
RestlibException: Runtime Error java.io.EOFException: No content to map to Object due to end of input at org.codehaus.jackson.map.ObjectMapper._initForReading:2,766

python-rhsm-1.0.6-1.el5
Comment 1 RHEL Product and Program Management 2012-10-09 09:38:06 EDT
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 2 Alex Wood 2012-10-09 15:00:55 EDT
commit fae4fbcb5d67f167f6115a79bfaf68a3a6976b2b
Author:     Michael Stead <mstead@redhat.com>
AuthorDate: Tue Oct 9 12:20:10 2012 -0300
Commit:     Michael Stead <mstead@redhat.com>
CommitDate: Tue Oct 9 13:36:25 2012 -0300
Comment 4 Hui Wang 2012-10-10 05:23:22 EDT
Verified the issue, the result is pass. Moving the bug to Verified.
version:
python-rhsm-1.0.10-1.el5.x86_64.rpm 
candlepin-0.7.2-1.fc16
virt-who-0.7-4.el5
subscription-manager-1.0.14-1.el5

1. prepare one virt-who OS, that installed the latest python-rhsm   

[root@localhost rhsm]# rpm -Uvh python-rhsm-1.0.10-1.el5.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:python-rhsm            ########################################### [100%]

2. connect the virt-who to Vcenter that has no host on it.  

3. start virt-who service

[root@localhost rhsm]# >/var/log/rhsm/rhsm.log
[root@localhost rhsm]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who:                                         [  OK  ]
[root@localhost rhsm]# tail -f /var/log/rhsm/rhsm.log
2012-10-07 16:24:23,849 [WARNING]  @virt-who.py:413 - Listening for events is not available in VDSM or ESX mode
2012-10-07 16:24:31,742 [DEBUG]  @virt-who.py:428 - Virt-who is running in esx mode
2012-10-07 16:24:31,742 [DEBUG]  @virt-who.py:435 - Starting infinite loop with 3600 seconds interval and event handling
2012-10-07 16:24:31,795 [DEBUG]  @subscriptionmanager.py:89 - Sending update in hosts-to-guests mapping: {}
Comment 6 errata-xmlrpc 2013-01-08 02:18:46 EST
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-2013-0039.html

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