Bug 478033 - EWS accounts unusable - constantly lose authentication
Summary: EWS accounts unusable - constantly lose authentication
Status: CONFIRMED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: EWS Resource (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 483004 483116 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-04 07:43 UTC by Antonio Rojas
Modified: 2024-05-29 19:45 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2023-12-04 07:43:52 UTC
EWS accounts (Outlook365) are unusable in 24.02 beta - after authenticating, the mail is synced once, and then the account is disconnected and one needs to go to the accounts settings and re-authenticate every time.

Another system with 23.08 works fine, so this is not a server side issue.
Comment 1 Antonio Rojas 2023-12-04 21:13:46 UTC
The log is constantly being spammed (few times a second) with

org.kde.pim.ews.client: Failed to process EWS request: Access denied to https://outlook.office365.com/EWS/Exchange.asmx

messages.
Comment 2 Carl Schwan 2024-02-20 14:57:30 UTC
I can sometimes confirm this issue. Just to be sure that the issue I have is the same as yours, do you have in kwalletmanager no entry for akonadi-ews?
Comment 3 Antonio Rojas 2024-02-20 18:36:46 UTC
(In reply to Carl Schwan from comment #2)
> I can sometimes confirm this issue. Just to be sure that the issue I have is
> the same as yours, do you have in kwalletmanager no entry for akonadi-ews?

I do have one
Comment 4 Carl Schwan 2024-02-21 10:23:46 UTC
Ok finally managed to get the exact same error mesage too after a reboot :(

Failed to process EWS request: Access denied to https://outlook.office365.com/EWS/Exchange.asmx.
Comment 5 Antonio Rojas 2024-03-09 18:25:22 UTC
*** Bug 483004 has been marked as a duplicate of this bug. ***
Comment 6 agapp11@hotmail.com 2024-03-09 19:01:26 UTC
(In reply to Carl Schwan from comment #4)
> Ok finally managed to get the exact same error mesage too after a reboot :(
> 
> Failed to process EWS request: Access denied to
> https://outlook.office365.com/EWS/Exchange.asmx.

It seems like its not authenticating properly - ie it can't store/use the credentials you previously used.
Comment 7 Antonio Rojas 2024-03-10 15:52:54 UTC
*** Bug 483116 has been marked as a duplicate of this bug. ***
Comment 8 Carl Schwan 2024-03-11 13:22:12 UTC
So with https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/148 and https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 the situation looks quite a bit better here. Testing and code review welcome
Comment 9 Antonio Rojas 2024-03-11 16:25:30 UTC
(In reply to Carl Schwan from comment #8)
> So with https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/148 and
> https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 the situation
> looks quite a bit better here. Testing and code review welcome

With these I can't even authenticate once.

org.kde.pim.ews.client: Failed to retrieve authentication data
org.kde.pim.ews.client: Failed to retrieve authentication data
org.kde.pim.ews: Authentication failed:  Access token request failed
org.kde.pim.ews.client: Failed to process EWS request: 
org.kde.pim.ews: requestAuthFailed - going offline
org.kde.pim.ews.client: Failed to process EWS request: 
org.kde.pim.ews: requestAuthFailed - going offline
Please register the custom scheme 'urn' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
org.kde.pim.ews.client: Starting OAuth2 authentication
org.kde.pim.ews.client: Launching browser for authentication
org.kde.pim.ews.client: PKeyAuth certificates not found
org.kde.pim.ews.client: Authentication succeeded
Please register the custom scheme 'urn' via QWebEngineUrlScheme::registerScheme() before installing the custom scheme handler.
org.kde.pim.ews: Authentication failed:  Access token request failed
Comment 10 Paolo Pedroni 2024-03-11 16:27:18 UTC
(In reply to Carl Schwan from comment #8)
> So with https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/148 and
> https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 the situation
> looks quite a bit better here. Testing and code review welcome

Now authentication does not work anymore. At all. :(((
Comment 11 Antonio Rojas 2024-03-11 18:57:47 UTC
With https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 *only* things do indeed look better: running two hours now without reauthenticating.
Comment 12 agapp11@hotmail.com 2024-03-11 19:51:18 UTC
(In reply to Antonio Rojas from comment #11)
> With https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 *only*
> things do indeed look better: running two hours now without reauthenticating.

Authentication usually breaks after sleeping and waking up for me.
Comment 13 Antonio Rojas 2024-03-12 10:26:53 UTC
After running overnight on two machines, I confirm that https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 fixes the authentication problems.

Mail push doesn't work though, I need to manually check for new mail. Still it's a big improvement, and makes it sort of usable again.
Comment 14 agapp11@hotmail.com 2024-03-14 22:10:46 UTC
(In reply to Antonio Rojas from comment #13)
> After running overnight on two machines, I confirm that
> https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 fixes the
> authentication problems.
> 
> Mail push doesn't work though, I need to manually check for new mail. Still
> it's a big improvement, and makes it sort of usable again.

With the update to Plasma 6.0.2 things have gotten worse. Now the authentication breaks even during use of the computer (not after sleep like before) and sends the notification "Resource is broken. Authentication failed"

https://imgur.com/a/7xXNSWU
Comment 15 agapp11@hotmail.com 2024-03-15 13:54:43 UTC
(In reply to Antonio Rojas from comment #13)
> After running overnight on two machines, I confirm that
> https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 fixes the
> authentication problems.
> 
> Mail push doesn't work though, I need to manually check for new mail. Still
> it's a big improvement, and makes it sort of usable again.

I tried adding a coredump, but it failed:

sudo DEBUGINFOD_URLS="https://debuginfod.archlinux.org/" coredumpctl gdb akonadi_ews_res
           PID: 81739 (akonadi_ews_res)
           UID: 1000 (user)
           GID: 984 (users)
        Signal: 11 (SEGV)
     Timestamp: Thu 2024-03-14 19:27:58 EDT (14h ago)
  Command Line: /usr/bin/akonadi_ews_resource --identifier akonadi_ews_resource_1
    Executable: /usr/bin/akonadi_ews_resource
 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-\x2fusr\x2fbin\x2fkalendarac-bf46d99cd787466cbfd9b076903ccf41.scope
          Unit: user@1000.service
     User Unit: app-\x2fusr\x2fbin\x2fkalendarac-bf46d99cd787466cbfd9b076903ccf41.scope
         Slice: user-1000.slice
     Owner UID: 1000 (user)
       Boot ID: 18aad9b1c5644cd0814cdb935d9f46a3
    Machine ID: afcb8c18015840e78cafef756964cd31
      Hostname: user-archbox
       Storage: none
       Message: Process 81739 (akonadi_ews_res) of user 1000 terminated abnormally without generating a coredump.

Coredump entry has no core attached (neither internally in the journal nor externally on disk).
Comment 16 agapp11@hotmail.com 2024-03-21 18:09:40 UTC
(In reply to Antonio Rojas from comment #13)
> After running overnight on two machines, I confirm that
> https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 fixes the
> authentication problems.
> 
> Mail push doesn't work though, I need to manually check for new mail. Still
> it's a big improvement, and makes it sort of usable again.

Thanks for fixing it! Now a new error shows up:

https://imgur.com/a/nBXa1Vq

`Email sending failed: Failed to get D-Bus interface of mailfilteragent` 

Not sure if its important but I thought i'd mention it.
Comment 17 Paolo Pedroni 2024-03-26 16:41:32 UTC
Basic functionality now (24.02.1) works, but:
- it keeps spamming the system log with "org.kde.pim.ews.client: Failed to process EWS request:" messages
- it leaks memory and after a few hours it fills RAM and swap space and then the PC freezes until the OOM killer kicks in.
Comment 18 Martin Tlustos 2024-03-27 14:01:19 UTC
I can confirm that akonadi ews resource keeps growing in memory usage, although it's not that big for me - only from 25mb to 87 mb in 6 hours or so...
Comment 19 m.orly97 2024-03-27 14:11:04 UTC
(In reply to Martin Tlustos from comment #18)
> I can confirm that akonadi ews resource keeps growing in memory usage,
> although it's not that big for me - only from 25mb to 87 mb in 6 hours or
> so...

I also confirm the memory leak. In my case it's much serious, I have two EWS accounts for my organization and they reach over 1 GB after 1 hour.
Comment 20 agapp11@hotmail.com 2024-05-28 23:56:02 UTC
(In reply to Antonio Rojas from comment #11)
> With https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 *only*
> things do indeed look better: running two hours now without reauthenticating.

Kmail doesn't work at all now.

After some time I get my IMAP hotmail account giving an error it can't authenticate the account any longer (though it works initially) and EWS is just broken and can't authenticate the account (gives an "access is denied" error when it did not previously).

Can it be fixed please? Kmail is a nice client for linux and is almost the only one that has EWS working for my organization.
Comment 21 Antonio Rojas 2024-05-29 06:26:10 UTC
(In reply to agapp11@hotmail.com from comment #20)
> (In reply to Antonio Rojas from comment #11)
> > With https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 *only*
> > things do indeed look better: running two hours now without reauthenticating.
> 
> Kmail doesn't work at all now.
> 
> After some time I get my IMAP hotmail account giving an error it can't
> authenticate the account any longer (though it works initially) and EWS is
> just broken and can't authenticate the account (gives an "access is denied"
> error when it did not previously).
> 
> Can it be fixed please? Kmail is a nice client for linux and is almost the
> only one that has EWS working for my organization.

24.05 comes with IMAP OAUTH support for Outlook, works great for me.
Comment 22 agapp11@hotmail.com 2024-05-29 13:18:50 UTC
(In reply to Antonio Rojas from comment #21)
> (In reply to agapp11@hotmail.com from comment #20)
> > (In reply to Antonio Rojas from comment #11)
> > > With https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/149 *only*
> > > things do indeed look better: running two hours now without reauthenticating.
> > 
> > Kmail doesn't work at all now.
> > 
> > After some time I get my IMAP hotmail account giving an error it can't
> > authenticate the account any longer (though it works initially) and EWS is
> > just broken and can't authenticate the account (gives an "access is denied"
> > error when it did not previously).
> > 
> > Can it be fixed please? Kmail is a nice client for linux and is almost the
> > only one that has EWS working for my organization.
> 
> 24.05 comes with IMAP OAUTH support for Outlook, works great for me.

I cannot login due to the following error:

 https://imgur.com/a/ijkCirL

I will add the error I get with my main hotmail account next time it shows up
Comment 23 Antonio Rojas 2024-05-29 13:57:38 UTC
(In reply to agapp11@hotmail.com from comment #22)
> I cannot login due to the following error:
> 
>  https://imgur.com/a/ijkCirL
> 
> I will add the error I get with my main hotmail account next time it shows up

You're still using the EWS resource, not IMAP
Comment 24 agapp11@hotmail.com 2024-05-29 14:20:58 UTC
(In reply to Antonio Rojas from comment #23)
> (In reply to agapp11@hotmail.com from comment #22)
> > I cannot login due to the following error:
> > 
> >  https://imgur.com/a/ijkCirL
> > 
> > I will add the error I get with my main hotmail account next time it shows up
> 
> You're still using the EWS resource, not IMAP

Oh. Is it possible to use EWS with IMAP? I am trying to login to my work EWS account and am getting this error.
Comment 25 agapp11@hotmail.com 2024-05-29 14:41:23 UTC
(In reply to Antonio Rojas from comment #23)
> (In reply to agapp11@hotmail.com from comment #22)
> > I cannot login due to the following error:
> > 
> >  https://imgur.com/a/ijkCirL
> > 
> > I will add the error I get with my main hotmail account next time it shows up
> 
> You're still using the EWS resource, not IMAP

So for IMAP OAUTH support, it doesn't work for my organization due to the way its set up. It gives the error "Needs Admin Approval" and IT does not want to give due to not knowing what Kmail. They say to just switch to outlook. EWS (where you login from external page) used to work fine, but now it doesn't.

https://imgur.com/a/xSIIgtO
Comment 26 agapp11@hotmail.com 2024-05-29 19:45:14 UTC
(In reply to Antonio Rojas from comment #23)
> (In reply to agapp11@hotmail.com from comment #22)
> > I cannot login due to the following error:
> > 
> >  https://imgur.com/a/ijkCirL
> > 
> > I will add the error I get with my main hotmail account next time it shows up
> 
> You're still using the EWS resource, not IMAP

Here is the issue I get with IMAP hotmail constantly crashing. I tried reinstalling Kmail but it keeps showing up:

https://imgur.com/a/kG1rDfu