Bug 1004818 - newest python-requests returns proxy error in dogtag [NEEDINFO]
Summary: newest python-requests returns proxy error in dogtag
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-requests
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Arun S A G
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-05 14:31 UTC by Ade Lee
Modified: 2015-02-17 17:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 17:04:51 UTC
Type: Bug
sagarun: needinfo?


Attachments (Terms of Use)

Description Ade Lee 2013-09-05 14:31:41 UTC
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:

Comment 1 Ade Lee 2013-09-05 14:45:50 UTC
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()

Comment 2 Ralph Bean 2013-09-25 13:26:44 UTC
Ade, are you still getting this error?

Comment 3 Fedora End Of Life 2015-01-09 19:44:25 UTC
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.

Comment 4 Fedora End Of Life 2015-02-17 17:04:51 UTC
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.


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