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 (-vvv option).
  • 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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
abeguncommented, Jun 8, 2021

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.)

  1. Clone the fork
  2. Run “poetry install” from the source directory you just pulled down
  3. Run “poetry shell”
  4. Go to your directory that you want to run poetry
  5. Run “python -m poetry [command]”

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.

0reactions
dimblebycommented, Oct 23, 2022

poetry 1.2 includes retries, this can be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection Error When Adding Any New Package With Poetry
Whenever I try to add a new package with poetry (using poetry add ... ConnectionResetError(104, 'Connection reset by peer')) at ...
Read more >
Commands | master | Documentation | Poetry - Python ...
The install command reads the pyproject.toml file from the current project, ... previously built with the build command, to the remote repository.
Read more >
cURL error 56 - Connection reset by peer, errno 104
I got this error “cURL error 56: OpenSSL SSL_read: Connection reset by peer, ... It should normally end with a message saying Your...
Read more >
ssh connection "client_loop: send disconnect: Broken pipe" or ...
Sometimes I cannot login and get the message "Connection reset by port 22", when I can login I get the error message "client_loop:...
Read more >
SSH connection problem with "Host key verification failed ...
"Host key verification failed" means that the host key of the remote host was changed. SSH stores the host keys of the remote...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found