Bug 1104246

Summary: quite frequent "Network error, unable to connect to server." when attaching pool
Product: Red Hat Enterprise Linux 6 Reporter: Jan Hutař <jhutar>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: bkearney, lpramuk, smunilla, wpoteat
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-25 19:21:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1014343    

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):
python-rhsm-1.9.6-1.el6.x86_64
subscription-manager-1.9.11-1.el6.x86_64


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
    response.begin()
  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)
SSLTimeoutError
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()
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.