Skip to content
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

Poetry Install fails when remote repo sends ConnectionReset #3572

Closed
2 of 3 tasks
jjeff07 opened this issue Jan 14, 2021 · 6 comments
Closed
2 of 3 tasks

Poetry Install fails when remote repo sends ConnectionReset #3572

jjeff07 opened this issue Jan 14, 2021 · 6 comments
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected

Comments

@jjeff07
Copy link

jjeff07 commented Jan 14, 2021

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

@jjeff07 jjeff07 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 14, 2021
@hagaika
Copy link

hagaika commented Jan 24, 2021

related to #3219

few of my colleagues are having the same issue, sometimes getting TimeoutError

@abegun
Copy link

abegun commented 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.

@tfishr
Copy link

tfishr commented Jan 20, 2022

Although the abegun fork is getting behind now, it still can work on the latest version of poetry. You can clone the official poetry, manually apply the patch to pypi_repository.py from this fork onto whatever branch of the official repo you like, and then follow the rest of the instructions above to be able to run poetry install.

Without this patch, poetry install works only on my slower computers. On my new computer I keep getting ConnectionResetError/ConnectionError and it just doesn't work until it has this patch applied first. This happens on all operating systems I have tried it on. Apparently requires an Intel EVO 11th Gen Intel Core i7-1185G7.

@TNonet
Copy link

TNonet commented Aug 16, 2022

Can we open this as a PR? I am hitting this same issue.

@dimbleby
Copy link
Contributor

poetry 1.2 includes retries, this can be closed

@neersighted neersighted added area/installer Related to the dependency installer and removed status/triage This issue needs to be triaged labels Oct 23, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

7 participants