Bug 403982

Summary: EWS gets stuck in "Retrieving collection tree"
Product: [Frameworks and Libraries] Akonadi Reporter: Aaron Williams <aaronw>
Component: EWS ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: krissn, Martin
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Aaron Williams 2019-02-06 04:48:47 UTC
SUMMARY
I have run into an issue where every time I try and retrieve email from an
Office 365 email account using EWS it hangs at "Retrieving collection tree".

I have restarted the EWS resource, akonadi and kontact multiple times to no
avail.

In the logging I see it is able to fetch all of the emails, but none get
displayed, presumably because it is stuck retrieving the collection tree.

STEPS TO REPRODUCE
1. Configure an EWS account with a lot of email in it
2. Try and synchronize to that account
3. Watch it get stuck at "Retrieving collection tree"

OBSERVED RESULT
It gets stuck retrieving the collection tree. I do not see any messages in
the log indicating why it is stuck (or where for that matter).

EXPECTED RESULT
I expect it to complete

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: OpenSUSE 15.0 with latest KDE (18.12.1)
(available in About System)
KDE Plasma Version: 5.14.90
KDE Frameworks Version: 5.54.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
I tried to abort but abort doesn't seem to work either.
Comment 1 Aaron Williams 2019-02-06 05:05:17 UTC
I stopped Akonadi and started it from the Alonadi console. The job tracker says Akonadi::CollectionFetchJob failed at CollectionRemoteId INBOX. The resource scheduler shows it waiting on SyncTags.
Comment 2 Aaron Williams 2019-02-06 10:21:17 UTC
When Akonadi gets stuck I see akonadiserver stuck at 100% CPU basically forever.
Comment 3 Aaron Williams 2019-02-07 08:29:33 UTC
I don't know if this is related to bug# 403903 but no matter what I did I was unable to synchronize my inbox folder which has a significant number of emails. My settings were identical to another machine.

I was finally able to get it work by shutting down akonadi and kontact then replicating everything from the other computer including the database. Once I did that it started working again since it no longer had to download a lot of emails. Also, I saw it getting stuck in other stages besides retrieving collection tree.

When the server tells the client it is busy the server may report that it will be busy for several minutes.  I wonder if honoring the busy delay might help.

When it stops, all EWS log activity stops.
Comment 4 Martin Steigerwald 2019-02-07 09:37:38 UTC
Thank you Aaron, for all your valuable bug reports. I am looking forward to use Akonadi EWS myself, however I am currently still stuck with KDEPIM 18.08.1 within Debian, at least until an updated Flatpak becomes available or I install KDE Neon or so into a VM.