After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790267 - Expired Google OAuth2 token not refreshed
Expired Google OAuth2 token not refreshed
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
3.26.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 790590 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-11-12 22:50 UTC by Luis Henrique Mello
Modified: 2017-11-23 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evolution screenshot and $last command (login time) (198.70 KB, image/png)
2017-11-15 21:10 UTC, Luis Henrique Mello
Details
receiving options (67.56 KB, image/png)
2017-11-16 13:51 UTC, Luis Henrique Mello
Details

Description Luis Henrique Mello 2017-11-12 22:50:14 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.
Comment 1 André Klapper 2017-11-14 00:45:15 UTC
What is shown as your wifi/internet status in your gnome session after 30 minutes? Which operating system is this on?
Comment 2 Luis Henrique Mello 2017-11-14 02:50:48 UTC
I'm on Linux 4.9; Manjaro Linux distro. My internet connection is fine; just evolution thinks it's disconnected after a while.
Comment 3 Milan Crha 2017-11-14 09:08:56 UTC
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?
Comment 4 Luis Henrique Mello 2017-11-15 21:10:26 UTC
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.
Comment 5 Milan Crha 2017-11-16 13:13:45 UTC
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).
Comment 6 Luis Henrique Mello 2017-11-16 13:51:38 UTC
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.
Comment 7 Luis Henrique Mello 2017-11-17 18:24:02 UTC
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
Comment 8 Milan Crha 2017-11-20 14:01:09 UTC
(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
Comment 9 Milan Crha 2017-11-20 15:46:15 UTC
I broke it with this commit:
https://git.gnome.org/browse/evolution-data-server/commit/?id=116422cb0aefcd582
Comment 10 Luis Henrique Mello 2017-11-20 15:52:34 UTC
(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.
Comment 11 Milan Crha 2017-11-20 17:37:18 UTC
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+)
Comment 12 Milan Crha 2017-11-21 13:07:25 UTC
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
Comment 13 Milan Crha 2017-11-23 10:51:10 UTC
*** Bug 790590 has been marked as a duplicate of this bug. ***
Comment 14 Milan Crha 2017-11-23 11:06:54 UTC
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+)