Bug 418293

Summary: "filter account is missing" dialog does not show account names
Product: [Frameworks and Libraries] Akonadi Reporter: Martin Koller <martin>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: ahartmetz, montel
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot

Description Martin Koller 2020-02-28 14:29:20 UTC
SUMMARY
After removing some accounts on starting akonadi I am presented with a dialog
with the title "Select Account - Mail Filter Agent"
and the text in it says "Filter account is missing. Please Select account..."
(see attached screenshot)

The problem here is that the dialog does not tell me the names of the accounts
but instead only shows the type (e.g. I have 2 POP3 accounts, but all I see is two times the same text "POP3 E-Mail Server" in the "Account Name" column, so I can not chose the right one.

SOFTWARE/OS VERSIONS
Linux openSuse tumbleweed 20200226
Comment 1 Laurent Montel 2020-03-04 12:19:18 UTC
which screenshot ?
Comment 2 Martin Koller 2020-03-04 16:15:42 UTC
Created attachment 126600 [details]
screenshot

the forgotten one ;-)
Comment 3 Andreas Hartmetz 2021-11-11 14:19:44 UTC
This seems related to bug 323455. In that case, the dialog should NOT appear, and it shouldn't be empty. In this case, I guess the dialog SHOULD appear, and again it shouldn't be empty.
Comment 4 Andreas Hartmetz 2025-05-18 17:37:54 UTC
Is this still reproducible? I have started to investigate for the related bug https://bugs.kde.org/show_bug.cgi?id=323455
Comment 5 Martin Koller 2025-05-18 20:04:33 UTC
With akonadi-server-23.08.5 on openSuse Leap 15.6 I do not see the problem any longer, which is: I now see the account name
in the first column.

However I do see another issue: when just starting "akonadictl start" I get this dialog 3 times.
Maybe related: simply _creating_ a new POP3 account with kmail and giving it a name "e.g. test", the configure dialog
still shows only "POP3 Account" instead of my given name "test".
Only after restarting akonadi server, the correct name "test" is shown
Comment 6 Andreas Hartmetz 2025-05-19 17:06:58 UTC
(In reply to Martin Koller from comment #5)
> However I do see another issue: when just starting "akonadictl start" I get
> this dialog 3 times.

Oh, that is interesting. I thought it could only happen from KMail when it loads its filters. Could you get me backtraces of MailCommon::FilterActionMissingAccountDialog::FilterActionMissingAccountDialog()?
If / when I fix https://bugs.kde.org/show_bug.cgi?id=323455, it would be nice to have it also fixed in the Akonadi server, and that decreases the attractiveness of a KMail-only fix.
Comment 7 Andreas Hartmetz 2025-05-21 12:39:27 UTC
It's probably not easy to get a backtrace from "the Akonadi server" because AFAIU mail filters run in a separate akonadi_mailfilter_agent process and you'd need to attach gdb to that one in time.
Comment 8 Christophe Marin 2025-05-21 16:18:54 UTC
(In reply to Andreas Hartmetz from comment #7)
> It's probably not easy to get a backtrace from "the Akonadi server" because
> AFAIU mail filters run in a separate akonadi_mailfilter_agent process and
> you'd need to attach gdb to that one in time.

https://techbase.kde.org/KDE_PIM/Akonadi/Development_Tools#Debugging_Akonadi_Agents should work with the mailfilter agent
Comment 9 Martin Koller 2025-05-22 10:57:36 UTC
#15 0x00007f6e6c58b19c in MailCommon::FilterActionMissingAccountDialog::FilterActionMissingAccountDialog
    (parent=0x0, this=0x55feb6a76270, lstAccount=..., filtername=...)
    at /usr/src/debug/mailcommon-25.04.1/src/filter/dialog/filteractionmissingaccountdialog.cpp:28
#16 MailCommon::MailFilter::readConfig (this=this@entry=0x7f6e080017a0, config=..., interactive=interactive@entry=true)
    at /usr/src/debug/mailcommon-25.04.1/src/filter/mailfilter.cpp:468
#17 0x00007f6e6c58bfb2 in MailCommon::MailFilter::MailFilter
    (this=0x7f6e080017a0, aConfig=..., interactive=true, needUpdate=@0x7ffd12202bc7: false, this=<optimized out>, aConfig=<optimized out>, interactive=<optimized out>, needUpdate=<optimized out>) at /usr/src/debug/mailcommon-25.04.1/src/filter/mailfilter.cpp:56
#18 0x00007f6e6c562348 in MailCommon::FilterImporterExporter::readFiltersFromConfig (config=..., emptyFilters=...)
    at /usr/src/debug/mailcommon-25.04.1/src/filter/filterimporterexporter.cpp:46
#19 0x000055feb51fe069 in FilterManager::readConfig (this=this@entry=0x55feb6a71110)
    at /usr/src/debug/kmail-25.04.1/agents/mailfilteragent/filtermanager.cpp:312
#20 0x000055feb51fe65a in FilterManager::FilterManager (this=0x55feb6a71110, parent=<optimized out>, this=<optimized out>, parent=<optimized out>)
    at /usr/src/debug/kmail-25.04.1/agents/mailfilteragent/filtermanager.cpp:291
#21 0x000055feb51fa3be in MailFilterAgent::MailFilterAgent (this=0x7ffd12202f40, id=...)
    at /usr/src/debug/kmail-25.04.1/agents/mailfilteragent/mailfilteragent.cpp:65
#22 Akonadi::AgentBase::init<MailFilterAgent> (argc=<optimized out>, argv=<optimized out>)
    at /usr/include/KPim6/AkonadiAgentBase/akonadi/agentbase.h:436
#23 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kmail-25.04.1/agents/mailfilteragent/mailfilteragent.cpp:411


since I could not directly set a breakpoint at MailCommon::FilterActionMissingAccountDialog::FilterActionMissingAccountDialog
(seems the method is probably optimized out), this is the next best thing without compiling the whole libs on my own.
HTH
Comment 10 Andreas Hartmetz 2025-05-24 12:32:48 UTC
(In reply to Martin Koller from comment #9)
> HTH

Thank you, that's great! So the error does come from the agent and in the way that I expected.

I now have a proposed fix that, if it works, should make the error disappear from both KMail and the mailfilter agent: https://invent.kde.org/pim/akonadi/-/merge_requests/260
Comment 11 Andreas Hartmetz 2025-05-27 17:47:13 UTC
> I now have a proposed fix that, if it works, should make the error disappear
> from both KMail and the mailfilter agent:
> https://invent.kde.org/pim/akonadi/-/merge_requests/260

Martin, could you try that one? I unfortunately have nothing else to go by regarding whether the fix works or not.
Comment 12 Andreas Hartmetz 2025-06-01 13:34:49 UTC
(In reply to Andreas Hartmetz from comment #11)
> > I now have a proposed fix that, if it works, should make the error disappear
> > from both KMail and the mailfilter agent:
> > https://invent.kde.org/pim/akonadi/-/merge_requests/260
> 
> Martin, could you try that one? I unfortunately have nothing else to go by
> regarding whether the fix works or not.

That change is merged now, we will see how it goes after it makes it to users with the next release. Also setting this bug to CONFIRMED because a backtrace is a pretty good confirmation (and IMO there is no need to doubt a bug report from another developer anyway, you could use your account privileges to do it yourself as far as I'm concerned).