You are not logged in.

#1 2022-06-08 16:06:40

logothete
Member
Registered: 2022-01-06
Posts: 42

Akonadi broken due to mariadb, which I cannot start or upgrade.

Hello All!

Background

First, my OS/DE versions:
Arch 251.2 running Zen 5.18.2.
KDE 5.24.5,
Frameworks 5.94.0,
Qt version 5.15.4


Though I originally thought this was a bug with akonadi itself, it seems on my system this is actually a break in mariadb. I've been DE-hopping, and fresh-reinstalled KDE a few days back (gnome... hurts to use); akonadi was broken out of the gate. On further investigation, it was found that for someone else, this was solved by downgrading maria-db and associated libraries back one version from 10.8.3 to 10.7.4. So, I did just that. When you change versions on mariadb, it instructs you to execute the following command:

systemctl restart mariadb.service && mariadb-upgrade -u root -p

However, these throw errors for me, and I cannot parse a fix; I tried upgrading back to the most recent versions, and have the same errors.

The Mariadb Errors

The above code is really two parts, so I'll give them independently.

systemctl restart mariadb.service                              

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.

See next section for details.

mariadb-upgrade -u root -p
Enter password: 
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (111)
FATAL ERROR: Upgrade failed
The Logs
systemctl status mariadb.service
× mariadb.service - MariaDB 10.8.3 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2022-06-08 11:45:15 EDT; 1min 58s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 39634 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 39635 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR |>
    Process: 39661 ExecStart=/usr/bin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 39661 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"
        CPU: 117ms

Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [Note] Server socket created on IP: '0.0.0.0'.
Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [Note] Server socket created on IP: '::'.
Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [Note] InnoDB: Buffer pool(s) load completed at 220608 11:45:15
Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Jun 08 11:45:15 psyche mariadbd[39661]: 2022-06-08 11:45:15 0 [ERROR] Aborting
Jun 08 11:45:15 psyche mariadbd[39661]: Warning: Memory not freed: 280
Jun 08 11:45:15 psyche systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 08 11:45:15 psyche systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 08 11:45:15 psyche systemd[1]: Failed to start MariaDB 10.8.3 database server.

Journalctl tells us more or less the same thing.

Jun 08 11:53:39 psyche systemd[1]: Starting MariaDB 10.8.3 database server...
░░ Subject: A start job for unit mariadb.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit mariadb.service has begun execution.
░░ 
░░ The job identifier is 4369.
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] /usr/bin/mariadbd (server 10.8.3-MariaDB) starting as process 40010 ...
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Number of transaction pools: 1
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Using Linux native AIO
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Completed initialization of buffer pool
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: 128 rollback segments are active.
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: log sequence number 33126; transaction id 4
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] InnoDB: Buffer pool(s) load completed at 220608 11:53:39
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] Server socket created on IP: '0.0.0.0'.
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [Note] Server socket created on IP: '::'.
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Jun 08 11:53:39 psyche mariadbd[40010]: 2022-06-08 11:53:39 0 [ERROR] Aborting
Jun 08 11:53:39 psyche mariadbd[40010]: Warning: Memory not freed: 280
Jun 08 11:53:39 psyche systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit mariadb.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Jun 08 11:53:39 psyche systemd[1]: mariadb.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Jun 08 11:53:39 psyche systemd[1]: Failed to start MariaDB 10.8.3 database server.
░░ Subject: A start job for unit mariadb.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit mariadb.service has finished with a failure.
░░ 
░░ The job identifier is 4369 and the job result is failed.

So it's looking for two things it says doesn't exist. Where is it looking? what would create these? Prior to this error I had no real idea what mariadb even was, so if I deleted them, it was by mistake.

Any help is much appreciated. I can also post the akonadi errors here, but they point toward mariadb in the end.

Offline

#2 2022-06-08 16:57:01

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,374

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

After installing mariadb you need to create the default databases before the service can be started. This is covered in the wiki...
https://wiki.archlinux.org/title/MariaDB#Installation


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-06-08 19:03:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 16,718

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Also it's unlikely this will be relevant. If you don't configure it otherwise akonadi will use it's own database that doesn't rely on your system mariadb service being started, so if that's the DB that needs updating you might need to run the update command on that: https://wiki.archlinux.org/title/KDE#MySQL

Offline

#4 2022-06-08 21:11:28

logothete
Member
Registered: 2022-01-06
Posts: 42

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Thank you both for your help.
To slithery: thank you for that. I didn't realize that had to be done beforehand; since mariadb was installed by akonadi I wrongly assumed this would be handled, and last time I installed KDE, I hadn't needed to touch mariadb. It's now up and running. The maridb-update error  turned out to be a simple fix; I needed to throw a sudo in in front of it.

However, akonadi remains out of commission, and the error it gives isn't wonderfully helpful.

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...
org.kde.pim.akonadiserver: database server stopped unexpectedly
org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
org.kde.pim.akonadiserver: executable: "/usr/bin/mysqld"
org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/logos/.local/share/akonadi/mysql.conf", "--datadir=/home/logos/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-file=/run/user/1000/akonadi/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "2022-06-08 16:38:38 0 [Note] /usr/bin/mysqld (server 10.8.3-MariaDB) starting as process 4602 ...\n"
org.kde.pim.akonadiserver: exit code: 1
org.kde.pim.akonadiserver: process error: "Unknown error"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

the files and dir specified by the "akonadiserver arguments", --defaults-file and --datadir both exist and are not empty;  /run/user/1000/akonadi is empty, but I think would only be populated when the process is sucessfully running anyway.

To V1del:
I haven't configured it otherwise, though here is the akonadiserverrc config file on my system, fwiw.

[%General]
Driver=QMYSQL

[QMYSQL]
Host=
Name=akonadi
Options="UNIX_SOCKET=/run/user/1000/akonadi/mysql.socket"
ServerPath=/usr/bin/mysqld
StartServer=true

which at least shows that the sockets agree and the serverpath is unchanged.

Is there something I've missed?

Offline

#5 2022-06-08 21:19:46

progandy
Member
Registered: 2012-05-17
Posts: 5,004

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

To slithery: thank you for that. I didn't realize that had to be done beforehand; since mariadb was installed by akonadi I wrongly assumed this would be handled, and last time I installed KDE, I hadn't needed to touch mariadb. It's now up and running. The maridb-update error  turned out to be a simple fix; I needed to throw a sudo in in front of it.

Now you have started and upgraded the global mariadb. Since your akonadi configuration uses its own mariadb process with another database location, that did not matter at all.

As V1del said, you can try to upgrade the database used by akonadi.
In the worst case, try to delete all akonadi data (/home/logos/.local/share/akonadi/)  and start from scratch.

Last edited by progandy (2022-06-08 21:23:45)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2022-06-09 13:16:34

ben-arch
Member
Registered: 2005-12-17
Posts: 78

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Offline

#7 2022-06-09 19:02:51

logothete
Member
Registered: 2022-01-06
Posts: 42

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Dear all:
In the end, what worked was removing everything akonadi related; uninstalling latest mariadb packages, installing the prior version, and installing akonadi using the  --assume-installed mariadb argument for pacman so that mariadb would not be updated.
Thanks for all the help.

Offline

#8 2022-06-09 20:27:04

hifi25nl
Member
Registered: 2011-05-07
Posts: 247
Website

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Just downgraded mariadb mariadb-clients mariadb-libs and now all is fine

Offline

#9 2022-06-10 07:54:52

post-factum
Member
From: /cz
Registered: 2008-09-12
Posts: 139
Website

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

All, if you expect some help on this, post your `~/.local/share/akonadi/db_data/mysql.err`. It might be the case the DB needs upgrade, and to find out also post the output of this:

$ mariadb-upgrade --defaults-file=~/.local/share/akonadi/mysql.conf --socket=/run/user/$(id -u)/akonadi/mysql.socket --check-if-upgrade-is-needed

uname == latest pf-kernel

Offline

#10 2022-06-16 02:41:24

Sharelter
Member
Registered: 2022-06-15
Posts: 9

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

post-factum wrote:

All, if you expect some help on this, post your `~/.local/share/akonadi/db_data/mysql.err`. It might be the case the DB needs upgrade, and to find out also post the output of this:

$ mariadb-upgrade --defaults-file=~/.local/share/akonadi/mysql.conf --socket=/run/user/$(id -u)/akonadi/mysql.socket --check-if-upgrade-is-needed

I reinstalled my archlinux with KDE yesterday and get the same problem.

Here is my mysql.err file and mysql.conf https://gist.github.com/Sharelter/cb3e9 … bc28ee5800

Last edited by Sharelter (2022-06-16 02:55:40)

Offline

#11 2022-06-16 06:10:24

post-factum
Member
From: /cz
Registered: 2008-09-12
Posts: 139
Website

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

Sharelter wrote:

I reinstalled my archlinux with KDE yesterday and get the same problem.

Here is my mysql.err file and mysql.conf https://gist.github.com/Sharelter/cb3e9 … bc28ee5800

You have:

2022-06-16 10:21:19 0 [ERROR] InnoDB: File ./ib_logfile0 was not found

there. Have you tried to create an empty ib_logfile0 file?


uname == latest pf-kernel

Offline

#12 2022-06-16 07:37:00

Sharelter
Member
Registered: 2022-06-15
Posts: 9

Re: Akonadi broken due to mariadb, which I cannot start or upgrade.

post-factum wrote:
Sharelter wrote:

I reinstalled my archlinux with KDE yesterday and get the same problem.

Here is my mysql.err file and mysql.conf https://gist.github.com/Sharelter/cb3e9 … bc28ee5800

You have:

2022-06-16 10:21:19 0 [ERROR] InnoDB: File ./ib_logfile0 was not found

there. Have you tried to create an empty ib_logfile0 file?

I created a empty ib_logfile0 file and got this message:

2022-06-16 15:14:51 0 [Warning] option 'innodb-log-buffer-size': unsigned value 1048576 adjusted to 2097152
2022-06-16 15:14:51 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2022-06-16 15:14:51 0 [Note] InnoDB: Number of transaction pools: 1
2022-06-16 15:14:51 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-06-16 15:14:51 0 [Note] InnoDB: Using Linux native AIO
2022-06-16 15:14:51 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2022-06-16 15:14:51 0 [Note] InnoDB: Completed initialization of buffer pool
2022-06-16 15:14:51 0 [ERROR] InnoDB: ib_logfile0 is empty, and LSN is unknown.
2022-06-16 15:14:51 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2022-06-16 15:14:51 0 [Note] InnoDB: Starting shutdown...
2022-06-16 15:14:51 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-06-16 15:14:51 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-06-16 15:14:51 0 [ERROR] Unknown/unsupported storage engine: innodb
2022-06-16 15:14:51 0 [ERROR] Aborting

Now it directly tells me that ib_logfile0 is empty.

2022-06-16 15:14:51 0 [ERROR] InnoDB: ib_logfile0 is empty, and LSN is unknown.

I searched this error message via Google and got this.
Follow this created a fresh new database and made a working akonadi for me smile

It seems that problem solved on my machine.

Last edited by Sharelter (2022-06-16 07:37:36)

Offline

Board footer

Powered by FluxBB