Skip to content

timeout error is noisy #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nisavid opened this issue Aug 30, 2011 · 6 comments
Closed

timeout error is noisy #349

nisavid opened this issue Aug 30, 2011 · 6 comments
Labels
auto-locked Outdated issues that have been locked by automation C: logging Information Logging type: enhancement Improvements to functionality

Comments

@nisavid
Copy link

nisavid commented Aug 30, 2011

PyPI has apparently been down lately, and my attempts at pip search result in unhandled exceptions:

$ pip search distribute
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 33, in run
    pypi_hits = self.search(query, index_url)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 44, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1294, in single_request
    response = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1027, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 407, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.7/socket.py", line 447, in readline
    data = self._sock.recv(self._rbufsize)
timeout: timed out
$ pip search distribute
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 33, in run
    pypi_hits = self.search(query, index_url)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 44, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 811, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 773, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 754, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
error: [Errno 101] Network is unreachable

the messages are noisy and not very helpful. it would be better if pip caught the exceptions and reported the errors cleanly, identifying which addresses cannot be reached.

@kennethreitz
Copy link
Contributor

👍

@mihneadb
Copy link

I fixed this issue in my 3rd commit in this pull request [1].

[1] #580

@kennethreitz
Copy link
Contributor

<3

@lepture
Copy link

lepture commented Jun 16, 2012

👍

@daenney
Copy link

daenney commented Nov 3, 2013

There's also this one:

  Error <urlopen error timed out> while getting https://pypi.python.org/packages/source/d/dotfiles/dotfiles-0.6.0.tar.gz#md5=270d6043656efdac935d2a02225788f8 (from https://pypi.python.org/simple/dotfiles/)
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1092, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1238, in unpack_url
    retval = unpack_http_url(link, location, self.download_cache, self.download_dir)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/download.py", line 602, in unpack_http_url
    resp = _get_response_from_url(target_url, link)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/download.py", line 638, in _get_response_from_url
    resp = urlopen(target_url)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/download.py", line 176, in __call__
    response = self.get_opener(scheme=scheme).open(url)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/download.py", line 155, in https_open
    return self.do_open(self.specialized_conn_class, req)
  File "/usr/local/opt/pyenv/versions/2.7/lib/python2.7/urllib2.py", line 1148, in do_open
    raise URLError(err)
URLError: <urlopen error timed out>

@dstufft
Copy link
Member

dstufft commented Mar 22, 2017

Closing this issue, we've entirely rewritten this part of pip and PyPI has gotten much better to the point that this issue is not being hit enough to warrant fixing it.

@dstufft dstufft closed this as completed Mar 22, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: logging Information Logging type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

6 participants