Akonadi won't start

The error from akonadictl start --verbose is

org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/var/run/user/10
01/akonadi/mysql.socket' (2) QMYSQL: Unable to connect"

is the database missing? I thought akonadi creates its own.

is it a permissions or group membership issue?

is it something else?
 
If you install Akonadi via pkg, I think it specifies MySQL as a dependency... and MySQL 5.7 is rather broken. Because of that, I compile mine via ports, and use SQLite as a back end, instead of MySQL...
 
If you install Akonadi via pkg, I think it specifies MySQL as a dependency... and MySQL 5.7 is rather broken. Because of that, I compile mine via ports, and use SQLite as a back end, instead of MySQL...

I didn't know mysql is broken in FreeBSD. I did consider a database issue, but I read on the KDE site that sqlite is not working

Why_not_use_sqlite
 
I didn't know mysql is broken in FreeBSD. I did consider a database issue, but I read on the KDE site that sqlite is not working

Why_not_use_sqlite
I clicked your link, there was only one line 'Does not handle concurrent access very well. For more information, go here'... and it took me nowhere. And that info is outdated by now, your link has not been edited since 2019:
This page was last edited on 6 April 2019, at 17:09.

FWIW, my Akonadi install is running fine, no complaints or crashes... My system has a Ryzen 5 1400, RX 550 4GB graphics, and 32 GB of RAM.
 
FWIW, my Akonadi install is running fine, no complaints or crashes... My system has a Ryzen 5 1400, RX 550 4GB graphics, and 32 GB of RAM.
Fair enough, I appreciate the suggestion. I'll think about sqlite as a workaround.
 
I think it specifies MySQL as a dependency... and MySQL 5.7 is rather broken.
Sorry, a bit off-topic, but do you have more information about this? I'm running MySQL 5.7 on a number of production machines and it seems to be working fine so wondering what I'm missing.
 
Sorry, a bit off-topic, but do you have more information about this? I'm running MySQL 5.7 on a number of production machines and it seems to be working fine so wondering what I'm missing.
In FreeBSD ports, MySQL 5.7 has been marked as vulnerable, and I saw at least one CVE filed against it. The only way to compile (for me at least) would be to tell the Makefile to ignore the vulnerability or edit my local copy and comment out the vulnerability part.

A vulnerable port will still compile and run fine. But once the hole gets exploited, it's kind of too late to just patch it up.

Updating to the latest (5.7.34 is in ports, BTW) is strongly recommended.
 
Thanks.

Yes, there was a window of a few weeks where 5.7.34 wasn't available, but it has been for a few weeks now (in ports, I don't know about packages). I think 8.0 had the same or similar vulnerabilities (including remote attacks not needing authentication) but it was patched a lot quicker for FreeBSD.
 
Both quarterly and latest packages have 5.7.34 available for amd64 on FreeBSD 11, 12 and 13.

is the database missing? I thought akonadi creates its own.
It can't. You'll need to set up and configure the MySQL database yourself.
 
Both quarterly and latest packages have 5.7.34 available for amd64 on FreeBSD 11, 12 and 13.


It can't. You'll need to set up and configure the MySQL database yourself.

ok, added mysql_enable="YES" to rc.conf

In mysql,
Code:
CREATE DATABASE akonadi;
GRANT ALL PRIVILEGES ON akonadi.* TO 'my_username'@'localhost' IDENTIFIED BY 'my_password';

then in .config/akonadi/akonadiserverrc

Code:
[QMYSQL]
Host=localhost
Name=akonadi
Options="UNIX_SOCKET=/var/run/user/1001/akonadi/mysql.socket"
ServerPath=/usr/local/libexec/mysqld
User=my_username

But akonadi can't connect
 
Socket looks wrong. Are you sure that's correct? The default socket for MySQL is usually /tmp/mysql.sock but could be /var/run/mysql/mysql.sock, it depends on the version which one is set as default.
 
If you compile akonadi with a MySQL backend, and do a make install (as root), akonadi's install scripts do take care of creating the MySQL database for you. It is, however, assumed that it's a base, unsecured, untouched MySQL install on localhost. Lots of other ports (that have database back-ends) do that, like MythTV and ownCloud.

This is not good practice, though, so I go with SQLite for Akonadi, at least.
 
Socket looks wrong. Are you sure that's correct? The default socket for MySQL is usually /tmp/mysql.sock but could be /var/run/mysql/mysql.sock, it depends on the version which one is set as default.

I can't change that line because the file is over-written on each KDE startup. Not sure what's up with that.
 
Thursday 2021-06-24 in #freebsd-desktop I wrote:

Akonadi Server crashes after every log in. -CURRENT, latest. Known issue? (I've been ignoring the crashes because I don't think I use Akonadi.)

The response:

… kill all the akonadi processes, also kill mysql, and then run akonadictl start in a terminal?

Result (from <https://bsd.to/k9Tc>):

Code:
% akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
% org.kde.pim.akonadiserver: Starting up the Akonadi Server...
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.relationtable                              OK
akonadi.relationtypetable                          OK
akonadi.resourcetable                              OK
akonadi.schemaversiontable                         OK
akonadi.tagattributetable                          OK
akonadi.tagremoteidresourcerelationtable           OK
akonadi.tagtable                                   OK
akonadi.tagtypetable                               OK
org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: DB initializer done
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Assertion failed: (param->buffer_length != 0), function setup_one_fetch_function, file /wrkdirs/usr/ports/databases/mysql57-client/work/mysql-5.7.34/libmysql/libmysql.c, line 4112.
QSocketNotifier: Invalid socket 6 and type 'Read', disabling...
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = akonadiserver path = /usr/local/bin pid = 35709
KCrash: Arguments: /usr/local/bin/akonadiserver
KCrash: Attempting to start /usr/local/lib/libexec/drkonqi
QMYSQLResult::cleanup: unable to free statement handle
org.kde.pim.akonadicontrol: ProcessControl: Application '/usr/local/bin/akonadiserver' returned with exit code 253 (Unknown error)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...

Work towards a fix is expected today.
 
Just came across this blog entry from ADG, FreeBSD's KDE and Wayland guru... Apparently he did not see the security CVE's I mentioned earlier in this thread...

Against such a backdrop, I would stick to my recommendation of compiling Akonadi with SQLite as a backend... that's what I do, there's no security CVE's or any other complaints from my compiled ports install... if you guys still want to compile against MySQL, I would recommend waiting until 5.7.35 comes out, or until 5.7.34 gets appropriately patched for FreeBSD...
 
1626398225597.png
 
If you install Akonadi via pkg, I think it specifies MySQL as a dependency... and MySQL 5.7 is rather broken. Because of that, I compile mine via ports, and use SQLite as a back end, instead of MySQL...
I installed all KDE via pkg and had the same problem.
Installed Akonadi from ports after chosing SQLite as the backend database server, but got the same problem.
Did you remove the Akonadi installed from pkg? I did not as it would remove a lot of other packages as well.
What was your procedure?
 
I installed all KDE via pkg and had the same problem.
Installed Akonadi from ports after chosing SQLite as the backend database server, but got the same problem.
Did you remove the Akonadi installed from pkg? I did not as it would remove a lot of other packages as well.
What was your procedure?
I never used pkg... Just did a fresh install of FreeBSD 13-RELEASE and went with ports. Generally, you should not mix ports and packages. Versions have to line up both for ports and packages, AND you lose the option to set your own makefile options in ports. These forums are chock-full of comments from users who never understood that completely. 😩
 
I clicked your link, there was only one line 'Does not handle concurrent access very well. For more information, go here'... and it took me nowhere. And that info is outdated by now, your link has not been edited since 2019
Here you go, mate: http://web.archive.org/web/20150607133905/https://techbase.kde.org/Projects/PIM/Akonadi/Database

Sqlite​

Status: working with limitations, default backend for mobile systems
Supported modes: Embedded
Known issues:
The proper statement is: Sqlite works, but it does not work well for our use case. It's much slower compared to MySQL, and will create nasty interruptions in using Kmail often enough.

Aside that most people nowadays have replaced MySQL with MariaDB. Either way I used Kmail a long time ago, before Akonadi was created. Akonadi is just what alienated me from that piece of software forever, because it never worked for me without major hiccups and annoyances.
 
Curiousity got the better of me, and I checked that link... A few comments:
  • It's from 2015. All of SQLite's issues mentioned in that cached copy - they have been addressed since.
  • I do have a habit of compiling my ports with as many options enabled as practical, and yes, that includes my copy of databases/sqlite3. pkg version of the exact same port, pre-compiled by port maintainers using the exact same source tarballs - that one has very minimal options enabled. Check the port's make config before making changes, and you will see what I mean.
 
I never used pkg... Just did a fresh install of FreeBSD 13-RELEASE and went with ports. Generally, you should not mix ports and packages. Versions have to line up both for ports and packages, AND you lose the option to set your own makefile options in ports. These forums are chock-full of comments from users who never understood that completely. 😩
To build all ports take a lot of time, both mine and compiling them. And I have the impression that a lot of software is necessarily compiled.
Tried for Akonadi with SQLite, a
Code:
make config-recursive
and lots and lots of software shown up. I gave up. It I remember correctly, it was even calling FORTRAN and LPACK and many others that shouldn't be there for the Akonadi application.

What do you do? Any trick you'd like to share?
 
Back
Top