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

virtualenv (20.16.5) from archive virtualenv-20.16.5-py3-none-any.whl not found in known hashes #6652

Closed
Corfucinas opened this issue Sep 29, 2022 · 5 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@Corfucinas
Copy link

  • Poetry version: Poetry (version 1.2.1)
  • Python version:
Poetry
Version: 1.2.1
Python:  3.10.2

Virtualenv
Python:         3.10.2
Implementation: CPython
Path:           /home/the-box/.venv
Executable:     /home/the-box/.venv/bin/python
Valid:          True

System
Platform:   linux
OS:         posix
Python:     3.10.2
Path:       /home/the-box/.pyenv/versions/3.10.2
Executable: /home/the-box/.pyenv/versions/3.10.2/bin/python3.10
  • OS version and name: Linux 5.15.0-50-generic x86_64
  • pyproject.toml:
[tool.poetry.dependencies]
aiokafka = "^0.7.2"
httpx = {extras = ["http2", "brotli", "socks"], version = "^0.23.0"}
loguru = "^0.6.0"
python = "^3.10"
# kafka compression/decompression
alembic = "^1.8.1"
lz4 = "^4.0.2"
xxhash = "^3.0.0"
# enable optimized CRC32 checksum validation
crc32c = "^2.3"
pydantic = {extras = ["email", "dotenv"], version = "^1.10.2"}
sqlmodel = "^0.0.8"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
black = "^22.6"
commitizen = "^2.29.2"
mypy = "^0.971"
nox = "^2022.1.7"
nox-poetry = "^1.0.1"
perflint = "^0.7.3"
pre-commit = "^2.20.0"
wemake-python-styleguide = "^0.16.0"

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
hypothesis = "^6.54.5"
pytest = "^7.0.0"
pytest-asyncio = "^0.19.0"
pytest-automock = "^0.9.0"
pytest-benchmark = "^3.4.1"
pytest-cov = "^3.0.0"
pytest-httpx = "^0.21.0"
pytest-mock = "^3.8.2"
safety = "^2.1.1"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
Sphinx = "^5.1.1"
furo = "^2022.6.21"
sphinx-copybutton = "^0.5.0"
sphinxcontrib-spelling = "^7.6.0"
sphinxext-opengraph = "^0.5.1"

  • [ x] I am on the latest stable Poetry version, installed using a recommended method.
  • [ x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] I have consulted the FAQ and blog for any relevant entries or release notes.
  • [ x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.
Package operations: 75 installs, 0 updates, 0 removals

  • Installing virtualenv (20.16.5): Pending...
  • Installing virtualenv (20.16.5): Failed

  Stack trace:

  6  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:253 in _execute_operation
      251│ 
      252│             try:
    → 253│                 result = self._do_execute_operation(operation)
      254│             except EnvCommandError as e:
      255│                 if e.e.returncode == -2:

  5  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:326 in _do_execute_operation
      324│             return 0
      325│ 
    → 326│         result: int = getattr(self, f"_execute_{method}")(operation)
      327│ 
      328│         if result != 0:

  4  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:446 in _execute_install
      444│ 
      445│     def _execute_install(self, operation: Install | Update) -> int:
    → 446│         status_code = self._install(operation)
      447│ 
      448│         self._save_url_reference(operation)

  3  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:480 in _install
      478│             archive = self._download_link(operation, Link(package.source_url))
      479│         else:
    → 480│             archive = self._download(operation)
      481│ 
      482│         operation_message = self.get_operation_message(operation)

  2  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:639 in _download
      637│             self._yanked_warnings.append(message)
      638│ 
    → 639│         return self._download_link(operation, link)
      640│ 
      641│     def _download_link(self, operation: Install | Update, link: Link) -> Path:

  1  ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:660 in _download_link
      658│ 
      659│         if package.files:
    → 660│             archive_hash = self._validate_archive_hash(archive, package)
      661│ 
      662│             self._hashes[package.name] = archive_hash

  RuntimeError

  Hash for virtualenv (20.16.5) from archive virtualenv-20.16.5-py3-none-any.whl not found in known hashes (was: sha256:ae7fa9be45f00e191ad889a6245b83557cdf4e2ee0695c5be4c435b34c040d1e)

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:673 in _validate_archive_hash
      669│         archive_hash: str = "sha256:" + file_dep.hash()
      670│         known_hashes = {f["hash"] for f in package.files}
      671│ 
      672│         if archive_hash not in known_hashes:
    → 673│             raise RuntimeError(
      674│                 f"Hash for {package} from archive {archive.name} not found in"
      675│                 f" known hashes (was: {archive_hash})"
      676│             )
      677│ 

Issue

I cannot run poetry update --with test,doc,dev since it fails with


  RuntimeError

  Hash for virtualenv (20.16.5) from archive virtualenv-20.16.5-py3-none-any.whl not found in known hashes (was: sha256:ae7fa9be45f00e191ad889a6245b83557cdf4e2ee0695c5be4c435b34c040d1e)

@Corfucinas Corfucinas added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 29, 2022
@neersighted
Copy link
Member

ae7fa9be45f00e191ad889a6245b83557cdf4e2ee0695c5be4c435b34c040d1e is indeed not d07dfc5df5e4e0dbc92862350ad87a36ed505b978f6c39609dc489eadd5b0d27 (from https://pypi.org/project/virtualenv/#copy-hash-modal-c9dd8ce7-a905-4e5f-8cb4-d59a5291af3c) -- looks like you have a corrupt cache.

Try blowing away the artifact cache and things should work just fine (rm -rf ~/.cache/pypoetry/artifacts)

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 29, 2022
@neersighted
Copy link
Member

Also -- keep in mind for future bug reports that your OS version (not just kernel version) is important for reproduction, as is a better description of your issue (and why you think it is a bug)/what troubleshooting steps you have done. If you're not sure it's a bug/how to troubleshoot, I suggest starting with a Discussion or Discord question first.

@Corfucinas
Copy link
Author

Thanks, your solution worked

@nowanti
Copy link

nowanti commented Jan 12, 2023

ae7fa9be45f00e191ad889a6245b83557cdf4e2ee0695c5be4c435b34c040d1e is indeed not d07dfc5df5e4e0dbc92862350ad87a36ed505b978f6c39609dc489eadd5b0d27 (from https://pypi.org/project/virtualenv/#copy-hash-modal-c9dd8ce7-a905-4e5f-8cb4-d59a5291af3c) -- looks like you have a corrupt cache.

Try blowing away the artifact cache and things should work just fine (rm -rf ~/.cache/pypoetry/artifacts)

I manually interrupted the task while executing not found in known install, and then encountered the error of not found in known hashes. The problem is solved in the above way. Thank you.

May be used: poetry config cache- dir

Poetry version == 1.2.2

Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

3 participants