Closed snthibaud closed 2 years ago
probably a stray .lock
file in your cache find ~/.cache/pypoetry -name '*lock' -delete
@dimbleby Thank you! Unfortunately the find/delete command did not help.
You're likely going to have to debug this yourself then, or at least provide some way to reproduce. It works fine here!
I'd suggest blowing away your Poetry cache (be aware this will also nuke your virtual environments) with rm -rf ~/.cache/pypoetry
-- regardless, this looks like a transient local issue that cannot be reproduced definitively (and fixes for the two known ways to trigger this state are resolved in the master branch). As such I'm going to close it, and ask you to request it be converted to a Discussion or join Discord if you need more support.
Alright. I will try clearing all caches. Another thing that might have an influence is that I am running this on a Rapsberry Pi 4. I guess it has a different architecture (arm) from most computers on which Poetry is installed, so perhaps it's important to reproduce?
@neersighted I tried your suggestion as well and it did result in a slightly different output, but it still hangs. It stops here now:
...
Source (PyPI): 13 packages found for attrs >=17.4.0
Source (PyPI): Getting info for urllib3 (1.26.12) from PyPI
[urllib3.connectionpool] https://pypi.org:443 "GET /pypi/urllib3/1.26.12/json HTTP/1.1" 200 17299
1: selecting urllib3 (1.26.12)
Source (PyPI): Getting info for msgpack (1.0.4) from PyPI
[urllib3.connectionpool] https://pypi.org:443 "GET /pypi/msgpack/1.0.4/json HTTP/1.1" 200 11371
Source (PyPI): No dependencies found, downloading archives
Source (PyPI): Downloading sdist: msgpack-1.0.4.tar.gz
[urllib3.connectionpool] https://files.pythonhosted.org:443 "GET /packages/22/44/0829b19ac243211d1d2bd759999aa92196c546518b0be91de9cacc98122a/msgpack-1.0.4.tar.gz HTTP/1.1" 200 128053
How can I join the discord discussion?
I thought it was perhaps compiling the msgpack package, but the CPU usage is also very low, so I do not think it is.
I would shove a strace in front of the command strace -o /tmp/poetry.log poetry self add yadda yadda
See what happens at the end of the log when the process has apparently hung.
@clintonroy Thank you! This is the output from strace:
openat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin/activate_this.py", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
ioctl(4, FIOCLEX) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
ioctl(4, TCGETS, 0x7fd3703580) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(4, 0, SEEK_CUR) = 0
write(4, "\"\"\"Activate virtualenv for curre"..., 1175) = 1175
close(4) = 0
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
getpid() = 1258725
openat(AT_FDCWD, "/tmp/tmp469r9589/.venv/pyvenv.cfg", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
ioctl(4, FIOCLEX) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
ioctl(4, TCGETS, 0x7fd3703870) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(4, 0, SEEK_CUR) = 0
lseek(4, 0, SEEK_CUR) = 0
write(4, "home = /usr\nimplementation = CPy"..., 204) = 204
close(4) = 0
uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
newfstatat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents64(4, 0x3daa57d0 /* 20 entries */, 32768) = 632
getdents64(4, 0x3daa57d0 /* 0 entries */, 32768) = 0
close(4) = 0
newfstatat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents64(4, 0x3daa57d0 /* 20 entries */, 32768) = 632
getdents64(4, 0x3daa57d0 /* 0 entries */, 32768) = 0
close(4) = 0
mkdirat(AT_FDCWD, "/tmp/tmp469r9589/dist", 0777) = 0
newfstatat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin/pip", {st_mode=S_IFREG|0755, st_size=238, ...}, 0) = 0
newfstatat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin/pip", {st_mode=S_IFREG|0755, st_size=238, ...}, 0) = 0
newfstatat(AT_FDCWD, "/tmp/tmp469r9589/.venv/bin/python", {st_mode=S_IFREG|0755, st_size=5280744, ...}, 0) = 0
pipe2([4, 5], O_CLOEXEC) = 0
fstat(4, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
ioctl(4, TCGETS, 0x7fd3703920) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
pipe2([6, 7], O_CLOEXEC) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f81ecc110) = 1258773
close(7) = 0
close(5) = 0
read(6, "", 50000) = 0
close(6) = 0
lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
fstat(4, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
read(4, "Looking in indexes: https://pypi"..., 8192) = 110
read(4, "User for us-west1-python.pkg.dev"..., 8082) = 34
read(4, xyz@xyz:~ $
looks like you might have to follow the children strace -o /tmp/poetry.log --follow-forks poetry yadda yadda
@clintonroy Thanks again! Then I get:
1260537 close(5) = 0
1260537 getsockopt(4, SOL_SOCKET, SO_TYPE, [1], [4]) = 0
1260537 getsockname(4, {sa_family=AF_INET6, sin6_port=htons(56432), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2401:4d40:2180:600:4bfc:15a9:2692:2d55", &sin6_addr), sin6_scope_id=0}, [128->28]) = 0
1260537 ioctl(4, FIONBIO, [1]) = 0
1260537 getpeername(4, {sa_family=AF_INET6, sin6_port=htons(443), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2404:6800:4008:c13::52", &sin6_addr), sin6_scope_id=0}, [28]) = 0
1260537 getpid() = 1260537
1260537 getpid() = 1260537
1260537 getpid() = 1260537
1260537 getpid() = 1260537
1260537 getpid() = 1260537
1260537 getpid() = 1260537
1260537 write(4, "\26\3\1\2\0\1\0\1\374\3\3\371u\365\345\237\2061\271\6BQ\30\0\320*X\374\315\178\232"..., 517) = 517
1260537 read(4, 0x3fed1bc3, 5) = -1 EAGAIN (Resource temporarily unavailable)
1260537 ppoll([{fd=4, events=POLLIN}], 1, {tv_sec=14, tv_nsec=999000000}, NULL, 0) = 1 ([{fd=4, revents=POLLIN}], left {tv_sec=14, tv_nsec=955175630})
1260537 read(4, "\26\3\3\0z", 5) = 5
1260537 read(4, "\2\0\0v\3\3\333\211\210\254\230\205\254mT\312_&\6D\305+\253P;\221\240<f\307;u"..., 122) = 122
1260537 read(4, "\24\3\3\0\1", 5) = 5
1260537 read(4, "\1", 1) = 1
1260537 read(4, "\27\3\3\0212", 5) = 5
1260537 read(4, "\336\f\353gR+\373\255\374\35\250Pn\354X5%\25a\372V$O\350\323\251\317\354(\3417\332"..., 4402) = 4402
1260537 write(4, "\24\3\3\0\1\1\27\3\3\0E\241\325\226}\35\215\244\231\235\330\271&\377Ut\257\324\256\2,\23"..., 80) = 80
1260537 ioctl(4, FIONBIO, [1]) = 0
1260537 ppoll([{fd=4, events=POLLOUT}], 1, {tv_sec=15, tv_nsec=0}, NULL, 0) = 1 ([{fd=4, revents=POLLOUT}], left {tv_sec=14, tv_nsec=999990204})
1260537 write(4, "\27\3\3\2\273Z\341r\275XY\347br\244\266\260>1BFVM\241\2\"\207\221j\261\316g"..., 704) = 704
1260537 ioctl(4, FIONBIO, [1]) = 0
1260537 read(4, 0x40170f53, 5) = -1 EAGAIN (Resource temporarily unavailable)
1260537 ppoll([{fd=4, events=POLLIN}], 1, {tv_sec=15, tv_nsec=0}, NULL, 0) = 1 ([{fd=4, revents=POLLIN}], left {tv_sec=14, tv_nsec=87839569})
1260537 read(4, "\27\3\3\2Q", 5) = 5
1260537 read(4, "3<\242\341'\215x\21\244\330jhh\25=\344A.@\271\267\231V\313\22,\27\217\205\243\233\333"..., 593) = 593
1260537 read(4, "\27\3\3\2\r", 5) = 5
1260537 read(4, "J\354\216\31\5\311rvM\271\343\314\231J\273\240m\303b4\217^\371\1*\366\322\30^\220BM"..., 525) = 525
1260537 getpid() = 1260537
1260537 openat(AT_FDCWD, "/tmp/tmpanbmt3i8", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0600) = 5
1260537 fstat(5, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
1260537 ioctl(5, TCGETS, 0x7fdfad3970) = -1 ENOTTY (Inappropriate ioctl for device)
1260537 lseek(5, 0, SEEK_CUR) = 0
1260537 lseek(5, 0, SEEK_CUR) = 0
1260537 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
1260537 ioctl(1, TCGETS, 0x7fdfad4020) = -1 ENOTTY (Inappropriate ioctl for device)
1260537 write(1, "User for us-west1-python.pkg.dev"..., 34) = 34
1260490 <... read resumed>"User for us-west1-python.pkg.dev"..., 8082) = 34
1260490 read(3, <unfinished ...>
1260537 read(0, xyz@xyz:~ $
looks like keyring is asking you for a username
or possibly keyring is doing nothing and the repository is asking you for a username. Anyway you'll want to set up authentication, I expect
I see. Thank you! But authentication to what?
User for us-west1-python.pkg.dev"
Hmm... why is it looking there, actually? It looks like a URL related to my GCP repo, but I do not want to install this plugin from there. I am running the poetry add command outside of any Poetry project as well.
And I want to install this plugin specifically to handle the authentication.
no idea, this doesn't look like anything to do with poetry, best of luck.
did you try googling?
Interesting. I did create that Stackoverflow issue myself in the past. The solution does not work now. I will try to figure out more a bit later. Thanks!
adding a -s 10000 might make it a bit easier to understand
I like above pull request to resolve the hidden prompt issue and also resolved this specific issue now.
For anyone running into something similar (and also my future self): the prompt occurred because a source requiring authentication was configured in .config/pip/pip.conf
. Commenting that source with a hashtag enabled me to install the authentication plugin.
@snthibaud Having the same problem right now on a Raspberry Pi 400 with Poetry 1.3.2 running Python 3.10.11 installed via pyenv.
The following sequence of actions hangs forever:
$ poetry new test
$ cd test/
$ poetry install
$ poetry add requests -vvvvv
Loading configuration file /home/pi/.config/pypoetry/config.toml
Using virtualenv: /home/pi/repos/bossqa3/.venv
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
The only thing I have configured is to install virtual environments into the project directory:
$ cat ~/.config/pypoetry/config.toml
[virtualenvs]
in-project = true
@sfoley-gpqa Hello Sean, did you check my last comment? Not sure if the cause is similar in your case, but that resolved it for me.
@snthibaud
Thanks for following up. I appreciate your time and feedback. I read all of the comments in the thread and tried everything. I don't seem to have a pip.conf
anywhere except /etc/pip.conf
and that didn't have any auth-related content in it.
I was eventually able to work around the problem by running the install like this
$ PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring poetry install
This seems like an awful workaround though :(
The only keyring-related thing I can think of that I did was to copy some SSH keys to the Raspberry Pi and run ssh-add /path/to/key
. I'm not sure how that would make things get stuck?
Sure! I am not a developer of Poetry, so I cannot say whether or not it is related. It seems improbable. The main problem here is that the Poetry installer gets stuck and hides the error messages, I think.
I hit this too. No amount of deleting .cache
files was able to resolve it. only running with @sfoley-gpqa solution did it work.
I did get a password prompt at one point but cancelled it and then never saw it again.
There's no reason that poetry should be trying to authenticate my keychain that I can figure out.
FWIW I'm running Fedora 36
edit: rebooting fixed the issue
The solution below from this issue cleared the issue up for me.
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
Same issue on Debian 12. I removed by mistake some config directories in $HOME last day, so I suspect this is somehow linked to that.
Anyway, running export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
did the trick for me too, so thank you for the advice!
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.
-vvv
option) and have included the output below.Issue
I have been trying to install the GCP keyring plugin, but the installer got stuck. It has been resolving for an entire night, so I reran it with -vvv and noticed it stops after indicating it is creating a new session for files.pythonhosted.org . This is the full output: