| Summary: | newest python-requests returns proxy error in dogtag | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ade Lee <alee> |
| Component: | python-requests | Assignee: | Arun S A G <sagarun> |
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 19 | CC: | rbean, sagarun |
| Target Milestone: | --- | Flags: | sagarun:
needinfo?
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-02-17 17:04:51 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: | |
This is the connection class that uses requests:
****************************************
import requests
class PKIConnection:
def __init__(self,
protocol='http',
hostname='localhost',
port=80,
subsystem='ca',
accept='application/json'):
self.protocol = protocol
self.hostname = hostname
self.port = port
self.subsystem = subsystem
self.serverURI = self.protocol + '://' +\
self.hostname + ':' + self.port + '/' + \
self.subsystem
self.session = requests.Session()
if accept:
self.session.headers.update({'Accept': accept})
def authenticate(self, username=None, password=None):
if username is not None and password is not None:
self.session.auth = (username, password)
def get(self, path, headers=None):
r = self.session.get(
self.serverURI + path,
verify=False,
headers=headers)
r.raise_for_status()
return r
def post(self, path, payload, headers=None):
r = self.session.post(
self.serverURI + path,
verify=False,
data=payload,
headers=headers)
r.raise_for_status()
return r
****************************
class SystemStatusClient:
def __init__(self, connection):
self.connection = connection
def getStatus(self):
r = self.connection.get('/admin/' +\
self.connection.subsystem + '/getStatus')
return r.text
****************************
client = pki.system.SystemStatusClient(self.connection)
response = client.getStatus()
Ade, are you still getting this error? This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |
Description of problem: We use python-requests to connect to a server from the Dogatg install scripts. Occasionally, we get the following error: 2013-08-30 15:43:55 pkispawn : DEBUG ....... Error Type: ProxyError 2013-08-30 15:43:55 pkispawn : DEBUG ....... Error Message: Cannot connect to proxy. Socket error: [Errno 111] Connection refused. 2013-08-30 15:43:55 pkispawn : DEBUG ....... File "/usr/sbin/pkispawn", line 374, in main rv = instance.spawn() File "/usr/lib/python2.7/site-packages/pki/deployment/configuration.py", line 98, in spawn status = util.instance.wait_for_startup(60) File "/usr/lib/python2.7/site-packages/pki/deployment/pkihelper.py", line 1023, in wait_for_startup status = self.get_instance_status() File "/usr/lib/python2.7/site-packages/pki/deployment/pkihelper.py", line 1007, in get_instance_status response = client.getStatus() File "/usr/lib/python2.7/site-packages/pki/system.py", line 91, in getStatus self.connection.subsystem + '/getStatus') File "/usr/lib/python2.7/site-packages/pki/client.py", line 54, in get headers=headers) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 347, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 335, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 438, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 292, in send timeout=timeout File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 459, in urlopen body=body, headers=headers) File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 314, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib64/python2.7/httplib.py", line 973, in request self._send_request(method, url, body, headers) File "/usr/lib64/python2.7/httplib.py", line 1007, in _send_request self.endheaders(body) File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders self._send_output(message_body) File "/usr/lib64/python2.7/httplib.py", line 829, in _send_output self.send(msg) File "/usr/lib64/python2.7/httplib.py", line 791, in send self.connect() File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 110, in connect raise ProxyError('Cannot connect to proxy. Socket error: %s.' % e) This only happens (occasionally) with the latest python-requests: 1.2.3-5. If we downgrade to 1.1.0-4, no such error is ever seen. I will post the code in which we call python requests below. If there is something that we need to change, please let us know. Dogtag is part of IPA, so this will break IPA installations as well. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: