Bug 415956

Summary: Akonadi 19.12.x crash when socket file for connection to postgresql database disappear
Product: [Frameworks and Libraries] Akonadi Reporter: Bruno Friedmann <bruno>
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: bruno
Priority: NOR Keywords: drkonqi
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Complete backtrace
Related backtrace

Description Bruno Friedmann 2020-01-07 08:02:25 UTC
Application: akonadiserver (5.13.0 (19.12.0))

Qt Version: 5.13.1
Frameworks Version: 5.65.0
Operating System: Linux 5.3.12-2-default x86_64
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- What I was doing when the application crashed: After a night where kmail was running I was sorting my email, some trashed some moved around in folders, after the second delete the mail stay in inbox, and then some seconds after 5 to 10 the crash occurs.

No special messages found in system logs except the traditionnal ProtocolException thrown:Timeout while waiting for data
Nor any special message from the database (central postgresql)

The crash can be reproduced every time.

-- Backtrace (Reduced):
#11 0x00007f511be9bea3 in qTerminate () at global/qglobal.cpp:3252
#12 0x00007f511be9d900 in QThreadPrivate::start (arg=0x55eed7568160) at thread/qthread_unix.cpp:372
[...]


The reporter indicates this bug may be a duplicate of or related to bug 414974, bug 414885.

Possible duplicates by query: bug 415930, bug 415815, bug 415634, bug 415339, bug 415068.

Reported using DrKonqi
Comment 1 Bruno Friedmann 2020-01-07 08:06:20 UTC
Created attachment 124952 [details]
Complete backtrace

This as to be done manually drkonqi getting an error when it submit the bug about can't create attachement or private comment.
Comment 2 Bruno Friedmann 2020-01-09 13:31:07 UTC
Application: akonadiserver (5.13.0 (19.12.0))

Qt Version: 5.13.1
Frameworks Version: 5.65.0
Operating System: Linux 5.3.12-2-default x86_64
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- What I was doing when the application crashed:
Reading mail after having let kmail2 open and idle during 2,3 hours.

One interesting log in console
ProtocolException thrown:Timeout while waiting for data
ProtocolException thrown:ProtocolException thrown:Timeout while waiting for dataProtocolException thrown:Timeout while waiting for data

Timeout while waiting for data
ProtocolException thrown:ProtocolException thrown:Timeout while waiting for dataTimeout while waiting for data

ProtocolException thrown:Timeout while waiting for data
org.kde.pim.akonadiserver: NotificationSubscriber for "MailFilterCollectionMonitor - 94151401733072" : timeout writing into stream
org.kde.pim.akonadiserver: Subscriber "SpecialCollectionsMonitor - 94000591742048" disconnected
org.kde.pim.akonadiserver: Subscriber "KMail Kernel ETM - 94000592474800" disconnected
ProtocolException thrown:Failed to write data to stream
terminate called after throwing an instance of 'Akonadi::ProtocolException'
  what():  Failed to write data to stream
KCrash: Application 'akonadiserver' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi from kdeinit
sock_file=/run/user/1502/kdeinit5__0
org.kde.pim.akonadiserver: DATABASE ERROR:
org.kde.pim.akonadiserver:   Error code: ""
org.kde.pim.akonadiserver:   DB error:  "could not receive data from server: Bad file descriptor\n()"
org.kde.pim.akonadiserver:   Error text: "could not receive data from server: Bad file descriptor\n() QPSQL: Unable to create query"
org.kde.pim.akonadiserver:   Values: QMap((":0", QVariant(qlonglong, 555)))
org.kde.pim.akonadiserver:   Query: "SELECT CollectionMimeTypeRelation.Collection_id, CollectionMimeTypeRelation.MimeType_id, MimeTypeTable.name FROM CollectionMimeTypeRelation LEFT JOIN MimeTypeTable ON ( MimeTypeTable.id = CollectionMimeTypeRelation.MimeType_id ) WHERE ( CollectionMimeTypeRelation.Collection_id IN ( :0 ) ) ORDER BY CollectionMimeTypeRelation.Collection_id ASC"
org.kde.pim.akonadiserver: Handler exception when handling command FetchCollections on connection akonadi_mailfilter_agent (0x55ba851efb50) : Unable to retrieve mimetypes for listing
org.kde.pim.akonadiserver: Shutting down "akonadi_mailfilter_agent" ...
ProtocolException thrown:Timeout while waiting for data
ProtocolException thrown:Timeout while waiting for data

Database inside log
Jan 09 14:12:05 qt-kt postgres[21454]: [7-1] 2020-01-09 14:12:05.264 CET 1 21454 bf_akonadi  bf_akonadi LOG:  could not receive data from client: Connection reset by peer

The socket file has been recreated at crash time
ll /run/postgresql/
total 8
srwxrwxrwx 1 postgres postgres  0 Jan  9 14:09 .s.PGSQL.5432
-rw------- 1 postgres postgres 60 Jan  9 14:09 .s.PGSQL.5432.lock
-rw-r--r-- 1 postgres postgres  5 Jan  7 20:23 postmaster.pid

while the server is up since Jan 5th.

So while it is certainly not ideal to have the socket file that disappear, akonadi should be resilient to this error, and not crash as it do.

The crash can be reproduced every time.


Possible duplicates by query: bug 415991, bug 415962, bug 415956, bug 415930, bug 415815.
Comment 3 Bruno Friedmann 2020-01-09 13:31:33 UTC
Created attachment 124997 [details]
Related backtrace

Related backtrace
Comment 4 Justin Zobel 2022-09-30 04:39:07 UTC
Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 5 Bruno Friedmann 2022-09-30 06:53:14 UTC
Seems fixed with actual version 
Version 5.21.1 (22.08.1)