Bug 434497

Summary: Gmail check fails
Product: [Frameworks and Libraries] Akonadi Reporter: medin <med.medin.2014>
Component: Gmail resourceAssignee: Daniel Vrátil <dvratil>
Status: REPORTED ---    
Severity: major CC: kdepim-bugs, lassi.vaatamoinen, me
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description medin 2021-03-16 14:13:23 UTC
I installed Kmail and it worked fine for half day then it stopped checking for new message. I found these log lines in Journal Log :

3/16/21 2:39 PM	akonadi_google_resource	org.kde.kgapi: Unauthorized. Access token has expired or is invalid.
3/16/21 2:39 PM	akonadi_google_resource	org.kde.pim.google: Got error: KGAPI2::ContactsGroupFetchJob(0x563182528350) "Invalid authentication."
3/16/21 2:39 PM	akonadi_google_resource	org.kde.kgapi: Unauthorized. Access token has expired or is invalid.
3/16/21 2:39 PM	akonadi_google_resource	org.kde.pim.google: Got error: KGAPI2::CalendarFetchJob(0x563182529a40) "Invalid authentication."
3/16/21 2:39 PM	akonadi_google_resource	org.kde.kgapi: Unauthorized. Access token has expired or is invalid.
3/16/21 2:39 PM	akonadi_google_resource	org.kde.pim.google: Got error: KGAPI2::TaskListFetchJob(0x56318252a290) "Invalid authentication."
.
.
3/16/21 2:40 PM	akonadiserver	org.kde.pim.akonadiserver.search: Search  "searchUpdate-1615902001" done (without remote search)
.
.
3/16/21 2:59 PM	kernel	audit: type=1701 audit(1615903172.948:115): auid=1001 uid=1001 gid=1001 ses=2 pid=1652 comm="akonadi_imap_re" exe="/usr/bin/akonadi_imap_resource" sig=11 res=1




I found the currect crash using coredumpctl :

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/akonadi_imap_resource --identifier akonadi_imap_resource_0'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f8656fdd74a in QSettings::setValue(QString const&, QVariant const&) () from /usr/lib/libQt5Core.so.5
[Current thread is 1 (Thread 0x7f86525a2fc0 (LWP 1652))]


Akonadi: 5.16.2
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.4.101-1-MANJARO
OS Type: 64-bit
Comment 1 medin 2021-03-16 19:57:38 UTC
Another new crash :

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/akonadi_imap_resource --identifier akonadi_imap_resource_0'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f287cc3674a in QSettings::setValue(QString const&, QVariant const&) () from /usr/lib/libQt5Core.so.5
[Current thread is 1 (Thread 0x7f28781fbfc0 (LWP 2095))]
(gdb) bt
#0  0x00007f287cc3674a in QSettings::setValue(QString const&, QVariant const&) () at /usr/lib/libQt5Core.so.5
#1  0x00007f287e6996bf in Akonadi::AgentBase::setOnline(bool) () at /usr/lib/libKF5AkonadiAgentBase.so.5
#2  0x0000562259062985 in  ()
#3  0x00007f287e6c5383 in  () at /usr/lib/libKF5AkonadiAgentBase.so.5
#4  0x00007f287cf7c066 in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f287cf7f65b in  () at /usr/lib/libQt5DBus.so.5
#6  0x00007f287cf7ff4a in  () at /usr/lib/libQt5DBus.so.5
#7  0x00007f287cf82478 in  () at /usr/lib/libQt5DBus.so.5
#8  0x00007f287cce8532 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007f287d86a752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007f287ccbba2a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#11 0x00007f287ccbe523 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#12 0x00007f287cd15054 in  () at /usr/lib/libQt5Core.so.5
#13 0x00007f287ade9b84 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#14 0x00007f287ae3dc21 in  () at /usr/lib/libglib-2.0.so.0
#15 0x00007f287ade83b1 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#16 0x00007f287cd14691 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007f287ccba3ac in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#18 0x00007f287ccc2844 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#19 0x0000562259035eca in  ()
#20 0x00007f287c669b25 in __libc_start_main () at /usr/lib/libc.so.6
#21 0x0000562259033e7e in  ()
(gdb)
Comment 2 Nicolas Fella 2022-01-10 00:03:32 UTC
*** Bug 448184 has been marked as a duplicate of this bug. ***
Comment 3 Lassi Väätämöinen 2022-11-20 19:02:08 UTC
openSUSE Tumbleweed
KMail2 5.21.3 (22.08.3)

I do have some GMail issues, as the outgoing SMTP frequently fails to smtp.google.com.
After `akonadictl restart` the issue is fixed, but then it will reproduce later on. And I have not found a permanent fix for this. 

After restargin I do see some errors at some point, but not sure how relevant these are:

---- snip----

org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7f19f42165e0) identified as "AgentBaseChangeRecorder - 94349811302496"
org.kde.kgapi: Unauthorized. Access token has expired or is invalid.
org.kde.pim.google: Got error: KGAPI2::TaskListFetchJob(0x55b89c5069a0) "Invalid authentication."
org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection akonadi_indexing_agent (0x558985ed8510)
org.kde.pim.akonadi_indexer_agent: Failed to fetch items:  "Collection does not exist"
org.kde.pim.akonadi_indexer_agent: Indexing failed:  ""
org.kde.kgapi: Unauthorized. Access token has expired or is invalid.
org.kde.pim.google: Got error: KGAPI2::CalendarFetchJob(0x55b89c30cd80) "Invalid authentication."
[SASL-XOAUTH2] - Requesting authID!
[SASL-XOAUTH2] - Requesting token!
[SASL-XOAUTH2] - filling prompts!
[SASL-XOAUTH2] - Requesting authID!
[SASL-XOAUTH2] - Requesting token!
org.kde.pim.akonadiserver.search: Executing search "searchUpdate-1668970356"
org.kde.pim.akonadiserver.search: Search  "searchUpdate-1668970356" done (without remote search)
org.kde.pim.akonadiserver.search: Search update for collection "OpenInvitations" ( 70 ) finished: all results:  0 , removed results: 0
org.kde.pim.akonadiserver.search: Executing search "searchUpdate-1668970356"
org.kde.pim.akonadiserver.search: Search  "searchUpdate-1668970356" done (without remote search)
org.kde.pim.akonadiserver.search: Search update for collection "DeclinedInvitations" ( 71 ) finished: all results:  0 , removed results: 0
org.kde.pim.akonadiserver: ItemRetrievalJob for request 20 finished
org.kde.pim.akonadiserver.search: Executing search "kontact-1401024996-SearchSession"
org.kde.pim.akonadiserver.search: Search  "kontact-1401024996-SearchSession" done (without remote search)
org.kde.pim.akonadiserver.search: Executing search "kontact-1401024996-SearchSession"
org.kde.pim.akonadiserver.search: Search  "kontact-1401024996-SearchSession" done (without remote search)
[SASL-XOAUTH2] - Requesting authID!
[SASL-XOAUTH2] - Requesting token!
[SASL-XOAUTH2] - filling prompts!
[SASL-XOAUTH2] - Requesting authID!
[SASL-XOAUTH2] - Requesting token!
org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7f19780d2ec0) )

---- end snip----