GNOME Bugzilla – Bug 790267
Expired Google OAuth2 token not refreshed
Last modified: 2017-11-23 11:06:54 UTC
Evolution reports this error on my gmail account when I try to fetch new mail after ~ 30 minutes on a gnome session. If I log out and in again everything's fine... for a while - after ~ 30 more minutes I get this error again.
What is shown as your wifi/internet status in your gnome session after 30 minutes? Which operating system is this on?
I'm on Linux 4.9; Manjaro Linux distro. My internet connection is fine; just evolution thinks it's disconnected after a while.
Thanks for a bug report. The defined connection timeout (by corresponding RFC) is 30 minutes. After that the server can disconnect the client due to inactivity. You can either enable "Listen for server change notifications" or set some refresh interval lower than 30 minutes in account Properties->Receiving Options tab. Do you have both off or the refresh interval more than 30 minutes?
Created attachment 363765 [details] evolution screenshot and $last command (login time) With "Listen for server change notifications" ON I get this error not in ~ 30 minutes but upon several hours of login.
Okay, thanks for the confirmation. What does right-click the account name in the folder tree->Properties->Receiving Options tab look like, please? I guess that it lasts working fine for longer than 30 minutes is due to the IDLE being invoked every 29 minutes. From that I'd say it failed to save changes and moved to offline only due to the refresh being delayed for some reason. A usual way of dealing with this is to set the refresh interval to some low-enough value, but I guess you do not have set that up at all (that's why I'd like to see the Receiving Options tab).
Created attachment 363833 [details] receiving options I'll test this settings now; last time I only had 'Listen for server server notifications' ON and now I'll experiment a 20 minute interval for mail check/refresh.
I've played around for a while more: - First, this must be related to this: https://mail.gnome.org/archives/evolution-list/2016-January/msg00082.html - Second, it happens when evolution checks for new mail automatically - I turned this option off on the Receiving Options tab and so far everything's OK - Third, if you modify other stuff such as 'check for junk messages' in the Receiving Options evolution immediately thinks it's offline
(In reply to Luis Henrique Mello from comment #7) > - First, this must be related to this: > https://mail.gnome.org/archives/evolution-list/2016-January/msg00082.html Ah, I see, so this is about a connection to Gmail, right? Do you connect it using GNOME Online Accounts or you configured the account directly in evolution? > - Third, if you modify other stuff such as 'check for junk messages' in the > Receiving Options evolution immediately thinks it's offline Yes, that's intentional, the options changes can lead to change in what is seen in the GUI. Doing any operation on the account, like entering a folder, will eventually connect the account (not evolution as a whole). I think this is: [1] https://mail.gnome.org/archives/evolution-list/2017-November/msg00075.html
I broke it with this commit: https://git.gnome.org/browse/evolution-data-server/commit/?id=116422cb0aefcd582
(In reply to Milan Crha from comment #8) > (In reply to Luis Henrique Mello from comment #7) > > - First, this must be related to this: > > https://mail.gnome.org/archives/evolution-list/2016-January/msg00082.html > > Ah, I see, so this is about a connection to Gmail, right? Do you connect it > using GNOME Online Accounts or you configured the account directly in > evolution? I configured it directly in evolution.
Thanks for the update. That means it's the same issue as on the evolution-list. I extended the commit mentioned in comment #9 in a way which fixes the issue. The next release of eds is planned for December 11th. I may release it sooner, if needed, though I also noticed one more issue which I'd like to address (or at least investigate) first. Created commit 8c18d26ae in eds master (3.27.3+) Created commit c5462c13f in eds gnome-3-26 (3.26.3+)
For a record, I made two more changes in eds [1][2], both for master and gnome-3-26 branches, will be part of the same versions as noted above. [1] https://git.gnome.org/browse/evolution-data-server/commit/?h=gnome-3-26&id=42e54328277d03bf30280bb6a63d09449f850cfc [2] https://git.gnome.org/browse/evolution-data-server/commit/?h=gnome-3-26&id=d49070c1a480fb01519ad56eb5a28d20ad4a7d15
*** Bug 790590 has been marked as a duplicate of this bug. ***
Book/calendar part didn't work properly. Its workflow was: a) try with empty credentials => fail with CREDENTIALS_REQUIRED response b) source registry noticed it and asked for credentials, but the Google provider returned no credentials when reading them from the store (due to expired access token) c) left the source wait for credentials until they are provided by some GUI application d) in case of Evolution it could show either "Unknown error" or "Credentials required" error in the UI, instead of refreshing the token. This changes the b) in a way that when the lookup fails, but it still can read credentials, only the token is expired, then it'll refresh it and save, which will connect the book/calendar without a need for a GUI application with running credentials prompter. This might be the last bit, it should work properly again. Created commit 73861538b in eds master (3.27.3+) Created commit afdce148a in eds gnome-3-26 (3.26.3+)