Bug 403034 - SQLite backend encounters DATABASE ERROR " Parameter count mismatch"
Summary: SQLite backend encounters DATABASE ERROR " Parameter count mismatch"
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 415957 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-09 13:05 UTC by Erik Quaeghebeur
Modified: 2025-06-11 23:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Example output for failed marking as read for mails (9.42 KB, text/plain)
2019-01-09 13:05 UTC, Erik Quaeghebeur
Details
Example output for unknown operation (7.42 KB, text/plain)
2019-01-09 13:06 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2019-01-09 13:05:20 UTC
Created attachment 117354 [details]
Example output for failed marking as read for mails

SUMMARY

I switched to the SQLite backend. On the console, I saw that there occur DATABASE ERRORs named " Parameter count mismatch". One example is when I try to mark a large set of mails as read. This didn't work, so I guess the corresponding query failed. I'm attaching two examples.

Googling, I saw that this error occurred elsewhere in Qt code using SQLite:

https://www.qtcentre.org/threads/30220-Using-bound-values-in-insert-gives-quot-parameter-count-mismatch-quot-error-in-SQLite
https://stackoverflow.com/questions/20786003/qt-qsqlquery-bindvalue-works-with-but-not-with-placeholders
https://stackoverflow.com/questions/24684550/qt-5-with-sqlite-bindvalue-results-in-parameter-count-mismatch-error 

It may be that the same type of bug occurs in akonadi. In that case, this issue may be a relatively easy one to fix.


SOFTWARE/OS VERSIONS

Akonadi version: 18.08.3
KDE Plasma Version: 5.14.3 
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.1


ADDITIONAL INFORMATION

Despite the failed queries, the SQLite backend seems to function well.
Comment 1 Erik Quaeghebeur 2019-01-09 13:06:03 UTC
Created attachment 117355 [details]
Example output for unknown operation
Comment 2 Carl Schwan 2023-04-25 17:27:16 UTC
*** Bug 415957 has been marked as a duplicate of this bug. ***
Comment 3 Ricardo J. Barberis 2025-06-11 23:49:00 UTC
I'm experiencing the same bug since a few months ago.

System info:

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.9-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-1035G1 CPU @ 1.00GHz
Memory: 15.2 GiB of RAM
Graphics Processor: Intel® UHD Graphics

Extract from log:

2025-06-11T20:39:26 [WARN ] org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection akonadi_indexing_agent (0x5577826e8910)
2025-06-11T20:39:27 [WARN ] org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection MailFilter Kernel ETM (0x5577828b7d20)
2025-06-11T20:39:27 [WARN ] org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection Archive Mail Kernel ETM (0x5577828b7380)
2025-06-11T20:39:27 [WARN ] org.kde.pim.akonadiserver: Error while handling command FetchCollections on connection ETMCalendar (0x557782646790)
2025-06-11T20:39:29 [CRITICAL] org.kde.pim.akonadiserver: DATABASE ERROR while PREPARING QUERY:
2025-06-11T20:39:29 [CRITICAL] org.kde.pim.akonadiserver:   Error code: "1"
2025-06-11T20:39:29 [CRITICAL] org.kde.pim.akonadiserver:   DB error:  "too many SQL variables"
2025-06-11T20:39:29 [CRITICAL] org.kde.pim.akonadiserver:   Error text: "too many SQL variables Unable to execute statement"
2025-06-11T20:39:29 [CRITICAL] org.kde.pim.akonadiserver:   Query: "SELECT PimItemTable.id, PimItemTable.rev, PimItemTable.remoteId, PimItemTable.remoteRevision, PimItemTable.gid, PimItemTable.collectionId, PimItemTable.mimeTypeId, PimItemTable.datetime, PimItemTable.atime, PimItemTable.dirty, PimItemTable.size FROM PimItemTable INNER JOIN CollectionTable ON ( PimItemTable.collectionId = CollectionTable.id ) WHERE ( PimItemTable.remoteId IN ( :0, :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29, :30, :31, :32, :33, :34, :35, :36, :37, :38, :39, :40, :41, :42, :43, :44, :45, :46, :47, :48, :49, :50, :51, :52, :53, :54, :55, :56, :57, :58, :59, :60, :61, :62, :63, :64, :65, :66, :67, :68, :69, :70, :71, :72, :73, :74, :75, :76, :77, :78, :79, :80, :81, :82, :83, :84, :85, :86, :87, :88, :89, :90, :91, :92, :93, :94, :95, :96, :97, :98, :99, :100, :101, :102, :103, :104, :105, :106, :107, :108, :109, :110, :111, :112, :113, :114, :115, :116, :117, :118, :119, :120, :121, :122, :123, :124, :125, :126, :127, :128, :129, :130, :131, :132, :133, :134, :135, :136, :137, :138, :139, :140, :141, :142, :143, :144, :145, :146, :147, :148, :149, :150, :151, :152,

That last line is 266021 characters long according to wc (grep -a CollectionTable.resourceId .local/share/akonadi/Akonadi.error | wc -m)

After that line the log ends with:

2025-06-11T20:39:29 [WARN ] org.kde.pim.akonadiserver: Error while handling command DeleteItems on connection akonadi_birthdays_resource (0x5577826eac00)