Bug 428762 - Akonadi is asking for gmail authentication every 10ish minutes?
Summary: Akonadi is asking for gmail authentication every 10ish minutes?
Status: CONFIRMED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.15.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-06 17:07 UTC by ivan.planinar
Modified: 2024-04-03 15:41 UTC (History)
22 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Akonadi allow screen (201.60 KB, image/jpeg)
2020-11-07 21:42 UTC, ivan.planinar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ivan.planinar 2020-11-06 17:07:32 UTC
SUMMARY

Even though I have allowed it like xyz-nth of time, it STILL is opening google windows asking for effing email and password to allow it for millionth of time.

STEPS TO REPRODUCE
1. Assign 2 new gmail accounts.
2. Let Akonadi "sort" things with passwords and credentials, using Kwallet.
3. After everything done, Akonadi will periodically display Google gmail windows, asking me to allow the usage, email and pass and approval.

OBSERVED RESULT
Big frustration.

EXPECTED RESULT
No frustration.

Latest KDE/Plasma, Arch Linux, latest kernel, Nvidia drivers.
Comment 1 ivan.planinar 2020-11-06 20:13:19 UTC
And this is what I get usually when I restart in notifications:

Resource Google Mail (xyz@gmail.com) is broken.
Could not read the password: user rejected wallet access
Comment 2 foss 2020-11-07 11:30:38 UTC
Do you have "Prompt when an application accesses a wallet" enabled?
Kwalletmanager -> Settings -> Configure Wallet.. -> Access Control.
In that case, you could grant access (permanent/ask every time...). Can you upload a screenshot showing the "Big frustration"?
Comment 3 ivan.planinar 2020-11-07 15:32:05 UTC
(In reply to devnulll from comment #2)
> Do you have "Prompt when an application accesses a wallet" enabled?
> Kwalletmanager -> Settings -> Configure Wallet.. -> Access Control.
> In that case, you could grant access (permanent/ask every time...). Can you
> upload a screenshot showing the "Big frustration"?

I'm sorry I'm not following you - do I have to have Access control enabled or not?

Because it wasn't enabled. I enabled it now, even though there isn't a single policy in the list there. But I will wait until akonadi prompts me again to see if something changed.

I will screenshot it when it happens.
Comment 4 ivan.planinar 2020-11-07 15:53:18 UTC
Alright it asked me now 3 times to access the wallet after restart and I chose "Always allow". I will see if that will make any difference from now on. It should never ask me again about it, if it does work.

But still, this isn't quite logical for new users. This app should work out of the box. The only settings I expect(ed) from the mail program is to set the mail parameters and once set, to be done. 

Here I had kmail -> akonadi -> kwallet in the play and I had to reset akonadi 3 times and start over again and STILL had those popups every now and then. 
The only thing that kept me going was the urge to use the official KDE mail app.  If I was the average Joe I'd use Thunderbird without thinking twice, esp. with these kind of stuff.
Comment 5 ivan.planinar 2020-11-07 16:33:37 UTC
After restart I got another notification:

Resource Google Mail (xyz@gmail.com) is broken.
Could not read the password: user rejected wallet access 

So, how is it possible to have rejected wallet access if it's allowed now for good?
Comment 6 Thiago Sueto 2020-11-07 20:52:27 UTC
I was experiencing this issue on master one or two weeks ago.
I only had one google account set up, however I installed a quadriboot recently and haven't managed to test this further yet with Plasma from master. I'll test this weekend and report back.

I also suspect this was an issue with KWallet, because my account was recognized and worked correctly as usual with KMail2/Kontact on openSUSE Krypton for at least half a year or so without issues.

In my case, it was reproducible every time my system came back from sleep or everytime after login.

Ivan, is there anything noteworthy being shown in journalctl -b /usr/bin/kmail /usr/bin/akonadiserver /usr/bin/akonadi_google_resource /usr/bin/kwalletd5 ?

For debugging akonadi issues, there's also akonadiconsole, but that one I don't know how to use.
Comment 7 ivan.planinar 2020-11-07 21:42:51 UTC
Created attachment 133119 [details]
Akonadi allow screen
Comment 8 ivan.planinar 2020-11-07 21:46:11 UTC
Thiago,

No, nothing suspicious in journal. 
Kwallet left this in journal, but it was marked yellow and not red

"Application ' "akonadi_imap_resource_1" ' using kwallet without parent window!"

Akonadi asked me AGAIN today, out of the blue. I put the screenshot above of the screen.
Comment 9 ivan.planinar 2020-11-07 21:48:08 UTC
I have to say the above screen appeared about 30min after I added my 2nd account in kmail. However, it was asking for my FIRST email address.
Comment 10 Bruno Guedes 2020-11-08 12:55:26 UTC
I can also confirm this bug
Akonadi asks me for permission in my gmail every 30~45 minutes.

config:

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.0
Kernel Version: 5.4.0-52-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 7,2 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Comment 11 ivan.planinar 2020-11-09 23:04:31 UTC
Something happened and Akonadi is not asking me again. It works.

Funny thing - I was so fed up with this that I installed Thunderbird (that flawlessly worked out of the box). After that Akonadi started working nicely.

Competition is a nice thing, even artificial programs know. xD

On a more serious note, the only thing that I did was deleting second SMTP line that I added for my 2nd gmail address and making sure the first one was set up nicely - it was not. 

Apparently, kmail2 didn't use right protocols in smtp for gmail as google suggested and what Thunderbird set out of the box.
Comment 12 João Figueiredo 2020-11-20 21:41:06 UTC
Can confirm this too. I have two gmail addresses set up, and it opens the browser asking for authentication whenever I restart the computer or when it comes back from sleep (whenever kwallet closes, maybe? That would explain why I don't get it every 10 minutes, mine is set to always open, I'm guessing it only closes when restarting or going to sleep)
Comment 13 João Figueiredo 2020-11-27 17:25:41 UTC
As a workaround: Configure KMail... -> Accounts -> Receiving -> <your account> -> Modify... -> Advanced -> Authentication -> PLAIN (instead of Gmail)
No more big frustration :)
Comment 14 ivan.planinar 2020-12-11 01:36:43 UTC
I started getting this bug again after recent 20.12 update. 

I will seriously switch to Thunderbird if I don't fix it tomorrow somehow. 

Far too many bugs for such a simple program. From failed email fetching to this atrocious spam behaviour of Akonadi.
Comment 15 Thiago Sueto 2020-12-12 03:34:01 UTC
Can anyone else confirm this occurs on current KMail from master?
I don't think I'm experiencing this anymore. I can confirm this for real after this weekend.
Comment 16 Thiago Sueto 2020-12-12 16:49:16 UTC
No, my mistake. But it seems to only happen after KWallet asks for my permission to access akonadi_imap_resource.
Comment 17 Bruno Guedes 2020-12-13 02:14:08 UTC
(In reply to Thiago Sueto from comment #15)
> Can anyone else confirm this occurs on current KMail from master?
> I don't think I'm experiencing this anymore. I can confirm this for real
> after this weekend.

It happened all the time when I was using kde neon unstable (kmail git master).
But 2 weeks ago I change to manjaro (kmail 20.08) and the bug did not happened anymore. Until I updated kmail to 20.12 and it started asking googles permission again. It happens in an interval of about a 2 hours from one another.

Obs.: I don't really know if the previous version before I updated manjaro was 20.08 but it was the las release before 20.12.
Comment 18 Karsten.Fleischer 2020-12-13 21:34:10 UTC
(In reply to Thiago Sueto from comment #15)
> Can anyone else confirm this occurs on current KMail from master?
> I don't think I'm experiencing this anymore. I can confirm this for real
> after this weekend.

Same here on OpenSuse Leap 15.2 using the latest 20.12.0 build by the opensuse repositories
(issue started in the 20.12 betas, 20.08 was ok)
Comment 19 sa666666 2020-12-16 13:55:30 UTC
Confirmed for me also on the latest Neon stable.  Happened just after the last update, about a week ago.  So in 20.12, as others have mentioned.
Comment 20 Colin J Thomson 2020-12-20 10:32:26 UTC
Confirmed here also. This issue appeared in 20.12. 
Even if I'm still logged into Google on the next reboot I am presented with the confirmation box as in Ivan's screenshot.

This does not happen on my other Non Google Imap accounts. So for now I have rolled back to 20.08.

Operating System: Fedora 33 + Zawertun Plasma COPR
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.9.15-200.fc33.x86_64
Comment 21 Marco Albanese 2020-12-28 11:24:21 UTC
Could it be related with bug 429406 ?
Comment 22 Antonio Rojas 2020-12-28 14:55:40 UTC
(In reply to Marco Albanese from comment #21)
> Could it be related with bug 429406 ?

The original issue is not (it was reported for 20.08), but this has been hijacked now by duplicates of 429406
Comment 23 Robert Riemann 2020-12-29 09:07:00 UTC
Same issue since I updated yesterday my opensuse tumbleweed to VERSION_ID="20201227" (from /etc/os-release)
Comment 24 paclarushtaonas 2021-01-06 15:14:17 UTC
(In reply to João Figueiredo from comment #13)
> As a workaround: Configure KMail... -> Accounts -> Receiving -> <your
> account> -> Modify... -> Advanced -> Authentication -> PLAIN (instead of
> Gmail)
> No more big frustration :)

I tried that and it broke. The email completeley disconnected and I had to revert to the previous annoying (but working) config.
Comment 25 obnosim 2021-01-08 01:19:20 UTC
I get the same behavior as João Figueiredo. Every single time my computer wakes from sleep or boots, I get one authentication window for each gmail account I have set up in kmail, and if I don't go through the authentication process, kmail does can neither send nor receive emails (but there is no visual feedback to indicate it, I had to test it out by sending emails from one account to the other).
As of today, the same windows randomly open while the computer is idle but not sleeping (it happened 4 times, twice per gmail account, within the span of 4 hours this afternoon (and never both at the same time).

This did not occur to me before the third week of December.

openSUSE Tumbleweed (all latest) x64
Comment 26 Salvatore 2021-01-08 06:45:03 UTC
(In reply to paclarushtaonas from comment #24)
> (In reply to João Figueiredo from comment #13)
> > As a workaround: Configure KMail... -> Accounts -> Receiving -> <your
> > account> -> Modify... -> Advanced -> Authentication -> PLAIN (instead of
> > Gmail)
> > No more big frustration :)
> 
> I tried that and it broke. The email completeley disconnected and I had to
> revert to the previous annoying (but working) config.

It works for me if I create a password for receiving and a password for sending
Comment 27 Karsten.Fleischer 2021-01-08 09:36:36 UTC
Hi, app-passwords are only a workaround, no solution. I have a work gmail account, where "insecure" app-passwords will be banned within the next months for admittedly incomprehensible reasons.

Not 100% sure but the problem seems to be related to a change in the way the oauth process is triggered. in 20.04 it was a kmail owned window, while in 20.12 a separate system browser window is opened. Is it possible there is an issue with storing the cookie between the two different applications?
Comment 28 Antonio Rojas 2021-01-08 09:40:21 UTC
(In reply to Karsten.Fleischer from comment #27)
> Not 100% sure but the problem seems to be related to a change in the way the
> oauth process is triggered. in 20.04 it was a kmail owned window, while in
> 20.12 a separate system browser window is opened. Is it possible there is an
> issue with storing the cookie between the two different applications?

The 20.12 issue is already being tracked, and a fix is available, at bug 429406
Comment 29 Karsten.Fleischer 2021-01-08 09:47:37 UTC
(In reply to Antonio Rojas from comment #28)
> (In reply to Karsten.Fleischer from comment #27)
> > Not 100% sure but the problem seems to be related to a change in the way the
> > oauth process is triggered. in 20.04 it was a kmail owned window, while in
> > 20.12 a separate system browser window is opened. Is it possible there is an
> > issue with storing the cookie between the two different applications?
> 
> The 20.12 issue is already being tracked, and a fix is available, at bug
> 429406

Brilliant. Many Thanks!
Comment 30 Thiago Sueto 2021-01-12 02:33:22 UTC
(In reply to Antonio Rojas from comment #28)
> (In reply to Karsten.Fleischer from comment #27)
> > Not 100% sure but the problem seems to be related to a change in the way the
> > oauth process is triggered. in 20.04 it was a kmail owned window, while in
> > 20.12 a separate system browser window is opened. Is it possible there is an
> > issue with storing the cookie between the two different applications?
> 
> The 20.12 issue is already being tracked, and a fix is available, at bug
> 429406

Does this mean this report is a duplicate of bug 429406? Or are those different issues?
Comment 31 Thiago Sueto 2021-01-18 17:31:34 UTC
Could someone please test this on current Plasma from git?
It seems to be no longer reproducible on my machine, so either this bug was a duplicate and it's been fixed by Antonio Rojas or my actual issue was bug 429406.
Comment 32 Dominik Kummer 2022-01-10 12:26:57 UTC
I use GPG based wallets. After login I am asked for its password. If I do not enter the password just in time, akonadi is not able to access the wallet anymore, and starts to ask for the email login credentials. Even if I manually open the wallet in kwallet, akonadi still refuses to fetch credentials from it. I tried to delete the relevant Kwallet Access Control, without success. 

Finally I had to restart Akonadi Server which works.

This is reproducable every time, If I do not enter the GPG password just in time. Like you know, login SDDM and cook some coffee. Meanwhile gpg askpass is sitting there waiting for credentials, and akonadi cannot access kwallet. After a certain timeout akonadi-kwallet connection breaks somehow.
Comment 33 Stefan Kelemen 2023-11-08 09:14:49 UTC
Shutdown akonadi with "akonadictl stop" doesnt work properly, you have to kill the remaining processes too, then the login doesnt spam the auth window.
Looks like a akonadi bug when shutting down akonadi or the imap resource AND the cockie handling after reauth