Closed amal-khailtash closed 2 years ago
After I press CTRL+C, I noticed this message:
^C 1: Version solving took 75.837 seconds.
1: Tried 1 solutions.
[KeyboardInterrupt]
Exception trace:
.venv/lib/python3.7/site-packages/cleo/application.py in run() at line 94
status_code = self.do_run(input_, output_)
.venv/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
.venv/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
status_code = command.run(input_, output_)
.venv/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
.venv/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
status_code = self.execute(input_, output_)
.venv/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
return self.handle()
.venv/lib/python3.7/site-packages/poetry/console/commands/update.py in handle() at line 41
return installer.run()
.venv/lib/python3.7/site-packages/poetry/installation/installer.py in run() at line 76
self._do_install(local_repo)
.venv/lib/python3.7/site-packages/poetry/installation/installer.py in _do_install() at line 158
ops = solver.solve(use_latest=self._whitelist)
.venv/lib/python3.7/site-packages/poetry/puzzle/solver.py in solve() at line 38
packages, depths = self._solve(use_latest=use_latest)
.venv/lib/python3.7/site-packages/poetry/puzzle/solver.py in _solve() at line 171
self._package, self._provider, locked=locked, use_latest=use_latest
.venv/lib/python3.7/site-packages/poetry/mixology/__init__.py in resolve_version() at line 7
return solver.solve()
.venv/lib/python3.7/site-packages/poetry/mixology/version_solver.py in solve() at line 79
next = self._choose_package_version()
.venv/lib/python3.7/site-packages/poetry/mixology/version_solver.py in _choose_package_version() at line 354
packages = self._provider.search_for(dependency)
.venv/lib/python3.7/site-packages/poetry/puzzle/provider.py in search_for() at line 144
allow_prereleases=dependency.allows_prereleases(),
.venv/lib/python3.7/site-packages/poetry/repositories/pool.py in find_packages() at line 65
name, constraint, extras=extras, allow_prereleases=allow_prereleases
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in find_packages() at line 105
info = self.get_package_info(name)
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in get_package_info() at line 238
name, lambda: self._get_package_info(name)
.venv/lib/python3.7/site-packages/cachy/repository.py in remember_forever() at line 174
val = value(callback)
.venv/lib/python3.7/site-packages/cachy/helpers.py in value() at line 6
return val()
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in <lambda>() at line 238
name, lambda: self._get_package_info(name)
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get_package_info() at line 242
data = self._get("pypi/{}/json".format(name))
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get() at line 391
json_response = self._session.get(self._url + endpoint)
.venv/lib/python3.7/site-packages/requests/sessions.py in get() at line 546
return self.request('GET', url, **kwargs)
.venv/lib/python3.7/site-packages/requests/sessions.py in request() at line 533
resp = self.send(prep, **send_kwargs)
.venv/lib/python3.7/site-packages/requests/sessions.py in send() at line 646
r = adapter.send(request, **kwargs)
.venv/lib/python3.7/site-packages/cachecontrol/adapter.py in send() at line 53
resp = super(CacheControlAdapter, self).send(request, **kw)
.venv/lib/python3.7/site-packages/requests/adapters.py in send() at line 533
return self.build_response(request, resp)
.venv/lib/python3.7/site-packages/cachecontrol/adapter.py in build_response() at line 80
request, response
.venv/lib/python3.7/site-packages/cachecontrol/controller.py in update_cached_response() at line 365
self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
.venv/lib/python3.7/site-packages/cachecontrol/caches/file_cache.py in set() at line 126
with self.lock_class(name) as lock:
.venv/lib/python3.7/site-packages/lockfile/__init__.py in __enter__() at line 197
self.acquire()
.venv/lib/python3.7/site-packages/lockfile/linklockfile.py in acquire() at line 50
time.sleep(timeout is not None and timeout / 10 or 0.1)
update [--no-dev] [--dry-run] [--lock] [--] [<packages>]...
For some reason, I found out that 'bit-vector = "0.42a0"' is causing this hang. Any of the following is the cause of the hang. I found this when I reported https://github.com/sdispater/poetry/issues/824.
bit-vector = {version = "^0.42.0a0",allows-prereleases = true}
bit-vector = "0.42a0"
I think it may have something to do with Poetry's use of cachecontrol
(notice the mentions of cachecontrol
and lockfile
towards end of logs).
If you dig through Poetry's source you'll see there is a class PyPiRepository
, with an __init__
parameter disable_cache=False
by default. It seems like there is not currently a way to disable it through Poetry, and there doesn't appear to be (relevant) global config overrides for cachecontrol
or lockfile
...
What you can do in the meantime is to delete the Poetry cache dir and try running again. At first I thought I was still having the issue, but after a bit it moved on. So it really was a filelock deadlock at first for me, and for some reason always getting back into the state upon trying again... but 🤷♂️ I guess it is something intermittent.
How to find your cache - well, check the Poetry configuration docs to see about the OS-specific defaults. And you can delete it by hand that way.
There is also poetry cache:clear
(version >1 it becomes poetry cache clear
syntax). Its CLI docs are not very clear yet but I believe the usage is poetry cache clear $POETRY_VERSION --all
@hangtwenty thanks for your point. I often hit outdated cache when i switch from one project to another. Uploading a new release of a libs in pypi doesn't invalidate poetry pypi cache.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I hit the same and I can confirm that running:
poetry cache:clear --all .
solves the problem
Has anybody solved this? My installation is stuck and cache clear
states I don't have any cache.
Has anybody solved this? My installation is stuck and
cache clear
states I don't have any cache.
Can you share your poetry update -vvv
log?
I've had Poetry take over 800 seconds before giving up [it was bascially never finishing]. I tried poetry 1.0.0, 1.0.5, 1.1.0a1 and had the same results. I also cleared the cache on each poetry version I tried, with the same problem still happening.
Here is the log:
Poetry never finishing update.txt
I've attached a poetry update -vvv log
@cgungor that showcases the issue. Reading the log, it looks like it keeps trying older and older versions of botocore due to docutils = "<0.16"
requirement in botocore. Earlier in the process it decided to use docutils 0.16 due to sphinx (2.4.4) depends on docutils (>=0.12)
. I don't know why it did not figure out that docutils(>=0.10,<0.16)
is fine with docutils (=0.15.2)
.
So I tried adding this to my .toml file: docutils = "<0.16"
. I reran the update and it finished in a about 4.5 seconds. Here is the output of that run:
Pinned Dep, poetry finishing update.txt
So for now I'll have to keep docutils pinned <0.16 my self, but it would have been really nice for poetry to figure it out on it's own!
Thinking about this more, I suppose it's normal for it to go back and try older versions. In this case, botocore has a lot of versions to go though. So it may be using a depth-first search? Perhaps it should be a breadth-first search? Perhaps it could try each older version of each dependency it needs to figure out a solution for before trying two-versions back?
I also tried doing botocore = ">=1.15.39"
in my .toml file instead, it only took an extra second to find a solution vs the docutils = "<0.16"
. I like this way better since I can leave it be long-term without having a problem [at least until botocore starts having a lot of versions after 1.15.39 and Poetry slows down too much again, which I can then update this to a later version].
I think this makes it do a depth-limited search on botocore, so it can stop searching for solutions that never work and try something else that will work faster.
I ran into this issue trying to run an update today. Clearing the cache appears to have resolved it, but resolution of packages across multiple indeces is extremely slow. When scanning for a package, if found in the default index, it proceeds to scan the secondary indeces anyways (where I have three in all so each package install is taking around TEN seconds).
I ran into a similar issue today with poetry version 1.1.4. I was able to "solve" it by doing:
poetry cache clear --all .
rm poetry.lock
poetry install -vvv
(for some reason, I ran it without the -vvv
flag before and it kept hanging, at least with -vvv
I see what's happening)
🤷🏻 I just had this today and it looks like mine was stuck looping on the following:
1: fact: sphinxcontrib-katex (0.6.1) depends on sphinx (>=1.6)
1: selecting sphinxcontrib-katex (0.6.1)
I had literally hundreds of the above lines printing out before I finally killed it, not sure why that is causing it to get stuck
I can confirm that this works on poetry 1.0.10 so it is a regression (ref: https://github.com/python-poetry/poetry/issues/3802)
I think I've encountered this issue, where Poetry was unable to resolve versions of any package.
Clearing cache didn't help, and the debug log didn't show anything useful...
Minimal example:
[tool.poetry.dependencies]
python = "^3.9"
Django = "^3.1.7"
steffo@nitro:/m/t/e/w/s/backend[1]$ poetry update -vvv
Using virtualenv: /home/steffo/.cache/pypoetry/virtualenvs/sophon-ldasLI51-py3.9
Updating dependencies
Resolving dependencies...
1: fact: sophon is 0.1.0
1: derived: sophon
1: fact: sophon depends on Django (^3.1.7)
1: selecting sophon (0.1.0)
1: derived: Django (>=3.1.7,<4.0.0)
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: 15 packages found for django >=3.1.7,<4.0.0
1: fact: django (3.2.7) depends on asgiref (>=3.3.2,<4)
1: fact: django (3.2.7) depends on pytz (*)
1: fact: django (3.2.7) depends on sqlparse (>=0.2.2)
1: selecting django (3.2.7)
1: derived: sqlparse (>=0.2.2)
1: derived: pytz
1: derived: asgiref (>=3.3.2,<4)
I've somehow managed to solve my issue by disabling IPv6 in the Linux kernel:
root@nitro:~# sysctl -w net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1 net.ipv6.conf.wlan0.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.wlan0.disable_ipv6 = 1
I think my problem was not related to Poetry but it was a problem with my IPv6 configuration, but I'll leave it here in case it helps someone.
@m-vdb
I confirm that this works on Poetry version 1.1.13
Closing this issue, because it's on a quite old version of Poetry, and poetry -vvv show --outdated
works correctly on recent version.
For the "slowness" of the resolver, there's already a bunch of issues opened, the main one being https://github.com/python-poetry/poetry/issues/2094.
Just FYI: I had a similar issue like the one above, with py-spy showing the following things:
poetry add -G dev rich --verbose
Using virtualenv: /Users/jankatins/Library/Caches/pypoetry/virtualenvs/data-modelling-tools-poc-VMcWXSqY-py3.10
Using version ^12.6.0 for rich
Updating dependencies
Resolving dependencies... (0.9s)
Finding the necessary packages for the current system
Package operations: 0 installs, 1 update, 0 removals, 114 skipped
• Updating linkml-runtime (1.3.3 -> 1.3.5): Pending...
^C^C
%Own %Total OwnTime TotalTime Function (filename)
1.00% 1.00% 2.57s 2.57s acquire (lockfile/linklockfile.py)
0.00% 1.00% 0.000s 2.57s _get (repositories/pypi_repository.py)
0.00% 1.00% 0.000s 2.57s update_cached_response (cachecontrol/controller.py)
0.00% 1.00% 0.000s 2.57s _install (installation/executor.py)
0.00% 1.00% 0.000s 2.57s choose_for (installation/chooser.py)
0.00% 1.00% 0.000s 2.57s _do_execute_operation (installation/executor.py)
0.00% 1.00% 0.000s 2.57s _update (installation/executor.py)
0.00% 1.00% 0.000s 2.57s _execute_operation (installation/executor.py)
0.00% 1.00% 0.000s 2.57s __enter__ (lockfile/__init__.py)
0.00% 1.00% 0.000s 2.57s request (utils/authenticator.py)
0.00% 1.00% 0.000s 2.57s _write (cachecontrol/caches/file_cache.py)
0.00% 1.00% 0.000s 2.57s send (cachecontrol/adapter.py)
0.00% 1.00% 0.000s 2.57s send (requests/sessions.py)
0.00% 1.00% 0.000s 2.57s build_response (cachecontrol/adapter.py)
0.00% 1.00% 0.000s 2.57s run (concurrent/futures/thread.py)
0.00% 1.00% 0.000s 2.57s find_links_for_package (repositories/pypi_repository.py)
0.00% 1.00% 0.000s 2.57s _cache_set (cachecontrol/controller.py)
0.00% 1.00% 0.000s 2.57s set (cachecontrol/caches/file_cache.py)
0.00% 1.00% 0.000s 2.57s run (threading.py)
0.00% 1.00% 0.000s 2.57s _worker (concurrent/futures/thread.py)
0.00% 1.00% 0.000s 2.57s _bootstrap_inner (threading.py)
0.00% 1.00% 0.000s 2.57s send (requests/adapters.py)
0.00% 1.00% 0.000s 2.57s _get_links (installation/chooser.py)
0.00% 1.00% 0.000s 2.57s _download (installation/executor.py)
0.00% 1.00% 0.000s 2.57s _bootstrap (threading.py)
0.00% 1.00% 0.000s 2.57s _execute_update (installation/executor.py)
0.00% 1.00% 0.000s 2.57s get (utils/authenticator.py)
Running poetry cache clear --all .
after removing the lock file solved it for me (removing the lock file itself didn't change a thing, but no idea if the cache clearing alone would have solved it.).
I'm having a similar issue, I tried the cache clear and then run poetry update -vvv log
- but I can't find a log file. Also, if there's new information on the issue of poetry getting stuck I'd be happy to hear about it. If there's people active here I think I could also show the pyproject.toml
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.
[ ] I am on the latest Poetry version.
[x] 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: Oracle Linux Server 7.5
Poetry version: 0.12.11
Link of a Gist with the contents of your pyproject.toml file: Part of it included.
pyproject.toml
Issue
When I try to see the list of outdated dependencies (poetry show --outdated), poetry hangs. And "poetry updated" gets stuck on "Resolving dependencies" and incrementing time (166.8s).
Running with --vvv:
Pressing CTRL+C shows:
Update with verbose shows: