Virt-who logs contain "Server error attempting a POST to /rhsm/hypervisors?owner=ORG&env=ENV returned status 500"

Solution Verified - Updated

Environment

  • Red Hat Satellite 6
  • Virt-who (running on an external server or on a self-registered Satellite server)

Issue

The virt-who server should be able to report to Satellite 6 via RHSM, however the below traceback is witnessed in the virt-who logs:

2016-03-21 11:03:06,378 [ERROR]  @virtwho.py:123 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 107, in send
    self._sendGuestAssociation(report)
  File "/usr/share/virt-who/virtwho.py", line 134, in _sendGuestAssociation
    result = manager.hypervisorCheckIn(report.config, report.association, report.config.type)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 152, in hypervisorCheckIn
    return self.connection.hypervisorCheckIn(config.owner, config.env, serialized_mapping)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 815, in hypervisorCheckIn
    return self.conn.request_post(url, host_guest_mapping)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 605, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 530, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 578, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a POST to /rhsm/hypervisors?owner=ORG&env=Library returned status 500

Resolution

  • If these entries exist in /etc/virt-who.d/config, please comment them out:
rhsm_hostname=satellite.example.com
rhsm_username=satelliteuser
rhsm_encrypted_password=EncryptedPassword
rhsm_prefix=/rhsm

For more KB articles/solutions related to Virt-who and Virtual Datacenter (VDC) Subscriptions Issues, please refer to the Consolidated Troubleshooting Article for Virt-who and Virtual Datacenter (VDC) Subscriptions Issues

Root Cause

Virt-who will send guest/host mapping data to the server indicated in /etc/rhsm/rhsm.conf:

[server]
# Server hostname:
hostname = satellite.example.com

There are additional configuration entries which may be added to virt-who configuration files under/etc/virt-who.d/ which can override this behavior. However, these entries are only applicable to environments where:

  1. The virt-who service is running on the Satellite server
  2. The Satellite server is registered directly to Red Hat

Diagnostic Steps

Check /var/log/rhsm/rhsm.log for entries such as:

2016-03-21 11:03:06,378 [ERROR]  @virtwho.py:123 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 107, in send
    self._sendGuestAssociation(report)
  File "/usr/share/virt-who/virtwho.py", line 134, in _sendGuestAssociation
    result = manager.hypervisorCheckIn(report.config, report.association, report.config.type)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 152, in hypervisorCheckIn
    return self.connection.hypervisorCheckIn(config.owner, config.env, serialized_mapping)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 815, in hypervisorCheckIn
    return self.conn.request_post(url, host_guest_mapping)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 605, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 530, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 578, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a POST to /rhsm/hypervisors?owner=ORG&env=Library returned status 500

Further check the virt-who server's /etc/rhsm/rhsm.conf file to determine where virt-who will direct its host/guest mapping reports:

[server]
# Server hostname:
hostname = satellite.example.com

Check your configuration files under /etc/virt-who.d/ for the below lines:

rhsm_hostname=satellite.example.com
rhsm_username=satelliteuser
rhsm_encrypted_password=EncryptedPassword
rhsm_prefix=/rhsm
SBR
Product(s)
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.