| Summary: | Updating mariadb to 12.1 causes akonadi to not start | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] Akonadi | Reporter: | Anders Lund <anders> |
| Component: | general | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | arojas, carl, tl |
| Priority: | NOR | ||
| Version First Reported In: | 6.5.3 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/pim/akonadi/-/commit/ac354634de0571e63c6ca6e003d43d81f156e1ff | Version Fixed/Implemented In: | 6.6.0 |
| Sentry Crash Report: | |||
| Attachments: | Patch for the "foreign key" SQL syntax error | ||
|
Description
Anders Lund
2025-12-02 09:26:22 UTC
you gave no details (like try running akonadiserver from a command line and post anything strange) but check https://userbase.kde.org/Akonadi#If_Akonadi_Reports_Broken_or_Non-operational to start with (In reply to Allen Winter from comment #1) > you gave no details (like try running akonadiserver from a command line and > post anything strange) but > > check > https://userbase.kde.org/Akonadi#If_Akonadi_Reports_Broken_or_Non- > operational to start with I have had a working installation for years. Only thing I could find that caused this problem was the mariadb update. It's not like updating archlinux deletes any dependencies, or otherwise changes things. I'm pretty sure I ran into exactly this issue. I just set up a new notebook with Artix Linux and MariaDB 12.1.2. I now wanted to setup KMail, but it's not functional due to Akonadi not being able to initialize the database and thus not running.
akonadictl start gives more insight, seems this is due to a syntax error:
akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl: done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
qt.qpa.services: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could not register app ID: App info not found for 'org.kde.akonadi_control'")
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
/usr/bin/mysqlcheck: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-check' instead
akonadi.collectionattributetable OK
akonadi.collectionmimetyperelation OK
akonadi.collectionpimitemrelation OK
akonadi.collectiontable OK
akonadi.flagtable OK
akonadi.mimetypetable OK
akonadi.parttable OK
akonadi.parttypetable OK
akonadi.pimitemflagrelation OK
akonadi.pimitemtable OK
akonadi.pimitemtagrelation OK
akonadi.resourcetable OK
akonadi.schemaversiontable OK
akonadi.tagattributetable OK
akonadi.tagremoteidresourcerelationtable OK
akonadi.tagtable OK
akonadi.tagtypetable OK
/usr/bin/mysql_upgrade: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-upgrade' instead
This installation of MariaDB is already upgraded to 12.1.2-MariaDB.
There is no need to run mariadb-upgrade again.
You can use --force if you still want to run mariadb-upgrade
org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: DB initializer done
org.kde.pim.akonadiserver: Updating index failed:
Sql error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '2' at line 1 QMYSQL: Die Abfrage konnte nicht ausgeführt werden
Query: ALTER TABLE PimItemTable DROP FOREIGN KEY 2
org.kde.pim.akonadiserver: ""
org.kde.pim.akonadiserver: Unable to initialize database.
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
Seems like MariaDB doesn't like "ALTER TABLE PimItemTable DROP FOREIGN KEY 2" anymore?
Additional note: I also have three other Artix machines running, all with MariaDB 12.1.2. No problems on any of them. Apparently, this only happens when Akonadi tries to setup a new database. Another addition: If I downgrade to MariaDB 12.0.2, Akonadi starts normally, i.e. the database is initialized correctly. As soon as I upgrade to 12.1.2, Akonadi fails to start. Don't ask me why my other Atrix machines using this version work nevertheless though … This seems to be the change causing this: https://jira.mariadb.org/browse/MDEV-28933 Created attachment 187320 [details]
Patch for the "foreign key" SQL syntax error
I'm far from being a MariaDB or Akonadi professional, but it seems that all we have to do is to quote the foreign key identifier. At least, a local build with this small patch works fine using MariaDB 12.1.2.
(In reply to Tobias Leupold from comment #7) > Created attachment 187320 [details] > Patch for the "foreign key" SQL syntax error > > I'm far from being a MariaDB or Akonadi professional, but it seems that all > we have to do is to quote the foreign key identifier. At least, a local > build with this small patch works fine using MariaDB 12.1.2. You may want to open a merge request, given that the maintainer decided to unsubscribe for some reason. Huh?! Well, okay, I'll file a MR. Thanks for the hint, that at least explains that nobody commented on the patch yet. |