Xfce How to clean up mess caused by kdekeyring

So I use XFCE but installed some software that required some KDE libraries. Unfortunately one of those was the KDE wallet and from then on I was getting a prompt every time I launched gajim. I ended up having to install even more KDE components just to get the settings GUI working so I could "disable" KDE wallet. I seem to have succeeded there, but there are now broken configs that are preventing gajim from saving my passwords. I don't get the KDE wallet popups anymore, but gajim simply doesn't save the password even when prompted to do so.

Can someone assist me in cleaning this up and getting me back to where I was before KDE mucked things up?

Code:
$ gajim -l gajim.password=DEBUG
No translations found
Dirs searched: [PosixPath('/home/scott/.local/share'), PosixPath('/usr/local/share'), PosixPath('/usr/share')]
Logger gajim.password level set to 10
01/14/2024 14:51:09 (I) gajim.password             Found keyring backend: keyring.backends.kwallet.DBusKeyring (priority: 4.9)
01/14/2024 14:51:09 (I) gajim.password             Found keyring backend: keyring.backends.fail.Keyring (priority: 0)
01/14/2024 14:51:09 (I) gajim.password             Found keyring backend: keyring.backends.chainer.ChainerBackend (priority: 10)
01/14/2024 14:51:09 (I) gajim.password             Found keyring backend: keyring.backends.libsecret.Keyring (priority: 4.8)
01/14/2024 14:51:09 (I) gajim.password             Select keyring.backends.chainer.ChainerBackend (priority: 10) backend
01/14/2024 14:51:09 (W) nbxmpp.auth                GSSAPI not available: No module named 'gssapi'
01/14/2024 14:51:09 (I) gajim.password             Request password from keyring
ERROR:dbus.proxies:Introspect error on :1.57:/modules/kwalletd5: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
01/14/2024 14:51:09 (E) gajim.password             Request password failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 98, in connected
    self.handle = self.iface.open(self.iface.networkWallet(), wId, self.appid)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/local/lib/python3.9/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.57 was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gajim/common/passwords.py", line 71, in get_password
    return keyring_backend.get_password('gajim', account_name)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/chainer.py", line 49, in get_password
    password = keyring.get_password(service, username)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 109, in get_password
    if not self.connected(service):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 100, in connected
    raise InitError('Failed to open keyring: %s.' % e)
keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.57 was not provided by any .service files.
01/14/2024 14:51:10 (I) gajim.password             Request password from keyring
ERROR:dbus.proxies:Introspect error on :1.58:/modules/kwalletd5: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
01/14/2024 14:51:10 (E) gajim.password             Request password failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 98, in connected
    self.handle = self.iface.open(self.iface.networkWallet(), wId, self.appid)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/local/lib/python3.9/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.58 was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gajim/common/passwords.py", line 71, in get_password
    return keyring_backend.get_password('gajim', account_name)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/chainer.py", line 49, in get_password
    password = keyring.get_password(service, username)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 109, in get_password
    if not self.connected(service):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 100, in connected
    raise InitError('Failed to open keyring: %s.' % e)
keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.58 was not provided by any .service files.
 
Make sure that the KDE Wallet Manager is not starting with Xfce.
It is not. kdewallet is no longer even listed.

It wasn't checked.

Find the configuration directories and delete them if necessary. Something like ~/.cache/gajim, ~/.config/gajim, ~./local/gajim, ~/.gajim.
You'll need to set up Gajim again.
Oomf. Was hoping for something a bit less blunt, but I tried it anyway.
Removed: ~/.cache/gajim/ , ~/.config/gajim/ , ~/.local/share/gajim (didn't find any others). Set up my account again, chose to save password, quit gajim and restarted, and it's still asking for the password.

As I suspected, there's something outside of gajim itself which has messed up the keyring settings. Here's updated output from gajim -l gajim.password=DEBUG

Code:
$ gajim -l gajim.password=DEBUG
No translations found
Dirs searched: [PosixPath('/home/scott/.local/share'), PosixPath('/usr/local/share'), PosixPath('/usr/share')]
Logger gajim.password level set to 10
01/14/2024 17:09:51 (I) gajim.password             Found keyring backend: keyring.backends.kwallet.DBusKeyring (priority: 4.9)
01/14/2024 17:09:51 (I) gajim.password             Found keyring backend: keyring.backends.fail.Keyring (priority: 0)
01/14/2024 17:09:51 (I) gajim.password             Found keyring backend: keyring.backends.chainer.ChainerBackend (priority: 10)
01/14/2024 17:09:51 (I) gajim.password             Found keyring backend: keyring.backends.libsecret.Keyring (priority: 4.8)
01/14/2024 17:09:51 (I) gajim.password             Select keyring.backends.chainer.ChainerBackend (priority: 10) backend
01/14/2024 17:09:51 (W) nbxmpp.auth                GSSAPI not available: No module named 'gssapi'
01/14/2024 17:09:52 (I) gajim.password             Request password from keyring
ERROR:dbus.proxies:Introspect error on :1.88:/modules/kwalletd5: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
01/14/2024 17:09:52 (E) gajim.password             Request password failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 98, in connected
    self.handle = self.iface.open(self.iface.networkWallet(), wId, self.appid)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/local/lib/python3.9/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.88 was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gajim/common/passwords.py", line 71, in get_password
    return keyring_backend.get_password('gajim', account_name)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/chainer.py", line 49, in get_password
    password = keyring.get_password(service, username)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 109, in get_password
    if not self.connected(service):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 100, in connected
    raise InitError('Failed to open keyring: %s.' % e)
keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.88 was not provided by any .service files.
01/14/2024 17:09:52 (I) gajim.password             Request password from keyring
ERROR:dbus.proxies:Introspect error on :1.89:/modules/kwalletd5: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
01/14/2024 17:09:52 (E) gajim.password             Request password failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 98, in connected
    self.handle = self.iface.open(self.iface.networkWallet(), wId, self.appid)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/local/lib/python3.9/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/local/lib/python3.9/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.89 was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gajim/common/passwords.py", line 71, in get_password
    return keyring_backend.get_password('gajim', account_name)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/chainer.py", line 49, in get_password
    password = keyring.get_password(service, username)
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 109, in get_password
    if not self.connected(service):
  File "/usr/local/lib/python3.9/site-packages/keyring/backends/kwallet.py", line 100, in connected
    raise InitError('Failed to open keyring: %s.' % e)
keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.89 was not provided by any .service files.

Even running the Python keyring --list-backends shows kdewallet remnants (which are perhaps what's causing the problem since kdewallet is now gone?):

Code:
$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.kwallet.DBusKeyring (priority: 4.9)
keyring.backends.chainer.ChainerBackend (priority: 10)
keyring.backends.libsecret.Keyring (priority: 4.8)
 
python -m keyring --disable
That ran without error, however gajim still won't save the password. The command did something, though, as running it again produces the following output:
Code:
Traceback (most recent call last):
  File "/usr/local/bin/keyring", line 33, in <module>
    sys.exit(load_entry_point('keyring==23.9.3', 'console_scripts', 'keyring')())
  File "/usr/local/lib/python3.9/site-packages/keyring/cli.py", line 132, in main
    return cli.run(argv)
  File "/usr/local/lib/python3.9/site-packages/keyring/cli.py", line 62, in run
    core.disable()
  File "/usr/local/lib/python3.9/site-packages/keyring/core.py", line 48, in disable
    raise RuntimeError(msg)
RuntimeError: Refusing to overwrite /home/scott/.config/python_keyring/keyringrc.cfg

The current contents of keyringrc.cfg:
Code:
[backend]
default-keyring=keyring.backends.null.Keyring

keyring --list-backends still shows the same output as before.
 
Code:
File "/usr/local/lib/python3.9/site-packages/keyring/core.py", line 48, in disable
    raise RuntimeError(msg)
RuntimeError: Refusing to overwrite /home/scott/.config/python_keyring/keyringrc.cfg

Python:
def disable() -> None:
    """
    Configure the null keyring as the default.
    """
    root = platform.config_root()
    try:
        os.makedirs(root)
    except OSError:
        pass
    filename = os.path.join(root, 'keyringrc.cfg')
    if os.path.exists(filename):
        msg = f"Refusing to overwrite {filename}"
        raise RuntimeError(msg)
    with open(filename, 'w') as file:
        file.write('[backend]\ndefault-keyring=keyring.backends.null.Keyring')

What happens if you delete keyringrc.cfg?



I found some issues disabling keyring reported on GitHub. It can be a broken version or installation. Try the other options shown in the link, such as uninstalling the keyring. It could be something like:
python -m pip uninstall keyring.
  • Uninstall keyring. Most applications are tolerant to keyring not being installed. Uninstalling keyring should cause those applications to fall back to the behavior without keyring. This approach affects the Python environment where keyring would otherwise have been installed.



Code:
01/14/2024 14:51:09 (I) gajim.password             Select keyring.backends.chainer.ChainerBackend (priority: 10) backend
01/14/2024 14:51:09 (W) nbxmpp.auth                GSSAPI not available: No module named 'gssapi'
01/14/2024 14:51:09 (I) gajim.password             Request password from keyring
ERROR:dbus.proxies:Introspect error on :1.57:/modules/kwalletd5: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
01/14/2024 14:51:09 (E) gajim.password             Request password failed

The log seems to choose the chainer backend. What is this? It doesn't seem to match the description of the py39-chainer package, and then displays the nbxmpp error. Do you have py39-nbxmpp and py39-gssapi installed?
Try pkg install -Rf gajim.
 
Last edited:
Back
Top