-
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
Intermittent Hash Validation Failures #7881
Comments
Well indeed that's not the correct hash for that file - see https://pypi.org/project/torch/#copy-hash-modal-6e25311f-3fc9-4584-a403-74f06dd31ce3. poetry is protecting you from installing the wrong thing. perhaps you are short of disk space and are getting incomplete downloads. |
Thanks for the help! We checked the kuberenetes pods that we're running this on - we have about 100GB+ of free disk space mounted to the paths that poetry would install to. We were able to dig a bit deeper and did see that one of our dependencies, tensorflow downloaded a wheel that was ~100MB (package on pypi is ~585MB) which makes sense as to why the hash is wrong but we're unable to understand why this is still happening or what could be possible contributors. |
Also experiencing this in docker on macos (poetry 1.5.1, python 3.11)
Other failed packages include pydantic and numpy. pydantic is very small distribution so seems less likely an incomplete download would be to blame here. Not able to reproduce in a linux VM nor docker on a linux VM. |
Again, poetry is correct to refuse to install an archive with the wrong hash. You'll maybe want to inspect the faulty archives - probably available in the poetry cache - and see if you can figure out what's wrong with them and why. But unless you can find a way in which poetry is doing Something Wrong during download - unlikely since it works for almost everyone and after all |
@dimbleby I definitely agree that poetry is doing the Right Thing (TM) regarding the faulty archives. I guess the theory is it is a storage or network issue? I would expect the download to fail outright rather than the hashes to be missing later in the install process? Either way would you please be able to link to docs or suggest a way to identify the actual archive file? Contents of |
|
I would recommend deleting the cache and artifacts folders, deleting your .venv, and running poetry lock. That solved it for me. |
Deleting the poetry artifacts and cache in rm -rf ~/.cache/pypoetry/cache/
rm -rf ~/.cache/pypoetry/artifacts so the remote archive (torch for cpu) seems fine in my case. |
I'm seeing such intermittent hash failures on CI, which is a completely fresh environment, no cache involved. Happens about 1 in 10 runs it seems, and always on the same package
Poetry 1.5.1 (also tested 1.3.1, same issue) |
Experiencing this with Docker on MacOS (Intel) with the
|
#8235 establishes that incomplete-downloads-with-no-apparent-error (because flakey connections) is fixed in the next release, via urllib3 2.0 probably safe to assume that's the primary cause here, close this out, and invite reporting of any further issues after poetry 1.6.0 |
We still see this heavily with 1.6.1. My engineers constantly run into this with Docker builds, and just rerunning the build will magically fix it. At this point I'm going to write a custom wrapper that tries to run poetry 3 times before dying, but ideal would be some flag that retries a download if the hash doesn't match. I agree that this is probably not something poetry is responsible for, but it would be a huge help for those of us suffering this if poetry could handle a few retries on hash failures. |
Still seeing this error
i can solve this by adding
and run |
the hash that poetry reports is indeed the wrong value, so it is correct not to install the wheel probably at some point in the past you have downloaded a partial or corrupt version of the file and that is now in your cache and you should fix by clearing your cache most likely that download happened before #8235 and there is no current bug |
I'm not sure, but will keep an eye on it |
-vvv
option) and have included the output below.Issue
Hi, we are running into an issue where we intermittently see libraries failing to install with the command:
poetry install -vvv --with dev,test --sync
with the following error (torch is an example, this has failed on other libraries):We have seen this mostly occur in Github actions. The relevant steps are:
We see intermittent issues with different libraries failing on hash checks, and retrying with no changes ends up fixing the problem.
We've tried adding steps like:
poetry cache clear . --all
andbut haven't had any luck. Additionally, we've verified that the runner isn't caching data in a way that would be causing issues.
Thank you for any help in advance!
The text was updated successfully, but these errors were encountered: