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

Invalid hashes errors on fresh install #4883

Closed
3 tasks done
vikigenius opened this issue Dec 11, 2021 · 7 comments
Closed
3 tasks done

Invalid hashes errors on fresh install #4883

vikigenius opened this issue Dec 11, 2021 · 7 comments
Labels
status/duplicate Duplicate issues

Comments

@vikigenius
Copy link

  • 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).
  • Linux 5.15.7_1:
  • Poetry version 1.1.12:
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Tried installing to a venv with a clean install of poetry. I am using pyenv to maintain python versions so I do:

pyenv local 3.9.7
poetry env use 3.9.7
poetry install 

This leads to the error

  • Installing torch (1.10.0): Failed

  RuntimeError

  Invalid hashes (sha256:d77fc0e3a4a702b06f591d5276778e9ed8fad2176ffcb4d2cb6b46beb374b5d1) for torch (1.10.0) using archive torch-1.10.0-cp39-cp39-manylinux1_x86_64.whl. Expected one of sha256:034df0b20603bfc81325094586647302891b9b20be7e36f152c7dd6af00deac1, sha256:13e1ffab502aa32d6841a018771b47028d02dbbc685c5b79cfd61db5464dae4e, sha256:3c0a942e0df104c80b0eedc30d2a19cdc3d28601bc6e280bf24b2e6255016d3b, sha256:4499055547087d7ef7e8a754f09c2c4f1470297ae3e5490363dba66c75501b21, sha256:56022b0ce94c54e95a2f63fc5a1494feb1fc3d5c7a9b35a62944651d03edef05, sha256:67fc509e207b8e7330f2e76e77800950317d31d035a4d19593db991962afead4, sha2
56:9013002adcb42bac05dcdbf0a03dd9f6bb5d7ab8b9817041c1176a014870786b, sha256:ab0cf330714c8f79a837c04784a7a5658b014cf5a4ca527e7b710155ae519cdf, sha256:aef7afb62e9b174b4e0e5e1e4a42e3bab3b8490a668d666f62f7d4517559fbf2, sha256:b812e8d40d7037748da40bb695bd849e7b2e7faad4cd06df53d2cc4531926fda, sha256:ca2c88fa4376e2648785029ab108e6e7abd784eb6535fc6036004b9254f9f7c1, sha256:d6185827b285780653cdd81d77a09fdca76a5b190d5986d552be2a5c442cfaa4, sha256:d6ef87470b44df9970e84542547d5ba7720bb89616602441df555a39b124e2bc, sha256:d82e68302c9b5c76ed585e04d61be0ca2184f70cb8ffeba8610570609ad5d7c9, sha256:e01ba5946267014abfdb30248bcdbd457aaa20cff749febe7fc191e5ae096af4, sha256:e5822200bf80a1495ad98a2bb41803eeba4a85ce373e35fc65765f7f888f5374, sha256:eea16c01af1980ba709c00e8d5e6c09bedb5b30f9fa2085f6a52a78d7dc4e125, sha256:eea675ec01ec4b4a0655fd2984f166a5ca3b933dae6ad4eb4e52eba7026dc176.

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py:627 in _download_link
      623│                     )
      624│                 )
      625│
      626│             if archive_hashes.isdisjoint(hashes):
    → 627│                 raise RuntimeError(
      628│                     "Invalid hashes ({}) for {} using archive {}. Expected one of {}.".format(
      629│                         ", ".join(sorted(archive_hashes)),
      630│                         package,
      631│                         archive_path.name,
@vikigenius vikigenius added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 11, 2021
@JeroenDelcour
Copy link

JeroenDelcour commented Dec 14, 2021

I ran into the same issue and fixed it by uninstalling poetry, completely removing Poetry's cache directory, and reinstalling Poetry:

curl -sSL https://install.python-poetry.org | python3 - --uninstall
# if the above command tells you poetry isn't installed, try this instead (poetry's previous installer has recently been deprecated):
# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - --uninstall
rm -r ~/.cache/pypoetry
# if your poetry cache is somewhere else, this tells you where: poetry config --list
curl -sSL https://install.python-poetry.org | python3 -

@c0g
Copy link

c0g commented Dec 17, 2021

I also see this (and for Torch too) in my CI runs. It doesn't happen every time and re-running the CI run usually fixes it. Does poetry support parallel installs or is there a chance the cache is getting over-written or something?

@jbiams77
Copy link

I am also seeing this when running parallel installs. Setting this config experimental.new-installer false and this config installer.parallel false will not resolve.

@hopper-signifyd
Copy link

I'm able to consistently reproduce this issue by doing something like this:

  1. Create two projects A and B such that A depends on B.
  2. Remove the poetry cache (and the .venv folders for A and B if those already exist)
  3. Run poetry install on both projects simultaneously.

This produces the "invalid hashes" error mentioned in the original post if one project tries to read a package from the Poetry cache while the other project is in the process of writing it to the Poetry cache.

Setting installer.parallel to false doesn't do anything here since these poetry processes are running independently of one another. Does anyone have any suggestions on how to work around this?

@TNonet
Copy link

TNonet commented Aug 24, 2022

I find this happens using https://github.com/enpaul/tox-poetry-installer since tox makes it very easy to run environments in parallel. I don't have a workaround at the moment.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 5, 2022

duplicated at #5142, fixed at #6186

@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 5, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 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
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

8 participants