Repository navigation
Closed
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Description
-
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 (
-vvvoption). -
OS version and name: macOS 10.15
-
Poetry version: 1.2.0a1
-
Link of a Gist with the contents of your pyproject.toml file:
Issue
Hi! I'm testing new 1.2.0a1 version as an early-adopter to find potential issues.
My pyproject.toml defines a secondary repo:
[[tool.poetry.source]]
name = "XXX"
url = "https://pypi.XXX.YYY"
secondary = trueAnd I have one dependency which comes from this private pypi repo. Poetry 1.1.3 installed it without errors, but on 1.2.0a1 I get this stacktrace:
• Installing FOOBAR (1.7.2): Pending...
• Installing FOOBAR (1.7.2): Failed
Stack trace:
5 ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:244 in _execute_operation
242│
243│ try:
→ 244│ result = self._do_execute_operation(operation)
245│ except EnvCommandError as e:
246│ if e.e.returncode == -2:
4 ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:321 in _do_execute_operation
319│ return 0
320│
→ 321│ result = getattr(self, f"_execute_{method}")(operation)
322│
323│ if result != 0:
3 ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:462 in _execute_install
460│
461│ def _execute_install(self, operation: Union[Install, Update]) -> int:
→ 462│ status_code = self._install(operation)
463│
464│ self._save_url_reference(operation)
2 ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:498 in _install
496│ archive = self._download_link(operation, Link(package.source_url))
497│ else:
→ 498│ archive = self._download(operation)
499│
500│ operation_message = self.get_operation_message(operation)
1 ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:648 in _download
646│ link = self._chooser.choose_for(operation.package)
647│
→ 648│ return self._download_link(operation, link)
649│
650│ def _download_link(self, operation: Union[Install, Update], link: Link) -> Link:
AttributeError
'Link' object has no attribute 'name'
at ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:683 in _download_link
679│ ).hash()
680│ )
681│ if archive_hash not in {f["hash"] for f in package.files}:
682│ raise RuntimeError(
→ 683│ f"Invalid hash for {package} using archive {archive.name}"
684│ )
685│
686│ self._hashes[package.name] = archive_hash
687│
If you need any additional info to better understand the issue, I'll be happy to provide it.
Reacted by Simon Schmidt, Adrian Mace, Rustam, Mustafa Alghali, Michal Florian, Jeremy Richards, Pieter Marsman, Peder Bergebakken Sundt, Misha Bergal and Saeyeol Lee
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working as expectedSomething isn't working as expected
Activity
maksbotan commentedon May 22, 2021
If I delete
poetry.lockcompletely (which was generated with 1.1.3 and then updated with 1.2.0a1 bypoetry lock --no-update), I get this error:TribuneX commentedon Jun 1, 2021
We are seeing the same issue with one of our projects using
1.2.0a1iwoloschin commentedon Jun 12, 2021
I saw the same issue, if I manually add the sha256 hash to poetry.lock it appears to work. I'm not sure why, but the one package I'm trying to install from a secondary repo is the only one in poetry.lock to have an md5sum instead.
Fix AttributeError on hash mismatch
Fix AttributeError on hash mismatch
Fix AttributeError on hash mismatch
paulmelnikow commentedon Jul 8, 2021
I've opened a PR to generate this error message properly: #4212.
I'm experiencing the underlying issue in Poetry 1.2.0a1. I'm installing a package from a private Gemfury repository.
Gemfury's legacy PyPI API returns only md5 hashes, not sha256 hashes. (By comparison, JFrog had a similar limitation until recently.) My lockfile contains only sha256 hashes, hence the mismatch error at install time.
In contrast, Poetry 1.1.7 works fine. A lockfile generated by 1.1.7 also contains the sha256 hashes, yet installation works fine.
Is it possible this is a regression caused by the changes in #2958?
rgmz commentedon Jul 16, 2021
We're seeing the same issue with a private Nexus Repository repository. Switching to 1.1.7 resolves the issue.
covuworie commentedon Aug 1, 2021
Seeing a similar issue with
poetry 1.2.0a1withpython 3.8.2when a new project is created with the following minimalpyproject.tomlfile:Running
poetry installorpoetry lockgives the following error:Note there are no dependencies in the
pyproject.tomlfile. In addition to standard install of python, the only other package installed ispoetry-dotenv-pluginand it's dependencies. Here is apip listif needed:paulmelnikow commentedon Aug 3, 2021
I just started seeing this
can't set attributetoo. This is separate from the issue being documented here. It's the same version of Poetry I was using before, so I imagine it's related to one of the dependencies.covuworie commentedon Aug 3, 2021
@paulmelnikow Thanks. Would like me to create a separate issue then? I thought this issue was similar and just didn't want to create a duplicate.
paulmelnikow commentedon Aug 3, 2021
I'm not a maintainer, but I've been meaning to report the "can't set attribute" error and do think it belongs in its own issue.
covuworie commentedon Aug 3, 2021
Oh sorry for the confusion. I'll extract it as a separate issue and link this as a related issue.
33 remaining items
pietermarsman commentedon Dec 29, 2021
I was (finally!) able to solve this for torch 1.10.0. I removed poetry completely (using
locate poetryto find everything) and after a fresh install it worked again.For reference: these PR and SO post helped me.
Bash commands I executed to uninstall poetry completely:
Cielquan commentedon Jan 23, 2022
I get the same issue too with 1.2.0a2 if I install via the new install_poetry.py script. If I install poetry into a venv with
pip install poetry==1.2.0a2I do not get this issue somehow. But I then get warnings when using poetry:And I do not use a secondary repo at all.
fix: change poetry verison to 1.1.8
kyleaclark commentedon Feb 21, 2022
For what it's worth, the hash issue listed below from a failed docker build has been resolved as of Poetry
1.1.10. Also confirmed working as expected with versions1.1.11,1.1.12, and1.1.13.The issue was known to break our builds using Poetry
1.1.5and1.1.9(did not test other versions in between). Otherwise, we had to revert to an older version1.0.9to get around the hash issue.try to fix poetry bug python-poetry/poetry#4085 using another lock file
dimbleby commentedon May 21, 2022
This was fixed in #4531, I reckon
neersighted commentedon May 23, 2022
Agreed, I cannot reproduce on current master. Please request a re-open if this is still affecting you.
sherrywang31 commentedon Sep 1, 2022
I use a secondary repo and I'm having this issue with 1.2.0:
reverting back to 1.1.15 solved the issue.
vad commentedon Sep 6, 2022
@neersighted same issue on poetry 1.2.0 with packages from a local nexus. Can you reopen it?
dimbleby commentedon Sep 6, 2022
This issue describes an attribute error in code that no longer exists, closed is definitely the right state for it.
You want #6301 maybe
vmgustavo commentedon Jan 3, 2023
Same issue on every version I tried after 1.1.15
neersighted commentedon Jan 3, 2023
Please refer to #6301 instead of commenting on resolved issues.