Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

subscription-manager または yum コマンドの実行時に 'exceptions.ValueError' object has no attribute 'msg' エラーが発生する

Solution Verified - Updated -

Environment

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

Issue

  • "subscription-manager" を使用して登録を行うと、以下のエラーメッセージが発生します。
# subscription-manager register --user=<username> --auto-attach
'exceptions.ValueError' object has no attribute 'msg'
  • yum コマンドを実行すると、以下のエラーメッセージが表示されますが、パッケージはダウンロードされインストールされます。
# 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
  • 以下は、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

この問題は、Bugzilla 1096734 - AttributeError: 'exceptions.ValueError' object has no attribute'msg' でエンジニアリングチームが対応しています。

修正は RHEL 6.5 (python-rhsm bug fix update) で利用でき、RHEL 6.6 に含まれることが予定されています。

サードパーティの CA 証明書がシステムに設定されているプロキシサーバーがネットワークに存在せず、依然としてこの問題が発生している場合は、以下の手順が回避策として使用できます。

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

もしくは、上述のようにシステムを登録した上で、カスタマーポータルからサブスクリプションを登録します。

Root Cause

  • クライアントシステムと Red Hat Network との間のプロキシサーバーがサードパーティの SSL CA 証明書を使用しています。
  • 以下のコマンドから返された SSL サーバーの証明書を確認すると、これを確認できます。予想される Red Hat Network 証明書の対象者と発行者は以下のようになります。
# 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

  • /var/log/rhsm/rhsm.log ファイル:
 2014-01-28 08:25:17,083 [DEBUG]  @connection.py:426 - Using proxy:<proxy information>
2014/01/28 8:25:17,083 [DEBUG]  @connection.py:441 - Making request:GET https://subscription.rhn.redhat.com:443/subscription/
2014/01/28 8: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.

レスポンスステータス: 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