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

Exported requirements.txt fails to install #6041

Closed
3 tasks done
jonathan-boudreau-work opened this issue Jul 20, 2022 · 11 comments
Closed
3 tasks done

Exported requirements.txt fails to install #6041

jonathan-boudreau-work opened this issue Jul 20, 2022 · 11 comments
Labels
kind/bug Something isn't working as expected

Comments

@jonathan-boudreau-work
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).

Issue

When I try to install the exported requirement.txt generated by poetry, pip fails the installation stating there are missing hashes. This only seems to happen when I try to export projects with gql package. More detailed pip logs:

Collecting backoff==2.1.2
  Using cached backoff-2.1.2-py3-none-any.whl (14 kB)
Collecting gql==3.4.0
  Using cached gql-3.4.0-py2.py3-none-any.whl (65 kB)
Collecting graphql-core==3.2.1
  Using cached graphql_core-3.2.1-py3-none-any.whl (202 kB)
Collecting idna==3.3
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting multidict==6.0.2
  Using cached multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
Collecting yarl==1.7.2
  Using cached yarl-1.7.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (308 kB)
ERROR: Hashes are required in --require-hashes mode, but they are missing from some requirements. Here is a list of those requirements along with the hashes their downloaded archives actually had. Add lines like these to your requirements files to prevent tampering. (If you did not enable --require-hashes manually, note that it turns on automatically when any package has a hash.)
    backoff==2.1.2 --hash=sha256:b135e6d7c7513ba2bfd6895bc32bc8c66c6f3b0279b4c6cd866053cfd7d3126b
    gql==3.4.0 --hash=sha256:59c8a0b8f0a2f3b0b2ff970c94de86f82f65cb1da3340bfe57143e5f7ea82f71
@jonathan-boudreau-work jonathan-boudreau-work added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 20, 2022
@dimbleby
Copy link
Contributor

more #5970 fallout for sure. Clear your cache, re-lock, try again.

@defel
Copy link

defel commented Aug 3, 2022

thanks @dimbleby - this fixed it for me

A more verbose description of steps I had to do:

# upgrade poetry to >=1.1.14
pip install --upgrade poetry

# clear caches
poetry cache clear artifact --all
poetry cache clear pypi --all

# remove old lock file
rm poetry.lock

# reinstall (and generate lock-file)
poetry install

@jedie
Copy link

jedie commented Aug 10, 2022

Can confirm this bug.

Only delete poetry.lock but keep the cache results in the same error.
The fix is to clear poetry cache.

Note: The hashes didn't missed only in exported requirement.txt: They also missed in poetry.lock, too.
Here a commit with the difference: YunoHost-Apps/django-fmd_ynh@6316ad7

jedie added a commit to YunoHost-Apps/django-fmd_ynh that referenced this issue Aug 10, 2022
@jedie
Copy link

jedie commented Aug 12, 2022

delete lock file + clear cache seems seems to be not enough. Clear artifact is also needed :(

@dimbleby
Copy link
Contributor

this can be closed

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Aug 19, 2022
@jedie
Copy link

jedie commented Aug 24, 2022

@dimbleby why closed? The problem with missing hashes are still there with poetry v1.1.15
Deleting cache / artifact is a work-a-round, but didn't work all the time :(

@jedie
Copy link

jedie commented Aug 24, 2022

Closed because of: #4523 ?

@dimbleby
Copy link
Contributor

closed because this was clearly a duplicate of #5970, and it is resolved by clearing your cache, updating poetry, and re-locking

@jedie
Copy link

jedie commented Aug 25, 2022

Thanks for the feedback. My suggestion is to always mention the reason when closing and link to an OR or an other ticket. Then there will be no misunderstandings ;)

@dimbleby
Copy link
Contributor

The entire meaningful content of this thread was "here's how to fix it", "thanks that fixed it". Thanks anyway,

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
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

6 participants