#1101061 gnome-keyring: After upgrade keyrings expected in .local/share/keyrings but were left in .gnome2/keyrings

Package:
gnome-keyring
Source:
gnome-keyring
Description:
GNOME keyring services (daemon and tools)
Submitter:
Drew Vogel
Date:
2025-03-22 19:48:03 UTC
Severity:
normal
#1101061#5
Date:
2025-03-22 19:18:42 UTC
From:
To:
Dear Maintainer,


It appears the upgrade of gnome-keyring-daemon does not always
account for the existance of keyring files. After upgrading
with apt dist-upgrade, I rebooted.

After reboot, multiple programs reported missing keyring entries.
Inspecting the keyring with seahorse, it was mostly empty. In
journalctl -eu gnome-keyring-daemon it said:

    keyring was in an invalid or unrecognized format:
        $HOME/.local/share/keyrings/default.keyring

I checked my backups and found no such file. Looking at older
reports, it appeared $HOME/.gnome2/keyrings was the expected dir.
That local dir had much larger keyring files.

I stopped gnome-keyring-daemon.{service,socket}. Then copied the
larger keyring files to the dir mentioned in the logs, overwriting
the ones there. I started gnome-keyring-daemon.{service,socket}
and re-ran seahorse. The expected entries were present.

#1101061#10
Date:
2025-03-22 19:45:48 UTC
From:
To:
Upon further investigation, I think it is very unlikely this misbehavior is
due to the gnome-keyring
debian package. The relevant code in upstream[1] is very old. It appears to
check for the existence
of both dirs and prioritizes the new one if both dirs exist. The creation
timestamp for the new dir is
a few days older than the upgrade. So likely gnome-keyring-daemon was
started prior to that new
directory being created and the dist-upgrade simply prompted a reboot,
which led to the daemon
recognizing the new directory on the next start.

[1]
https://gitlab.gnome.org/GNOME/gnome-keyring/-/blob/main/daemon/dbus/gkd-secret-service.c#L170-186