Control: clone -1 -2 Control: retitle -1 Keyring access in gnome-control-center -> Sharing gets stuck during first login to fresh installation Control: tags -1 + confirmed Control: reassign -1 gnome-keyring 42.1-1 Control: affects -1 + gnome-control-center Control: retitle -2 gnome-control-center: Sharing panel should access gnome-keyring asynchronously Control: severity -2 wishlist
On Sat, 10 Jun 2023 at 20:32:11 +0200, Markus Koschany wrote: > I just installed GNOME 3 on a Lenovo X280 and X230i Thinkpad. > > Open the gnome-control-center, click on the sharing menu item. Now the > application starts to freeze and a dialogue opens whether I would like to > wait or force quit the application. I waited for several minutes and retried > the process but that didn't help. I can reproduce this with a fresh installation from debian-live-12.0.0-amd64-gnome.iso using debian-installer. I think this is a problem with gnome-keyring, rather than gnome-control-center specifically. Attaching gdb to gnome-control-center indicates that the main thread is blocking in a call to secret_password_store_sync(), which is storing a generated password to be used by gnome-remote-desktop if enabled: Thread 1 (Thread 0x7ffff0a31640 (LWP 3605) "gnome-control-c"): #0 0x00007ffff603cfff in __GI___poll (fds=0x5555558f6010, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff7c8e9ae in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x5555558f6010, timeout=<optimized out>, context=0x55555828ba10) at ../../../glib/gmain.c:4553 #2 g_main_context_iterate (context=0x55555828ba10, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4243 #3 0x00007ffff7c8ecef in g_main_loop_run (loop=0x5555558f3470) at ../../../glib/gmain.c:4448 #4 0x00007ffff6864f08 in secret_password_storev_sync (schema=schema@entry=0x555555848ae0 <grd_rdp_credentials_schema>, attributes=attributes@entry=0x5555582a2d20, collection=collection@entry=0x5555556d8de2 "default", label=label@entry=0x5555556e50f8 "GNOME Remote Desktop RDP credentials", password=password@entry=0x5555582a7430 "{'username': <'user'>, 'password': <'__REDACTED__'>}", cancellable=cancellable@entry=0x0, error=0x0) at ../libsecret/secret-password.c:466 #5 0x00007ffff686510b in secret_password_store_sync (schema=0x555555848ae0 <grd_rdp_credentials_schema>, collection=collection@entry=0x5555556d8de2 "default", label=label@entry=0x5555556e50f8 "GNOME Remote Desktop RDP credentials", password=password@entry=0x5555582a7430 "{'username': <'user'>, 'password': <'__REDACTED__'>}", cancellable=cancellable@entry=0x0, error=error@entry=0x0) at ../libsecret/secret-password.c:404 #6 0x0000555555638597 in cc_grd_store_rdp_credentials (username=username@entry=0x5555582f22b0 "user", password=password@entry=0x7fffed46f008 "__REDACTED__", cancellable=<optimized out>) at ../panels/sharing/cc-gnome-remote-desktop.c:52 #7 0x000055555563620e in store_remote_desktop_credentials_timeout (user_data=<optimized out>) at ../panels/sharing/cc-sharing-panel.c:1004 #8 0x00007ffff7c8f19a in g_timeout_dispatch (source=0x5555582f21b0, callback=<optimized out>, user_data=<optimized out>) at ../../../glib/gmain.c:5017 #9 0x00007ffff7c8e67f in g_main_dispatch (context=0x5555558a4f00) at ../../../glib/gmain.c:3454 #10 g_main_context_dispatch (context=context@entry=0x5555558a4f00) at ../../../glib/gmain.c:4172 #11 0x00007ffff7c8ea38 in g_main_context_iterate (context=context@entry=0x5555558a4f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4248 #12 0x00007ffff7c8eacc in g_main_context_iteration (context=context@entry=0x5555558a4f00, may_block=may_block@entry=1) at ../../../glib/gmain.c:4313 #13 0x00007ffff7eae65d in g_application_run (application=0x5555558a0110, argc=argc@entry=1, argv=argv@entry=0x7fffffffe0e8) at ../../../gio/gapplication.c:2573 #14 0x00005555555b2e41 in main (argc=1, argv=0x7fffffffe0e8) at ../shell/main.c:60 However, gnome-keyring didn't start correctly: Jun 17 20:46:35 momentum systemd[1875]: Listening on gnome-keyring-daemon.socket - GNOME Keyring daemon. ... Jun 17 20:46:35 momentum systemd[1875]: Started gnome-keyring-daemon.service - GNOME Keyring daemon. ... Jun 17 20:46:35 momentum gnome-keyring-daemon[1900]: GNOME_KEYRING_CONTROL=/run/user/1000/keyring ... Jun 17 20:46:36 momentum gnome-keyring-daemon[1900]: The PKCS#11 component was already initialized Jun 17 20:46:36 momentum gnome-keyring-d[1900]: The PKCS#11 component was already initialized Jun 17 20:46:36 momentum gnome-keyring-daemon[2043]: discover_other_daemon: 1 Jun 17 20:46:36 momentum gnome-keyring-pkcs11.desktop[2043]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring Jun 17 20:46:36 momentum gnome-keyring-daemon[1900]: The Secret Service was already initialized Jun 17 20:46:36 momentum gnome-keyring-daemon[2044]: discover_other_daemon: 1 Jun 17 20:46:36 momentum gnome-keyring-ssh.desktop[2044]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring Jun 17 20:46:36 momentum gnome-keyring-ssh.desktop[2044]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh Jun 17 20:46:36 momentum gnome-keyring-d[1900]: The Secret Service was already initialized Jun 17 20:46:36 momentum gnome-keyring-secrets.desktop[2045]: discover_other_daemon: 1GNOME_KEYRING_CONTROL=/run/user/1000/keyring Jun 17 20:46:36 momentum gnome-keyring-secrets.desktop[2045]: SSH_AUTH_SOCK=/run/user/1000/keyring/ssh Jun 17 20:46:36 momentum gnome-keyring-daemon[2045]: discover_other_daemon: 1 Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2039.scope: Couldn't move process 2039 to requested cgroup '/user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-gnome\x2dkeyring\x2dpkcs11-2039.scope': No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2039.scope: Failed to add PIDs to scope's control group: No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dpkcs11-2039.scope: Failed with result 'resources'. Jun 17 20:46:36 momentum systemd[1875]: Failed to start app-gnome-gnome\x2dkeyring\x2dpkcs11-2039.scope - Application launched by gnome-session-binary. Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dsecrets-2042.scope: Couldn't move process 2042 to requested cgroup '/user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-gnome\x2dkeyring\x2dsecrets-2042.scope': No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dsecrets-2042.scope: Failed to add PIDs to scope's control group: No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dsecrets-2042.scope: Failed with result 'resources'. Jun 17 20:46:36 momentum systemd[1875]: Failed to start app-gnome-gnome\x2dkeyring\x2dsecrets-2042.scope - Application launched by gnome-session-binary. Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dssh-2041.scope: Couldn't move process 2041 to requested cgroup '/user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-gnome\x2dkeyring\x2dssh-2041.scope': No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dssh-2041.scope: Failed to add PIDs to scope's control group: No such process Jun 17 20:46:36 momentum systemd[1875]: app-gnome-gnome\x2dkeyring\x2dssh-2041.scope: Failed with result 'resources'. Jun 17 20:46:36 momentum systemd[1875]: Failed to start app-gnome-gnome\x2dkeyring\x2dssh-2041.scope - Application launched by gnome-session-binary. Jun 17 20:46:36 momentum systemd[1875]: Started gnome-session-manager@gnome.service - GNOME Session Manager (session: gnome). A related symptom is that if I run "Passwords and Keys" (which is from the seahorse package), I only see entries in the left sidebar for SSH and GPG keys, and I do not see a password store labelled "Login" under the "Passwords" heading. After restarting gnome-keyring-daemon.service and re-running seahorse, I *do* see "Passwords" -> "Login" (and gnome-control-center also works correctly). https://bugs.debian.org/1035061 is maybe related (or maybe not). gnome-control-center could mitigate this by using asynchronous instead of synchronous APIs to interact with gnome-keyring (the cloned bug "gnome-control-center: Sharing panel should access gnome-keyring asynchronously" represents this). But that's only a mitigation, not a solution: if gnome-keyring is unresponsive then obviously g-c-c won't be able to set up the password that it's meant to. > After removing gnome-remote-desktop, the menu item "Sharing" became > accessible again. > > I just re-installed gnome-remote-desktop and now clicking on Sharing also > works as expected which is weird. After rebooting my second Laptop Sharing > also works again. Here I did not remove gnome-remote-desktop. I think this indicates a problem with the first-time setup of the keyring. I tried to reproduce the same thing by booting debian-live-12.0.0-amd64-gnome.iso in live mode (which, if it reproduced the bug, would be a very convenient way to test, since every boot in live mode behaves like a fresh installation), but that behaves differently: In live mode, when I enter the Sharing panel, I'm prompted for "Choose password for new keyring". gnome-control-center becomes unresponsive while that prompt is open (which makes sense if it's using a blocking API), but that doesn't really matter because the prompt is system-modal, so every application is unavailable anyway. After I set a password, gnome-control-center wakes up and appears to be working correctly. I *think* this might indicate a problem with the code path in libpam-gnome-keyring that unlocks/creates the default keyring while logging in using a password, which is obviously not possible during the live system's autologin. But perhaps that's irrelevant. smcv