Poetry Install fails when remote repo sends ConnectionReset
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name:
- Poetry version: 1.1.4
- Link of a Gist with the contents of your pyproject.toml file:
Issue
When a Python repo is having issues and sends a Connection Reset during the a fresh poetry install the installation errors and does not retry.
Creating virtualenv package-z2q3sM71-py3.8 in /root/.cache/pypoetry/virtualenvs Updating dependencies Resolving dependencies… ConnectionError (‘Connection aborted.’, ConnectionResetError(104, ‘Connection reset by peer’)) at /usr/local/lib/python3.8/site-packages/requests/adapters.py:498 in send 494│ low_conn.close() 495│ raise 496│ 497│ except (ProtocolError, socket.error) as err: → 498│ raise ConnectionError(err, request=request) 499│ 500│ except MaxRetryError as e: 501│ if isinstance(e.reason, ConnectTimeoutError): 502│ # TODO: Remove this in 3.0.0: see #2811
It would be nice to catch this exception and have a flag to have it retry X amount of times before failing.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:5 (1 by maintainers)
Top Related StackOverflow Question
Are you still hitting this issue? We also hit issues like this consistently on some of our packages. If you are still hitting it, I forked Poetry a while back to experiment with a change to help with the issues we were hitting with intermittent request failures: https://github.com/abegun/poetry. The change is simply to configure retry logic in the request library to not fail immediately.
If you want to try it, would be great to see if this works for others (it is rock solid for myself and teammates who are hitting similar issues.)
I’m not a Poetry dev so the above steps for running a local version of poetry might not be official but have worked for me.
One gotcha -ensure you like the active version of python when you do step #2 since the local version of poetry’s environment will use that.
poetry 1.2 includes retries, this can be closed