-
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
Cache artifacts become corrupted if I terminate with control-c "poetry add ..." while package is being downloaded #6886
Comments
Here's the $ poetry add -vvv plotly Loading configuration file /Users/munro/Library/Preferences/pypoetry/config.toml
Creating virtualenv poetry-testtt in /Users/munro/poetry-testtt/.venv
Using virtualenv: /Users/munro/poetry-testtt/.venv
Using version ^5.10.0 for plotly
Updating dependencies
Resolving dependencies...
1: fact: poetry-testtt is 0.1.0
1: derived: poetry-testtt
1: fact: poetry-testtt depends on tqdm (^4.64.1)
1: fact: poetry-testtt depends on plotly (^5.10.0)
1: selecting poetry-testtt (0.1.0)
1: derived: plotly (>=5.10.0,<6.0.0)
1: derived: tqdm (>=4.64.1,<5.0.0)
1: fact: plotly (5.10.0) depends on tenacity (>=6.2.0)
1: selecting plotly (5.10.0)
1: derived: tenacity (>=6.2.0)
1: fact: tqdm (4.64.1) depends on colorama (*)
1: selecting tqdm (4.64.1)
1: derived: colorama
1: selecting tenacity (8.1.0)
1: selecting colorama (0.4.6)
1: Version solving took 0.043 seconds.
1: Tried 1 solutions.
Writing lock file
Finding the necessary packages for the current system
Package operations: 3 installs, 0 updates, 0 removals
• Installing tenacity (8.1.0): Pending...
• Installing tenacity (8.1.0): Installing...
• Installing tenacity (8.1.0)
• Installing plotly (5.10.0): Pending...
• Installing plotly (5.10.0): Failed
Stack trace:
6 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:261 in _execute_operation
259│
260│ try:
→ 261│ result = self._do_execute_operation(operation)
262│ except EnvCommandError as e:
263│ if e.e.returncode == -2:
5 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:334 in _do_execute_operation
332│ return 0
333│
→ 334│ result: int = getattr(self, f"_execute_{method}")(operation)
335│
336│ if result != 0:
4 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:454 in _execute_install
452│
453│ def _execute_install(self, operation: Install | Update) -> int:
→ 454│ status_code = self._install(operation)
455│
456│ self._save_url_reference(operation)
3 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:488 in _install
486│ archive = self._download_link(operation, Link(package.source_url))
487│ else:
→ 488│ archive = self._download(operation)
489│
490│ operation_message = self.get_operation_message(operation)
2 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:647 in _download
645│ self._yanked_warnings.append(message)
646│
→ 647│ return self._download_link(operation, link)
648│
649│ def _download_link(self, operation: Install | Update, link: Link) -> Path:
1 ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:668 in _download_link
666│
667│ if package.files:
→ 668│ archive_hash = self._validate_archive_hash(archive, package)
669│
670│ self._hashes[package.name] = archive_hash
RuntimeError
Hash for plotly (5.10.0) from archive plotly-5.10.0-py2.py3-none-any.whl not found in known hashes (was: sha256:309233ffc975e9ca1d75d21829c1c47ed02965985cba67b01d9b61ad162590e8)
at ~/Library/Application Support/pypoetry/venv/lib/python3.10/site-packages/poetry/installation/executor.py:681 in _validate_archive_hash
677│ archive_hash: str = "sha256:" + file_dep.hash()
678│ known_hashes = {f["hash"] for f in package.files}
679│
680│ if archive_hash not in known_hashes:
→ 681│ raise RuntimeError(
682│ f"Hash for {package} from archive {archive.name} not found in"
683│ f" known hashes (was: {archive_hash})"
684│ )
685│
• Installing tqdm (4.64.1): Pending...
• Installing tqdm (4.64.1): Installing...
• Installing tqdm (4.64.1) |
This is fixed in 1.3; it would be wonderful if you test that version and confirm you can no longer reproduce this, since you are in that 'zone' right now. I'd like to get a 1.3 beta you can install with |
@neersighted ahh cool, I just installed poetry from branch |
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. |
poetry new ...
-vvv
option) and have included the output below.Issue
Hello! Whenever I install any poetry package, and hit control-c while a package is being download, that package becomes corrupted in the the cache.
Here I install some package I don't have currently
Using version ^5.10.0 for plotly Updating dependencies Resolving dependencies... (0.5s) Writing lock file Package operations: 2 installs, 0 updates, 0 removals • Installing tenacity (8.1.0) • Installing plotly (5.10.0): Downloading... 4%
Sending Control-C ...
Trying to install the package again
Clearing the cache seems doesn't seem to work either.
I have to actually delete the cache directory to fix it
And now the package is installed!
It's kinda a nightmare for me if my internet get interrupted when installing lots of dependencies for an app.
The text was updated successfully, but these errors were encountered: