#1037304 gnome-control-center: sharing non-accessible after fresh GNOME 3 installation

Package:
gnome-control-center
Source:
gnome-control-center
Description:
utilities to configure the GNOME desktop
Submitter:
Markus Koschany
Date:
2023-06-18 10:27:03 UTC
Severity:
normal
Tags:
#1037304#5
Date:
2023-06-10 18:32:11 UTC
From:
To:
I just installed GNOME 3 on a Lenovo X280 and X230i Thinkpad. I used the most recent Debian installer as of 10.06.2023 which was still an RC candidate for Bookworm.

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.

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.

So apparently there is something going on in the background which blocks the Sharing menu item on a very fresh GNOME 3 installation. I would have expected a more descriptive error message or that it just works TM right from the start.

Regards,

Markus

#1037304#10
Date:
2023-06-17 20:34:10 UTC
From:
To:
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
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.

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

#1037304#29
Date:
2023-06-18 05:32:41 UTC
From:
To:
Hey there comrades,

I would like to add that I can also replicate this same bug on a fresh
install of Debian 12. However, when I upgrade to attempt to use Xorg rather
than Wayland compositing the issue is bypassed. Likewise if I upgrade to
unstable packages. Might this lead to the issue not being gnome-keyring?

Brett

#1037304#34
Date:
2023-06-18 10:24:07 UTC
From:
To:
(Please try to keep a Subject line that uniquely identifies a bug,
rather than changing it to something generic like "Addendum" or "Found
a workaround" - package maintainers will often see your messages out
of context.)

What exactly do you mean by "when I upgrade to attempt to use Xorg"? Do you
mean you have upgraded some packages, and then logged out from the Wayland
session, switched mode to "GNOME on Xorg" and logged and back in?

If yes, then I think the real workaround here may have simply been that
you logged out and back in. If you had done that, without upgrading
or reconfiguring anything, then the keyring would probably have worked
as intended in that second login.

Which specific unstable packages?

Again, if you logged out and back in, that would probably have been enough
to work around this, even if you had not upgraded any packages.

    smcv