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.

"Name or service not known" エラーでシステム登録が失敗する

Solution Verified - Updated -

Environment

  • Red Hat Network(RHN)
  • Red Hat Enterprise Linux(RHEL)
  • Red Hat subscription Manager(RHSM)

Issue

  • Name or service not known エラーが表示され、システムの登録に失敗します。

    Error communicating with server. The message was:
    Name or service not known
  • gaierror: [Errno -2] Name or service not known エラーが表示され、システムの登録に失敗します。

    2014-06-18 14:33:50,133 [ERROR]  @managercli.py:151 - Error during registration: [Errno -2] Name or service not known
    2014-06-18 14:33:50,134 [ERROR] @managercli.py:152 - [Errno -2] Name or service not known
    Traceback (most recent call last):
    File "/usr/share/rhsm/subscription_manager/managercli.py", line 1045, in _do_command
    owner_key = self._determine_owner_key(admin_cp)
    File "/usr/share/rhsm/subscription_manager/managercli.py", line 1148, in _determine_owner_key
    owners = cp.getOwnerList(self.username)
    File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 852, in getOwnerList
    return self.conn.request_get(method)
    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 448, in _request
    conn.request(request_type, handler, body=body, headers=headers)
    File "/usr/lib64/python2.6/httplib.py", line 914, in request
    self._send_request(method, url, body, headers)
    File "/usr/lib64/python2.6/httplib.py", line 951, in _send_request
    self.endheaders()
    File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
    self._send_output()
    File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
    self.send(msg)
    File "/usr/lib64/python2.6/httplib.py", line 739, in send
    self.connect()
    File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 51, in connect
    socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
    gaierror: [Errno -2] Name or service not known
  • yum update が、次のメッセージを表示して失敗します: Error communicating with server.The message was Name or service unknown

Resolution

  • messagebus および haldaemon サービスを起動します (実行されていない場合)。

  • /etc/resolv.conf ファイルをチェックして、このファイルに DNS サーバーエントリーが存在するか確認します。存在しない場合は、DNS サーバーを確認して、そのエントリーを追加します。

    # vi /etc/resolv.conf

    nameserver <dns_server_ip>
  • sslCACert が /etc/sysconfig/rhn/up2date で正しく定義されているか確認します。
    以下のように表示されるはずです。

      sslCACert=/usr/share/rhn/RHNS-CA-CERT
  • ネットワークサービスを再起動します。

    # service network restart

RHSM に登録されたシステムの場合:

  • /etc/rhsm/rhsm.conf ファイル内の Server hostname および Server prefix エントリーを以下のように修正します。

    [server]
    # Server hostname:
    hostname = subscription.rhn.redhat.com

    # Server prefix:
    prefix = /subscription
  • システムを登録します。

Root Cause

  • ファイアウォールが一部のポートをブロックしています。
  • /etc/sysconfig/rhn/up2date 内に間違った CA 証明書があります。
    RHN Classic を使用して登録されたシステムの場合、値は "sslCACert=/usr/share/rhn/RHNS-CA-CERT" です。
  • /etc/rhsm/rhsm.conf ファイル内の Server hostname および Server prefix エントリーが正しくありません。

Diagnostic Steps

  • エラーメッセージを見ると、名前解決に問題があるようです。

  • 受信ポートと送信ポート (443 と 80) が開いているか確認します。

  • クライアントとサーバー間の通信を確認するには、以下を実行します。

    # telnet xmlrpc.rhn.redhat.com 80
    # telnet xmlrpc.rhn.redhat.com 443
    # nc -z rhn.redhat.com 80 -Xconnect
    # nc -z rhn.redhat.com 443 -Xconnect
    # echo -e "TRACE / HTTP/1.1\nHost: xmlrpc.rhn.redhat.com\n\n" | nc xmlrpc.rhn.redhat.com 80
  • messagebus サービスと haldaemon サービスが実行されているか確認します。

    # /etc/init.d/messagebus status
    # /etc/init.d/haldaemon status

Red Hat Subscription Manager に登録されているシステムの場合

  • /etc/rhsm/rhsm.conf ファイルを調べて、以下のエントリーを確認します。

    [server]
    # Server hostname:
    hostname = subscription.rhn.redhat.com

    # Server prefix:
    prefix = /subscription

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