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

Lockfile generation hangs indefinitely when cache is corrupted #5922

Closed
2 of 3 tasks
johnthagen opened this issue Jun 27, 2022 · 7 comments
Closed
2 of 3 tasks

Lockfile generation hangs indefinitely when cache is corrupted #5922

johnthagen opened this issue Jun 27, 2022 · 7 comments
Labels
kind/bug Something isn't working as expected

Comments

@johnthagen
Copy link
Contributor

johnthagen commented Jun 27, 2022

  • 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).

  • OS version and name: macOS 11.6

  • Poetry version: 1.1.13

  • Python version: 3.9.13

Issue

poetry lock will hang indefinitely when trying to resolve a project with django-cors-headers as a dependency.

[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.9"
django-cors-headers = "^3.13.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
$ poetry lock -vvv
Using virtualenv: /Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.9
Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: fact: poetry-test depends on django-cors-headers (^3.13.0)
   1: selecting poetry-test (0.1.0)
   1: derived: django-cors-headers (>=3.13.0,<4.0.0)

<sits frozen here forever>

I hunted this down after a larger project would never resolve dependencies (#2094), and narrowed it down to this single package.

@johnthagen johnthagen added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 27, 2022
@johnthagen johnthagen changed the title Unable to generate lockfile when django-cors-headers included as dependency Lockfile generation hangs indefinitely when django-cors-headers included as dependency Jun 27, 2022
@johnthagen
Copy link
Contributor Author

Perhaps related to PyPI degraded performance?

@dimbleby
Copy link
Contributor

Works fine here.

I've seen similar problems resolved by clearing your cache, you could try that.

Maybe even better: save off your cache directory somewhere and then, if that is the problem, figure out what it was in that directory that caused the issue.

@johnthagen
Copy link
Contributor Author

johnthagen commented Jun 27, 2022

Yes, clearing cache worked:

$ poetry cache clear --all pypi
$ poetry lock -vvv  
Using virtualenv: /Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.9
Updating dependencies
Resolving dependencies...
   1: fact: poetry-test is 0.1.0
   1: derived: poetry-test
   1: fact: poetry-test depends on django-cors-headers (3.12.0)
   1: selecting poetry-test (0.1.0)
   1: derived: django-cors-headers (==3.12.0)
PyPI: 1 packages found for django-cors-headers 3.12.0
PyPI: Getting info for django-cors-headers (3.12.0) from PyPI
   1: fact: django-cors-headers (3.12.0) depends on Django (>=3.2)
   1: selecting django-cors-headers (3.12.0)
   1: derived: Django (>=3.2)
PyPI: No release information found for django-1.0.1, skipping
PyPI: No release information found for django-1.0.2, skipping
PyPI: No release information found for django-1.0.3, skipping
PyPI: No release information found for django-1.0.4, skipping
PyPI: No release information found for django-1.1, skipping
PyPI: No release information found for django-1.1.1, skipping
PyPI: No release information found for django-1.1.2, skipping
PyPI: 20 packages found for django >=3.2
PyPI: Getting info for django (4.0.5) from PyPI
   1: fact: django (4.0.5) depends on asgiref (>=3.4.1,<4)
   1: fact: django (4.0.5) depends on sqlparse (>=0.2.2)
   1: fact: django (4.0.5) depends on tzdata (*)
   1: selecting django (4.0.5)
   1: derived: tzdata
   1: derived: sqlparse (>=0.2.2)
   1: derived: asgiref (>=3.4.1,<4)
PyPI: 15 packages found for tzdata *
PyPI: 8 packages found for sqlparse >=0.2.2
PyPI: 4 packages found for asgiref >=3.4.1,<4
PyPI: Getting info for asgiref (3.5.2) from PyPI
   1: selecting asgiref (3.5.2)
PyPI: Getting info for sqlparse (0.4.2) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: sqlparse-0.4.2-py3-none-any.whl
   1: selecting sqlparse (0.4.2)
PyPI: Getting info for tzdata (2022.1) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading wheel: tzdata-2022.1-py2.py3-none-any.whl
   1: selecting tzdata (2022.1)
   1: Version solving took 4.840 seconds.
   1: Tried 1 solutions.

Writing lock file

I've seen this issue come up before when Ctrl-C'ing Poetry. The cache seems to get into a bad state somewhat easily.

@dimbleby
Copy link
Contributor

Did you keep the problematic cache for investigation? Perhaps you or someone else would debug this, if that is still available.

@johnthagen
Copy link
Contributor Author

johnthagen commented Jun 27, 2022

@dimbleby Unfortunately I did not. I suspect that when Ctrl-C'ing Poetry during install/update/etc a file was saved in a partial, incomplete state.

The last time this happened to me, there was a hash mismatch. This time lock never progressed.

If this happens again, I will attempt to save the cache. Is it documented somewhere how to save the cache?

@dimbleby
Copy link
Contributor

dimbleby commented Jun 27, 2022

it's just a bunch of files, there's no special magic. zip / tar them up. Minimal reproducer much preferred, ie if you can remove things that aren't relevant then all the better.

hash mismatches are at least fairly clear, but hanging is not so good - if we can reproduce that then it would be worth poetry trying to cope better with whatever mess it has found.

@johnthagen johnthagen changed the title Lockfile generation hangs indefinitely when django-cors-headers included as dependency Lockfile generation hangs indefinitely when cache is corrupted Jun 28, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 29, 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
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants