mrvladus / Errands

Todo application for those who prefer simplicity.
MIT License
288 stars 65 forks source link

Can't set up sync, `org.freedesktop.DBus.Error.ServiceUnknown` #136

Closed melianmiko closed 8 months ago

melianmiko commented 8 months ago

OS: Arch Linux App: Errands, io.github.mrvladus.List, 45.1.3, from flathub

When trying to set up sync in settings, got this in log. No matter is Nextcloud or CalDAV selected.

[INFO] Sync: Initialize sync provider
[INFO] Sync: Initialize CalDAV sync provider
[DEBUG] Sync: Checking credentials
Traceback (most recent call last):
  File "/app/share/errands/errands/widgets/preferences.py", line 137, in on_test_connection_btn_clicked
    res: bool = Sync.test_connection()
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/sync.py", line 49, in test_connection
    self.init(testing=True, window=self.window)
  File "/app/share/errands/errands/utils/sync.py", line 29, in init
    self.provider = SyncProviderCalDAV("CalDAV", self.window, testing)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/sync.py", line 65, in __init__
    if not self._check_credentials():
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/sync.py", line 76, in _check_credentials
    self.password: str = GSettings.get_secret(self.name)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/gsettings.py", line 45, in get_secret
    return Secret.password_lookup_sync(SECRETS_SCHEMA, {"account": account}, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-dbus-error-quark: org.freedesktop.DBus.Error.ServiceUnknown (2)
Traceback (most recent call last):
  File "/app/share/errands/errands/widgets/preferences.py", line 129, in on_sync_provider_selected
    self.setup_sync()
  File "/app/share/errands/errands/widgets/preferences.py", line 124, in setup_sync
    password = GSettings.get_secret(account)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/gsettings.py", line 45, in get_secret
    return Secret.password_lookup_sync(SECRETS_SCHEMA, {"account": account}, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-dbus-error-quark: org.freedesktop.DBus.Error.ServiceUnknown (2)

Maybe your app require some additional dependencies outside flatpak?

melianmiko commented 8 months ago

Installed version from AUR (aka build from sources), it works fine.

mrvladus commented 8 months ago

Looks like flatpak issue, try to upgrade system, run flatpak update, and reboot

melianmiko commented 8 months ago
~ hp-laptop $ flatpak update
Looking for updates…

Nothing to do.
~ hp-laptop $ flatpak run io.github.mrvladus.List 
[DEBUG] Starting Errands 45.1.3
[DEBUG] Initialize GSettings
[DEBUG] Creating actions
[INFO] Data: Clean deleted
[DEBUG] Lists: Update UI...
Traceback (most recent call last):
  File "/app/share/errands/errands/widgets/preferences.py", line 129, in on_sync_provider_selected
    self.setup_sync()
  File "/app/share/errands/errands/widgets/preferences.py", line 124, in setup_sync
    password = GSettings.get_secret(account)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/errands/errands/utils/gsettings.py", line 45, in get_secret
    return Secret.password_lookup_sync(SECRETS_SCHEMA, {"account": account}, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-dbus-error-quark: org.freedesktop.DBus.Error.ServiceUnknown (2)

After reboot got the same error.

Upd. rm -rf ~/.var/app/io.github.mrvladus.List/ also don't help...

mrvladus commented 8 months ago

Try this: flatpak run --talk-name=org.freedesktop.secrets io.github.mrvladus.List

melianmiko commented 8 months ago

Try this: flatpak run --talk-name=org.freedesktop.secrets io.github.mrvladus.List

Yep, now it works as expected.

~ hp-laptop $ flatpak run --talk-name=org.freedesktop.secrets io.github.mrvladus.List
[DEBUG] Starting Errands 45.1.3
[DEBUG] Initialize GSettings
[DEBUG] Creating actions
[INFO] Sync: Initialize sync provider
[INFO] Sync: Initialize Nextcloud sync provider
[DEBUG] Sync: Checking credentials
[DEBUG] Sync: Checking URL
[DEBUG] Sync: URL is set to https://nextcloud.vpn/remote.php/dav/
[DEBUG] Sync: Attempting connection
[INFO] Sync: Connected to Nextcloud server at 'https://nextcloud.vpn/remote.php/dav/'
mrvladus commented 8 months ago

Ok, thanks, I'll add this to flatpak permissions

melianmiko commented 8 months ago

Fine, waiting for a new release. For now I'll use version built from sources.

mrvladus commented 8 months ago

Fixed in 45.1.4