GNOME Bugzilla – Bug 790590
Google calendar does not wait for gnome keyring
Last modified: 2017-11-23 10:51:10 UTC
Starting evolution with autostart of Xfce works, and I'm asked for the Gnome keyring password after startup. However evolution always has the Google Calendars with "Failed: Unknown error" and I need to press the reconnect button for all 15 calendars every startup. That this is based on the Gnome keyring unlocked later by typing the password is just my guessing, so correct the summary if this is wrong. There have been similar issues like bug 694238, but not the same.
Thanks for a bug report. Evolution(-data-server in this case) has no influence on gnome-keyring, it even doesn't talk to it directly. It uses libsecret, which hides many things about the actual storage or service it accesses. As a test, will the calendars work properly when you not autostart evolution on the session start? You will be asked for the keyring password anyway, because other processes like evolution-alarm-notify may want to load the calendars, but also evolution-source-registry will try to search for existing calendars provided by the Google server and add/remove them to/from existing calendars. The "Unknown error" might be usually related to expired OAuth2 access tokens stored in the keyring. It makes difference when testing as suggested in the above paragraph, because when you do not run any update on the sources for more than an hour, then the token expires. When you boot the machine, which runs evolution and also updated the token, then the next login the background processes will use the still-valid token, thus it might look like working fine without evolution being auto-started. What is your exact version of evolution and evolution-data-server, please? I also think of the changes for bug #790267, because the underlying change is related to the calendars, but only for 3.26.x.
mail-client/evolution-3.24.5 gnome-extra/evolution-ews-3.24.5 gnome-extra/evolution-data-server-3.24.6 I'll check that without Evolution in autostart...
Removing Evolution from Autostart does not make gnome-keyring ask for the password anymore at startup as gnome-keyring isn't part of the Autostart currently. It only asks after starting Evolution, and then the issue does not appear anymore. Seems to be some race condition when all Autostart services are started with the WM. However I can also add gnome-keyring-daemon to the autostart.
Does the evolution-alarm-notify not run after login for you? It is supposed to. it will run other processes, like evolution-source-registry and evolution-calendar-factory, where any of these can request a password from the keyring. I agree with your that it looks like some kind of race between started processes/services. I'm afraid evolution(-data-server) cannot do anything with it, I'm sorry.
Good news, it's not about the services order running. The "Unknown error" happened to me too today and I identified the issue down to the root cause, which is about the Google's access token being expired. I fixed it within bug #790267. I also made commit 4eba4e63ab for 3.27.3+ and commit 814730968 for 3.26.3+ to pass actual errors to the UI when the credentials are missing or invalid. That will avoid the "Unknown error" message in the UI (or at least the one related to this particular issue). *** This bug has been marked as a duplicate of bug 790267 ***