Bug 1104246 - quite frequent "Network error, unable to connect to server." when attaching pool
Summary: quite frequent "Network error, unable to connect to server." when attaching pool
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
Depends On:
Blocks: rhsm-rhel66
TreeView+ depends on / blocked
Reported: 2014-06-03 15:36 UTC by Jan Hutař
Modified: 2014-07-25 19:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-07-25 19:21:10 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Jan Hutař 2014-06-03 15:36:28 UTC
Description of problem:
I see "Network error, unable to connect to server." when attaching pool quite frequently.

Version-Release number of selected component (if applicable):

How reproducible:
Hard to reproduce

Steps to Reproduce:
1. # set -x; while true; do date; subscription-manager register --force --username <user> --password <pass> && subscription-manager attach --pool <poolID> && subscription-manager unregister || break; done

Actual results:
When I have tried, I got it for ~3rd loop:

+ true
+ date
Tue Jun  3 17:00:26 CEST 2014
+ subscription-manager register --force --username <user> --password <pass>
The system has been registered with ID: <sysID> 
+ subscription-manager attach --pool <poolID>
Successfully attached a subscription for: Red Hat Employee Subscription
Network error, unable to connect to server.
Please see /var/log/rhsm/rhsm.log for more information.
+ break

Traceback is:

2014-06-03 17:01:25,670 [DEBUG]  @connection.py:441 - Making request: GET /subscription/consumers/<sysID>/certificates/serials
2014-06-03 17:02:26,598 [ERROR]  @certlib.py:236 - 
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 234, in perform
    expected = self._get_expected_serials(report)
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 315, in _get_expected_serials
    exp = self.get_certificate_serials_list()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 308, in get_certificate_serials_list
    reply = self.uep.getCertificateSerials(self._get_consumer_id())
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 877, in getCertificateSerials
    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 455, in _request
    response = conn.getresponse()
  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse
  File "/usr/lib64/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status
    line = self.fp.readline()
  File "/usr/lib64/python2.6/socket.py", line 433, in readline
    data = recv(1)
  File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py", line 228, in read
    return self._read_bio(size)
  File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py", line 213, in _read_bio
    return m2.ssl_read(self.ssl, size, self._timeout)
2014-06-03 17:02:26,603 [ERROR]  @certlib.py:237 - Cannot modify subscriptions while disconnected
2014-06-03 17:02:26,604 [ERROR]  @managercli.py:151 - Unable to attach: 
2014-06-03 17:02:26,605 [ERROR]  @managercli.py:152 - 
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1456, in _do_command
    result = self.certlib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 68, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 91, in _do_update
    return action.perform(lock=self.lock)
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 238, in perform
    raise Disconnected()

Expected results:
No error should happen.

Additional info:
Please let me know if this is more problem of hosted services than client tools. Anyway if it is this frequent, maybe the client tool could use some retry mechanism?

Comment 4 William Poteat 2014-07-25 19:21:10 UTC
The client is reacting to network/server issues correctly. It should notify and alow the admin to remedy. Automatic retries are not likely to help all that often.

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