python-requests version:1.1.0 ConnectionError: [Errno 2] server failed

python-requests version:1.1.0

there are sometimes two error appear:

error one log:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py", line 264, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 35, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 56, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 140, in wrapper
    flask.request.path, stream=stream, source=source
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 42, in lookup_source
    stream=stream
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 206, in send
    raise ConnectionError(sockerr)
ConnectionError: [Errno 2] server failed

another error log:
ConnectionError: [Errno 3] name does not exist
2017-02-09 17:44:56,515 ERROR: Exception on /v1/images/d1048c584ea5b29273c1f58e432044dcafcb62a62749378a986b9a42cbe8994d/layer [GET]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py", line 264, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 35, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 56, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 140, in wrapper
    flask.request.path, stream=stream, source=source
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 42, in lookup_source
    stream=stream
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 206, in send
    raise ConnectionError(sockerr)
ConnectionError: [Errno 3] name does not exist

Hi!

Unfortunately, we can't help you with a version of requests that old. Requests 1.1.0 shipped in January 2013, making it four years old now. It is thoroughly unsupported by the Requests team. If you installed it via a Linux package manager, you'll need to contact your distribution. Otherwise, you'll need to upgrade to something approaching a recent release before we can help you.

@Lukasa what the highest version that python 2.6.6 supports?

Requests still supports Python 2.6 in the most recent versions. We have not dropped support for 2.6 yet, though we may do so this year.

@Lukasa i have googled a lot for the error: `ConnectionError: [Errno 2] server failed`,but nothing has been found!
Do you have any idea about this strange error?

Assuming you're on Linux errno 2 is ENOENT. This suggests you're having problems resolving the domain name, which is reinforced by the second exception. You should look into whether tools like `nslookup` can resolve the name.

the second exception:`ConnectionError: [Errno 3] name does not exist` maybe be related to domain name resolving,but the first exception:`ConnectionError: [Errno 2] server failed` is unrelated to the second exception and has nothing to do with domain name resolving.

@Lukasa do you have any idea about the first exception?

What makes you think it has nothing to do with domain name resolving? It overwhelmingly seems most likely that that's what's gone wrong. If you want to confirm you can use `strace` to see which specific syscall is failing with that errno.

@Lukasa Why Linux errno 2 `ENOENT` means having problems resolving the domain name,as far as i know,the `ENOENT`  means `No such file or directory`.


Errnos can come up at weird times and in weird places. What I'd like to do is *confirm* which syscall is causing it, which you can do by using `strace`.

@Lukasa it is a mutil-process server,and the error occurs sometimes,so i am afraid it can't be straced easily!

Hrm. Well in that case we've got a problem. ENOENT should not be raised by any of our syscalls, but it is. I assume, based on the fact that you are having other miscellaneous problems with name resolution, that it is *also* related to name resolution.

Without the ability to provide any kind of data in the opposite direction, I'm afraid that I don't think I can really help you more than that.

@Lukasa anyway,thanks for your response!

still,actually,there is another error:
12 SSLError: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib：
2017-02-20 10:59:31,890 ERROR: Exception on /v1/images/1b6c5dbe537403c916f6ea668632a05099a09cdde9a668543e4da2eab5a6b179/layer [GET]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py", line 264, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 35, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 56, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 140, in wrapper
    flask.request.path, stream=stream, source=source
  File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 42, in lookup_source
    stream=stream
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 213, in send
    raise SSLError(e)
SSLError: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib




Assuming this error is still happening on Requests 1.1, I'm afraid we cannot really dive into that. Historically there has been problems around managing cert bundles: you'd have to upgrade before we can help.

ok,i think it has something to do with httplib2.
the above error appears with httplib2 but disappears with httplib.