While running subscription-manager or yum command it fails with error - 'exceptions.ValueError' object has no attribute 'msg' error

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • subscription-manager [RHSM]

Issue

  • Facing below error message while registering through "subscription-manager" method of registration:
# subscription-manager register --user=<username> --auto-attach
'exceptions.ValueError' object has no attribute 'msg'
  • Error message when trying yum commands, though the package is successfully downloaded and installed:
# yum install <package_name>
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
'exceptions.ValueError' object has no attribute 'msg'
$ yum check-update
Loaded plugins: product-id, refresh-packagekit, security
Repo rhel-6-server-rpms forced skip_if_unavailable=True due to: /etc/rhsm/ca/redhat-uep.pem
Repo rhel-6-server-rpms forced skip_if_unavailable=True due to: /etc/pki/entitlement/1203202423242924761-key.pem
  • Error message in rhsm.log
2014-01-28 08:25:17,125 [WARNING]  @certmgr.py:107 - Exception caught while running <subscription_manager.cache.PackageProfileLib object at 0x297bf10> update
2014-01-28 08:25:17,125 [ERROR]  @certmgr.py:108 - 'exceptions.ValueError' object has no attribute 'msg'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 100, in update
    updates += lib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 68, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/cache.py", line 56, in _do_update
    return profile_mgr.update_check(self.uep, consumer_uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 345, in update_check
    if not uep.supports_resource(PACKAGES_RESOURCE):
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 683, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 670, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 541, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 469, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 490, in validateResponse
    log.error("JSON parsing error: %s" % e.msg)                                                            
AttributeError: 'exceptions.ValueError' object has no attribute 'msg'

Resolution

This issue escalated to Engineering team in bugzilla - 1096734 - AttributeError: 'exceptions.ValueError' object has no attribute'msg'

A fix is available for RHEL 6.5 - python-rhsm bug fix update and was included in RHEL 6.6.

If there is no proxy server in network with third party CA certificate which is configured on systems and still this issue is seen then follow steps below as a workaround:

# subscription-manager unregister
# subscription-manager clean
# subscription-manager register 
# subscription-manager list --available
# subscription-manager subscribe --pool=pool-id

Or, register system as mentioned above and attach subscription form Customer Portal.

Root Cause

  • A proxy server between the client system and Red Hat Network uses a Third-party SSL CA certificate.
  • This can be confirmed by verifying the SSL server certificate returned by the following command. The expected Red Hat Network certificate's subject and issuer are shown:
# openssl s_client -connect subscription.rhn.redhat.com:443
[...]
subject=/C=US/ST=North Carolina/O=Red Hat, Inc./OU=Red Hat Network/CN=subscription.rhn.redhat.com/emailAddress=ca-support@redhat.com
issuer=/C=US/ST=North Carolina/O=Red Hat, Inc./OU=Red Hat Network/CN=Red Hat Entitlement Operations Authority/emailAddress=ca-support@redhat.com

Diagnostic Steps

  • From the /var/log/rhsm/rhsm.log file :
 2014-01-28 08:25:17,083 [DEBUG]  @connection.py:426 - Using proxy: <proxy information>
2014-01-28 08:25:17,083 [DEBUG]  @connection.py:441 - Making request: GET https://subscription.rhn.redhat.com:443/subscription/
2014-01-28 08:25:17,123 [DEBUG]  @connection.py:460 - Response status: 403
2014-01-28 08:25:17,124 [ERROR]  @connection.py:489 - Response: 403
2014-01-28 08:25:17,125 [WARNING]  @certmgr.py:107 - Exception caught while running <subscription_manager.cache.PackageProfileLib object at 0x297bf10> update
2014-01-28 08:25:17,125 [ERROR]  @certmgr.py:108 - 'exceptions.ValueError' object has no attribute 'msg'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 100, in update
    updates += lib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 68, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/cache.py", line 56, in _do_update
    return profile_mgr.update_check(self.uep, consumer_uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 345, in update_check
    if not uep.supports_resource(PACKAGES_RESOURCE):
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 683, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 670, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 541, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 469, in _request
    self.validateResponse(result, request_type, handler)

  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 490, in validateResponse
    log.error("JSON parsing error: %s" % e.msg)                                                            <------ 
AttributeError: 'exceptions.ValueError' object has no attribute 'msg'

2014-01-28 08:25:17,129 [INFO]  @cache.py:168 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2014-01-28 08:25:17,130 [INFO]  @cache.py:185 - No changes.

Response status: 403

   " A web server may return a 403 Forbidden HTTP status code in response to a        request from a client for a web page or resource to indicate that the server can be reached and understood the request, but refuses to take any further action. Status code 403 responses are the result of the web server being configured to deny access, for some reason, to the requested resource by the client ".

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.

Comments