-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 is stuck on specific dependency with "pending..." #3352
Comments
Maybe it would be helpful to see the |
Unfortunately, I cannot share the pyproject.toml as it contains a lot of proprietary names.
As noted above, mac OS 10.15.7 (catalina)
It does indeed hang on the same dependency every time. One other interesting thing to note: |
Same issue here. I just upgrade from v1.0.0, but got pending on some packages during installing , typically numpy , sklearn... The error message shows it got a read time out from my nexus repo, but it never happened before. And after I try the poetry install several times, it installed all package successfully. Does the parallel installation trigger this issue? |
I do not know how to help you all here... My advice would be to try one of those (maybe in that order) if you have not yet:
Also maybe provide some verbose output ( |
I do experience the same problem with poetry 1.1.4 within a python 3.9 docker container. The error goes away by following the suggestion of @sinoroc to deactivate the experimental installer. pyproject.toml:
|
I can confirm that disabling the experimental parallel installer worked. My environment, although, was Docker, particularly the python:3.8-slim image. |
Same problem here, and disabling the experimental installer fixed it for me, too. My environment is this docker image:
|
Could someone on the Poetry team provide a perspective on prioritization for this? It seems like there's meaningful evidence that this is an issue independent of environment or dependencies. Turning off the installer is a good workaround in the interim, but it significantly increases install times. I'd love to know I have some hope of being able to turn it back on at some point. |
Disabling experimental installer also fixes this for me, but also able to fix it using the experimental installer by adding a timeout for the requests to pypi, E.g. diff --git a/poetry/repositories/pypi_repository.py b/poetry/repositories/pypi_repository.py
index 1c7b7be3..a1f0922a 100644
--- a/poetry/repositories/pypi_repository.py
+++ b/poetry/repositories/pypi_repository.py
@@ -321,14 +321,14 @@ class PyPiRepository(RemoteRepository):
return data.asdict()
- def _get(self, endpoint: str) -> Union[dict, None]:
+ def _get(self, endpoint: str, timeout: int = 5) -> Union[dict, None]:
try:
- json_response = self.session.get(self._base_url + endpoint)
+ json_response = self.session.get(self._base_url + endpoint, timeout=timeout)
except requests.exceptions.TooManyRedirects:
# Cache control redirect loop.
# We try to remove the cache and try again
self._cache_control_cache.delete(self._base_url + endpoint)
- json_response = self.session.get(self._base_url + endpoint)
+ json_response = self.session.get(self._base_url + endpoint, timeout=timeout)
if json_response.status_code == 404:
return None
|
Happens on WSL2 ubuntu 20.04 with python3.10 |
Recent issues possibly related to discussion happening in #2094 |
On Ubuntu 20.04 WSL2 here. Only disabling IPv6 did the trick: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 |
#3352 (comment) suggests a very plausible fix, perhaps someone would like to submit an MR. |
The error is still prevalent in v1.2.0. Deactivating the experimental installer solves the issue for now. However, a more thorough solution would be appreciated. |
so far as I can see this thread contains no way to reproduce the problem. Please provide a repro, if you have one. |
I'm going to close this as it is years old and crosses over many versions (and the old and new installers)! For anyone coming across this, if you can reproduce this in a consistent way, please open an issue for the specific case you are having trouble with. |
@neersighted timeouts were added in 584aaee via #5881, they were mentioned above as a potential (or at the very least they are probably hiding the underlying issue now, and it's just slower than it should be rather than stuck). |
There's multiple underlying causes both theorized and fixed in this issue -- that's why I'd like anybody who can consistently reproduce this behavior to open a new issue so we can reason about any specific instance or fix in one place. |
I think I can recreate this issue. If a user is waiting for ssl certificates too long the lock seems to get enabled. After that it will hang forever waiting for unlocks. Turning off the parallel will fix it either way but maybe this is a way to help recreate the issue. |
it also happens under:
traceback:
workaround:
it started to happen this week, last week the same command(s) worked fine 🤔 |
If you can reproduce this reliably in a container or clean environment, please open a new issue with the reproduction. There are many possible factors from cache corruption, network issues, etc that could influence this, so a clean reproduction is key. |
FWIW I deleted my poetry cache and artifacts ( |
@Purg thank you sire! i've been stuck on this for hours... i tried all these:
|
The reason for corrupted caches is either:
Both of these will not be backported to 1.2 as they are new changes to Poetry behavior/not fixes for regressions, but they will be available in the near future, and you can test them today by installing from |
my last question: what's the difference between $ poetry cache list
$ poetry cache clear --all pypi and
? |
|
artifacts are just |
Artifacts are distfiles (wheels, sdists) and can be corrupted by an interrupted Poetry (ctrl-c, machine shutdown) as well as a concurrent Poetry. This will be fixed in the 1.3 release. |
I had problems with this due to "Connection pool is full, discarding connection: pypi.org. Connection pool size: 10". It helped to set |
The artifacts and cache dirs were in
Doing that cleared things up for me. Before that, it was consistently hanging on trying to fetch |
You can always find the cache directory with I would ask that if you don't have anything to add that hasn't already been said in this issue, you hold off, as generating notifications for 20+ people for a root cause that is solved is unnecessary (and if you have something novel, we want to identify that and make sure it's tracked as a new issue). |
This solution helped me. Thank you. |
I'm facing this issue in the latest Poetry version.
|
In my case deactivating the new (parallel) installer solved the problem. It was stuck on installing |
If deactivating the new installer helps, you have a corrupted artifact cache. Please If, after doing the following, you still reproduce on the latest version of Poetry, please open a new issue so we can fix bugs in the new installer:
|
-vvv
option).Issue
Hello poetry crew. Loving the work that yall do!
I am having issues with poetry while running
poetry install
in one of my projects on one specific machine.It appears to get stuck on one dependency during the install and it will hang forever. When I kill the process, I see this in my shell (hinting at a race condtion/locking problem):
I am on the latest poetry (1.1.4) and have tried 1.1.3 as well with the same results (all of which while running python 3.6.8 (I did use 3.6.5 as well)).
After downgrade to 1.0.9, I no longer faced this issue. I am assuming that there was an update to the way poetry can download multiple deps at the same time. Anyone else facing locking issues? At the very least, poetry should recognize a pending download with no progress being made to exit and fail early, but it simply hung and would never exit (left it going for at least 30 mins).
The text was updated successfully, but these errors were encountered: