samschott / maestral

Open-source Dropbox client for macOS and Linux
https://maestral.app
MIT License
3.06k stars 65 forks source link

Autostart not working: Cannot load keyring keyring.backends.SecretService.Keyring #1058

Open elydpg opened 1 week ago

elydpg commented 1 week ago

Describe the bug Pretty much the title. When the systemd service for autostart tries to start the service on startup, it fails with this error, as seen in the below status message:

○ maestral-daemon@maestral.service - Maestral daemon for the config maestral
     Loaded: loaded (/home/elyg/.local/share/systemd/user/maestral-daemon@.service; enabled; preset: disabled)
     Active: inactive (dead) since Sun 2024-06-23 23:30:55 IDT; 33s ago
   Duration: 4ms
    Process: 2126 ExecStart=/home/elyg/.local/share/pipx/venvs/maestral/bin/maestral start --foreground --config-name maestral (code=exited, status=0/SUCCESS)
    Process: 2312 ExecStopPost=/usr/bin/env bash -c if [ ${SERVICE_RESULT} != success ]; then notify-send Maestral 'Daemon failed: ${SERVICE_RESULT}'; fi (code=exited, status=0/SUCCESS)
   Main PID: 2126 (code=exited, status=0/SUCCESS)
     Status: "Cannot load keyring keyring.backends.SecretService.Keyring. Please relink Maestral to get a new access token."
        CPU: 607ms

Jun 23 23:30:54 Elys-Aspire-A715-42G systemd[2115]: Starting Maestral daemon for the config maestral...
Jun 23 23:30:55 Elys-Aspire-A715-42G systemd[2115]: Started Maestral daemon for the config maestral.
Jun 23 23:30:55 Elys-Aspire-A715-42G maestral[2126]: Task was destroyed but it is pending!
Jun 23 23:30:55 Elys-Aspire-A715-42G maestral[2126]: task: <Task pending name='Task-1' coro=<start_maestral_daemon.<locals>.periodic_watchdog() running at /home/elyg/.local/share/pipx/venvs/maestral/lib64/python3.11/site-packages/maestral/daemon.py:431>>
Jun 23 23:30:55 Elys-Aspire-A715-42G maestral[2126]: /usr/lib64/python3.11/asyncio/base_events.py:679: RuntimeWarning: coroutine 'start_maestral_daemon.<locals>.periodic_watchdog' was never awaited

However, upon manually starting the service with systemctl --user start maestral-daemon@maestral, it runs normally. What is going on here?

System:

elydpg commented 6 days ago

For some more context: Still happening on KDE Plasma 6.1.0 with KDE Frameworks 6.3.0. As a workaround, I created a custom systemd service in which I changed the ExecStart from the default /path/to/maestral start -f to /usr/bin/bash -c "until /usr/bin/pgrep kwalletd; do /usr/bin/sleep 5; done; /path/to/maestral start --f"