MariaDB errors when doing a package update

SYSTEM INFORMATION
OS type and version Ubuntu 22.04.4
Webmin version 2.202
Virtualmin version 7.20.2
Webserver version Apache 2.4.52
Related packages MariaDB version 10.6.18

I am running into problems with MariaDB probably when doing Package Updates, MatiaDB starts eating up all the memory and the the OOM kills it.

Once I manually restart it it seems to keep going fine for days without any issues.

This is the (partial) MariaDB log:
ug 30 16:51:05 server1 mariadbd[2802169]: 2024-08-30 16:51:05 0 [Note] Starting MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1 source revision 887bb3f73555ff8a50138a580ca8308b9b5c069c as process 2802169
Aug 30 16:51:06 server1 systemd[1]: Started MariaDB 10.6.18 database server.
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802185]: Upgrading MySQL tables if necessary.
Aug 30 16:51:06 server1 mariadbd[2802169]: 2024-08-30 16:51:06 4 [Warning] Access denied for user ‘root’@‘localhost’ (using password: NO)
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802188]: Looking for ‘mariadb’ as: /usr/bin/mariadb
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802188]: Reading datadir from the MariaDB server failed. Got the following error when executing the ‘mysql’ command line client
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802188]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802188]: FATAL ERROR: Upgrade failed
Aug 30 16:51:06 server1 /etc/mysql/debian-start[2802195]: Checking for insecure root accounts.
Aug 30 16:51:06 server1 mariadbd[2802169]: 2024-08-30 16:51:06 5 [Warning] Access denied for user ‘root’@‘localhost’ (using password: NO)
Aug 30 16:51:06 server1 debian-start[2802198]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Aug 30 16:51:23 server1 mariadbd[2802169]: 2024-08-30 16:51:23 0 [Note] InnoDB: Buffer pool(s) load completed at 240830 16:51:23

I know it may or may not be related to Virtualmin but wonder if any of the above ring a bell and you have any suggestions on where to start investigating.

Note
The package updates where not directly related to MariaDB but it looks like there is an update pending (?) . Would that explain the error messages every time I restart the DB ?

Any ideas very welcome
Thanks
Roberto

That’s presumably the postinstall script from a mariadb update.

You can check the state of the package with dpkg -l mariadb-server

It’ll probably show some half-configured or half installed state.

dpkg --configure -a will trigger all pending actions in the package manager, which may be useful in trying to figure out what the heck is going on. You can find the scripts that run (alongside a bunch of metadata files, which are probably not interesting…you’re probably only concerned with the postinst and maybe some other maintainer scripts, which are named pre or post something, I don’t think I’ve ever found anything interesting in triggers, but it can run arbitrary code, so maybe) in /var/lib/dpkg/info.

It seems the problem was related to the one described in: debian - MySql: ERROR 1045 (28000): Access denied for user 'root'@'localhost' although password is okay - Server Fault

  1. The latest package update was in fact an “upgrade”
  2. If the system cannot login as root it won’t be able to complete the upgrade, so the cause for the problem was in fact the following error: /etc/mysql/debian-start[2802188]: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)

Look at the link above for how to fix it.

Restarted MariaDB, no more startup errors, will now monitor to make sure it is stable and no more problems pop up.

1 Like