Bug 1247890 - virt-who shows communication error with subscription manager for ESX against SAM
virt-who shows communication error with subscription manager for ESX against SAM
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-rhsm (Show other bugs)
x86_64 Linux
medium Severity high
: rc
: ---
Assigned To: Chris Snyder
Lenka Špačková
Depends On:
Blocks: 1246125
  Show dependency treegraph
Reported: 2015-07-29 03:45 EDT by Eko
Modified: 2016-09-19 22:28 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
virt-who unable to log information when connected to SAM On systems registered to the Subscription Asset Manager (SAM) server, the virt-who service logs an "Error in communication with subscription manager" instead of the expected output. This is due to the python-rhsm library being unable to retrieve the capabilities of the Candlepin manager from the SAM server.
Story Points: ---
Clone Of:
Last Closed: 2015-11-19 06:49:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Eko 2015-07-29 03:45:17 EDT
Description of problem:
When system is registered to sam server, virt-who will show many error message when communicate with subscription-manager

Version-Release number of selected component (if applicable):
- RHEL7.2-20150720.0-Server-x86_64 + ESX6.0 against sam
- virt-who-0.14-2.el7.noarch
- subscription-manager-1.15.6-1.el7.x86_64
- python-rhsm-1.15.3-1.el7.x86_64

How reproducible:

Steps to Reproduce:
1. config /etc/rhsm/rhsm.conf for sam server
rpm -ihv

2. config /etc/sysconfig/virt-who for esx mode
# grep -v  "^#" /etc/sysconfig/virt-who

3. register host to sam server
# subscription-manager register --username=admin --password=admin
The system has been registered with ID: 345908e6-d255-44bf-bedf-2317de27217f

# subscription-manager identity 
system identity: 345908e6-d255-44bf-bedf-2317de27217f
name: dhcp-128-13.nay.redhat.com
org name: ACME_Corporation
org ID: ACME_Corporation

4. restart virt-who and check status
# systemctl restart virt-who.service

# systemctl status virt-who.service 
● virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2015-07-29 15:42:29 CST; 26s ago
 Main PID: 8572 (python)
   CGroup: /system.slice/virt-who.service
           ├─8572 /usr/bin/python /usr/share/virt-who/virtwho.py
           └─8577 /usr/bin/python /usr/share/virt-who/virtwho.py

Jul 29 15:42:29 dhcp-128-13.nay.redhat.com systemd[1]: Started Daemon for reporting virtual guest IDs to subscription-manager.
Jul 29 15:42:29 dhcp-128-13.nay.redhat.com systemd[1]: Starting Daemon for reporting virtual guest IDs to subscription-manager...
Jul 29 15:42:29 dhcp-128-13.nay.redhat.com python[8572]: Using configuration "env/cmdline" ("esx" mode)

5. check rhsm.log
2015-07-29 15:43:25,168 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-29 15:43:25,199 [DEBUG]  @subscriptionmanager.py:146 - Checking if server has capability 'hypervisor_async'
2015-07-29 15:43:25,230 [ERROR]  @virtwho.py:177 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 160, in send
  File "/usr/share/virt-who/virtwho.py", line 191, in _sendGuestAssociation
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 147, in hypervisorCheckIn
    is_async = hasattr(self.connection, 'has_capability') and self.connection.has_capability('hypervisors_async')
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 787, in has_capability
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 778, in _load_manager_capabilities
    self.capabilities = self.capabilities['managerCapabilities']
KeyError: 'managerCapabilities'

Actual results:
Error in communication with subscription manager

Expected results:
It should show the right host/guest mapping info in rhsm.og, no any error exception

Additional info:
Comment 2 Liushihui 2015-07-30 04:16:26 EDT
It happened when start virt-who service, it also has the same problem when virt-who run at remote libvirt mode/rhevm mode/hyperv mode.
Comment 3 Radek Novacek 2015-07-30 07:55:11 EDT
It looks like python-rhsm is missing some checks. Reassigning.

Please check if this is a bug in python-rhsm or it's fault of virt-who. Thanks.
Comment 4 Chris Snyder 2015-08-10 10:58:27 EDT
This was an issue with python-rhsm. A fix for this should be in as of commit: aba66ef25ebdcece72e9aaac7abf78d21b1cb9ff
Comment 5 Chris "Ceiu" Rog 2015-08-12 13:11:06 EDT
commit c63f2dd51ea4b05f0c013e084dbe871bf3af5c4c
Author: Christopher Snyder <csnyder@redhat.com>
Date:   Mon Aug 3 12:04:32 2015 -0400

    1247890: KeyErrors are now caught when checking manager capabilities
Comment 6 Chris "Ceiu" Rog 2015-08-12 13:12:38 EDT
Also includes:
Comment 9 Eko 2015-08-18 06:38:45 EDT
update python-rhsm to 1.15.4-3, this issue can be fixed, host/guests mapping info can be found normally.
Comment 10 errata-xmlrpc 2015-11-19 06:49:44 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.


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