Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBusKeyring is unable to connect to the kwallet service in kloczek's environment #553

Open
jaraco opened this issue Nov 28, 2021 · 4 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Nov 28, 2021

The third class of issues appears to be that the DBusKeyring is unable to connect to the kwallet service:

FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_present - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_not_present - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnk...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_one_in_group - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUn...
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: Could not activate remote peer.

I don't see that error reported anywhere. @mitya57 do you have any recommendations on how this user can avoid these errors when running the tests (either by improving the viability detection in the backend or by properly configuring the environment to work with the backend)?

Originally posted by @jaraco in #550 (comment)

@jaraco
Copy link
Owner Author

jaraco commented Nov 28, 2021

@mitya57 had this to say:

I don't understand why that could happen.

We have the following code to check that the service is activatable:

if not (
bus.name_has_owner(cls.bus_name)
or cls.bus_name in bus.list_activatable_names()
):
raise RuntimeError(
"The KWallet daemon is neither running nor activatable through D-Bus"
)

If that check passes, then the service should be activatable, and ServiceUnknown error should not happen.

@kloczek Do you have kwallet installed on the system where tests were run?

Can you run this code and check what it prints?

>>> from keyring.backends import kwallet
>>> print(kwallet.DBusKeyring.viable)

@jaraco
Copy link
Owner Author

jaraco commented Nov 28, 2021

@kloczek confirmed that kwallet is installed:

During that test I had installed but I was not aware that it is here some test dependency

[tkloczko@ss-desktop SPECS]$ rpm -q kf5-kwallet
kf5-kwallet-5.88.0-2.g2v.x86_64

We'd still like to know what is the result of kwallet.DBusKeyring.viable.

@kloczek
Copy link

kloczek commented Jan 2, 2022

We'd still like to know what is the result of kwallet.DBusKeyring.viable.

How can I diagnose that?

Only FTR .. just tested 23.5.0 and still I see:

FAILED tests/test_packaging.py::test_entry_point - ValueError: too many values to unpack (expected 1)
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_password_set_get - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnkno...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_difficult_chars - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknow...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_present - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_not_present - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnk...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_delete_one_in_group - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUn...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_unicode_chars - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown:...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_unicode_and_ascii_chars - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.Servi...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_different_user - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown...
FAILED tests/backends/test_kwallet.py::TestDBusKWallet::test_credential - keyring.errors.InitError: Failed to open keyring: org.freedesktop.DBus.Error.ServiceUnknown: Co...

@jaraco
Copy link
Owner Author

jaraco commented Jan 2, 2022

Can you run this code and check what it prints?

>>> from keyring.backends import kwallet
>>> print(kwallet.DBusKeyring.viable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants