Gnome Online Accounts - connection to Nextcloud stops working

Just remembered this threat topic.

I tried to put a new appointment into my calendar on the L5 running Byzantium and couldn’t - same error messages when I got home and looked into it.

I took the following approach:

a script to act on error messages found in the journal

purism@pureos:~/bin$ cat monitor-goa-daemon.sh 
#!/bin/bash
# 2024-08-23 goa-daemon sometimes stops working and the calendar doesn't sync nor save new entries
# Aug 23 09:37:33 pureos goa-daemon[1198]: /org/gnome/OnlineAccounts/Accounts/account_1611668450_0: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: Failed to retrieve credentials from the keyring (goa-error-quark, 4)
logger -t "$(basename $0)" "started: $@"
if $( echo $@ | grep 'Failed to retrieve credentials from the keyring' > /dev/null ); then
	notify-send "$(basename $0): keyring error" "executing goa-daemon --replace"
	logger -t "$(basename $0)" "keyring error" "executing goa-daemon --replace"
	nohup /usr/libexec/goa-daemon --replace >/dev/null &
else
	notify-send "$(basename $0): unknown" "$@"
	logger -t "$(basename $0)" "unknown" "$@"
fi

a systemd user service to start the script

purism@pureos:~$ cat .config/systemd/user/monitor-goa-daemon.service 
[Unit]
Description=act on goa-daemon errors found in journalctl
RequiresMountsFor=/run/user/1000

[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c 'if J_MSGS=$(journalctl --no-pager -b0 --cursor-file=${XDG_RUNTIME_DIR}/monitor-goa-daemon-journal-cursor -g "Setting AttentionNeeded to TRUE" GLIB_DOMAIN=goa-daemon); then /home/purism/bin/monitor-goa-daemon.sh "$J_MSGS"; fi'
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7

The journalctl call sets a cursor for the journal to the place up to where it has been read. The cursor is stored in an tmpfs and will vanish before the next boot when the call will read the journal from since the boot started and set a new cursor.

a timer to start the script regularly

purism@pureos:~$ cat .config/systemd/user/monitor-goa-daemon.timer 
[Unit]
Description=Monitor goa-daemon

[Timer]
OnCalendar=daily
Persistent=true
OnStartupSec=3m
OnUnitActiveSec=5m

[Install]
WantedBy=timers.target

activated those changes

# run as your user (probably `purism`)
systemctl --user daemon-reload
systemctl --user enable monitor-goa-daemon.timer
systemctl --user enable monitor-goa-daemon.service
systemctl --user start monitor-goa-daemon.timer

experiences

None. The phone works nice and smooth like before and the error didn’t occur, yet:

  • no problems using the calendar
  • no notification hinting that the script had been running

Update: The script fired a few times and --replaced the goa-daemon. I didn’t have problems using the calendar since I configured this. I updated the logging in the script which is reflected above. @janvlug: Still having the same problem?

3 Likes