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

'poetry add wasmer' and 'show --outdated' hang forever on macOS #3370

Closed
2 tasks done
intgr opened this issue Nov 17, 2020 · 15 comments
Closed
2 tasks done

'poetry add wasmer' and 'show --outdated' hang forever on macOS #3370

intgr opened this issue Nov 17, 2020 · 15 comments
Labels
kind/bug Something isn't working as expected

Comments

@intgr
Copy link
Contributor

intgr commented Nov 17, 2020

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

On macOS this is how I could reproduce the hang:

  • poetry init -n
  • poetry add wasmer

Also, if I already have wasmer in my project dependencies, then poetry show --outdated hangs forever.

However, on Linux I could not reproduce the issue, so there seems to be something macOS specific.

This is different from the other hang I reported in #3200. In the case of #3200, the bug cannot be triggered via Poetry CLI and there's a simple workaround. In this case I'm using Poetry CLI as designed and I have not found any workarounds.

% poetry init -n
[...]
% time poetry add -vvv wasmer
Creating virtualenv test-y5X0okRo-py3.9 in /Users/marti.raudsepp/Library/Caches/pypoetry/virtualenvs
Using virtualenv: /Users/marti.raudsepp/Library/Caches/pypoetry/virtualenvs/test-y5X0okRo-py3.9
^Cpoetry add -vvv wasmer  0.92s user 3.63s system 0% cpu 12:56.92 total
@intgr intgr added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 17, 2020
@sinoroc
Copy link

sinoroc commented Nov 17, 2020

As a point of comparison, have you already tried with pip? If not, can you try? How does it behave?

@intgr
Copy link
Contributor Author

intgr commented Nov 17, 2020

pip has no issue with it

% pip install wasmer
Collecting wasmer
  Downloading wasmer-0.4.1-py3-none-any.whl (1.3 kB)
Installing collected packages: wasmer
Successfully installed wasmer-0.4.1

@sinoroc
Copy link

sinoroc commented Nov 17, 2020

And this happens only with poetry add wasmer? If you add wasmer by hand to pyproject.toml then run poetry update or poetry install, are there issues as well?

@intgr
Copy link
Contributor Author

intgr commented Nov 18, 2020

If I add it to pyproject.toml manually then poetry update/lock/install commands keep spinning at Resolving dependencies... (56.1s). I tried specifying with version "*" as well as a few concrete version numbers.

@sinoroc
Copy link

sinoroc commented Nov 18, 2020

If I add it to pyproject.toml manually then poetry update/lock/install commands keep spinning at Resolving dependencies... (56.1s)

Do you have the verbose output (-vvv) of this? In case it might be helpful for the maintainers to try and debug this later.

@intgr
Copy link
Contributor Author

intgr commented Nov 18, 2020

Ah indeed, poetry add -vvv did not give extra information, but poetry lock -vvv outputs this:

% poetry lock -vvv
Using virtualenv: /Users/marti.raudsepp/Library/Caches/pypoetry/virtualenvs/app-y5X0okRo-py3.9
Updating dependencies
Resolving dependencies...
   1: fact: app is 1.0.0
   1: derived: app
   1: fact: app depends on wasmer (*)
   1: selecting app (1.0.0)
   1: derived: wasmer (*)
^C   1: Version solving took 55.898 seconds.
   1: Tried 1 solutions.

@sinoroc
Copy link

sinoroc commented Nov 18, 2020

I do not know where to go from there. Some things to try:

  • without the new installer: poetry config experimental.new-installer false
  • with older poetry (1.0.*)

@finswimmer
Copy link
Member

Hm, no problem here. wasmer gets installed immediately. 🤔

@intgr
Copy link
Contributor Author

intgr commented Nov 19, 2020

@finswimmer Did you test on macOS as well?

At one point resolving wasmer must have worked on my machine since I have a project using it. But I have no idea what changed since then.

I tried disabling new-installer and downgrading Poetry as suggested by @sinoroc.

I also tried downgrading to Python 3.8, that also did not fix the issue.

@sinoroc
Copy link

sinoroc commented Nov 19, 2020

Some other ideas to look into:

  • Inspect the content of the site-packages directory for the current environment, in particular look for things like in this comment in another ticket and the ~asm or -asm files or directories.
  • Recreate the environment from scratch.
  • Try different installation methods for poetry itself. Which method have you used so far by the way, get-poetry.py, pipx, something else?

[I hope I do not ask the same questions twice, questions whose answers you already gave, or questions whose answers are obvious, and so on.]

@m0xb
Copy link

m0xb commented Nov 6, 2021

This is an issue for me as well. I'm a new user, looking at switching from Pipenv to Poetry. I'm using Poetry 1.1.11 on macOS Big Sur (M1) and Python 3.9. Installed today with curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

I've setup the demo with poetry new poetry-demo. Then, running poetry add -vvv requests hangs:

$ poetry add -vvv requests
Using virtualenv: /Users/immelol/Library/Caches/pypoetry/virtualenvs/poetry-demo-6vpDfws1-py3.9
^C
$

Similar to the above, poetry remove -vvv sh gives me more clues. "Resolving dependencies" is extremely slow. It's been running for 50+ minutes now and it looks like it's still running. From the verbose logs, looks like it's pulling information from PyPI, e.g. the last one is "PyPI: Getting info for pyparsing (2.4.7) from PyPI".

Installing with pip is no problem. So far, I've run into this with every package I've tried: pex, requests, and sh.

@bambu
Copy link

bambu commented Dec 10, 2021

I have this same problem. In my case wasmer works. However capstone does not. I was able to track the issue down to the creation of the session in pypi_repository.py.

Replacing:

def session(self):
          return CacheControl(requests.session(), cache=self._cache_control_cache)

with

def session(self):
          return requests.Session()

resolves the issue.

No experience with what the CacheControl adapter may be doing to make the session fail intermittently.

@dimbleby
Copy link
Contributor

dimbleby commented Sep 2, 2022

probably duplicate #6030 in which we learned that cachecontrol uses lockfiles and, presumably, if you hit Ctrl-C or similar at an unfortunate moment then that lockfile gets left lying around - at which point you are stuck until you remove it.

@neersighted
Copy link
Member

Closing as a duplicate for now as this is stale and there's no consistent reproduction.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Sep 18, 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

8 participants