Some reinstalls of software after upgrade from Buster to Bullseye fail

Sudo user should by ‘mysql’, not ‘mariadb’, right?

sudo -u mariadb /usr/sbin/mariadbd
sudo: unknown user: mariadb
sudo: error initializing audit plugin sudoers_audit

Already tried this without sudo with the same result:

sudo -u mysql /usr/sbin/mariadbd
Illegal instruction

Yes user is mysql

Hmm looks like the binary is broken :thinking:

Maybe reinstall would be the way to go

Reinstalling is where the trouble started.
Now, when I reinstall mariadb only, it goes well, but starting the service fails. (lighttpd and ncc too).
When I use the combined reinstall as suggested in the bullseye upgrade hint (dietpi-software reinstall 38 40 47 48 56 83 84 85 88 89 93 114 143), the latter services startup fine, just mariadb fails.

dietpi-software reinstall 88
[  OK  ] DietPi-Software | Initialised database
[  OK  ] DietPi-Software | Reading database

 DietPi-Software
─────────────────────────────────────────────────────
 Mode: Automated reinstall

[  OK  ] DietPi-Software | Reinstalling MariaDB: Persistent cached file-per-table database server
[  OK  ] DietPi-Software | Free space check: path=/ | available=4179 MiB | required=500 MiB
[  OK  ] DietPi-Software | DietPi-Userdata validation: /mnt/usb_1/dietpi_userdata
[  OK  ] DietPi-Software | Checking network connectivity
[  OK  ] DietPi-Software | Checking DNS resolver
[  OK  ] Network time sync | Completed
[ SUB1 ] DietPi-Services > unmask
[  OK  ] DietPi-Services | unmask : nmbd
[  OK  ] DietPi-Services | unmask : smbd
[  OK  ] DietPi-Services | unmask : redis-server
[  OK  ] DietPi-Services | unmask : mariadb
[  OK  ] DietPi-Services | unmask : postgresql
[  OK  ] DietPi-Services | unmask : php7.4-fpm
[  OK  ] DietPi-Services | unmask : lighttpd
[  OK  ] DietPi-Services | unmask : jellyfin
[  OK  ] DietPi-Services | unmask : cron
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : jellyfin
[  OK  ] DietPi-Services | stop : lighttpd
[  OK  ] DietPi-Services | stop : php7.4-fpm
[  OK  ] DietPi-Services | stop : postgresql
[  OK  ] DietPi-Services | stop : mariadb
[  OK  ] DietPi-Services | stop : redis-server
[  OK  ] DietPi-Services | stop : smbd
[  OK  ] DietPi-Services | stop : nmbd
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads /var/www /opt /usr/local/bin
[  OK  ] DietPi-Software | chown dietpi:dietpi /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[  OK  ] DietPi-Software | chmod 0775 /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 https://deb.debian.org/debian bullseye InRelease
Hit:2 https://dietpi.com/meveric all InRelease
Get:3 https://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Hit:4 https://dietpi.com/meveric bullseye InRelease
Hit:5 https://deb.debian.org/debian-security bullseye-security InRelease
Get:6 https://deb.debian.org/debian bullseye-backports InRelease [40.9 kB]
Get:7 https://repo.jellyfin.org/debian bullseye InRelease [6639 B]
Fetched 86.9 kB in 3s (29.1 kB/s)
Reading package lists...
[  OK  ] DietPi-Software | APT update

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for prerequisite software


 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing MariaDB: Persistent cached file-per-table database server

[ INFO ] DietPi-Software | Preparing database directory at: /mnt/dietpi_userdata/mysql
[ INFO ] DietPi-Software | /mnt/dietpi_userdata/mysql exists, will migrate containing databases
[  OK  ] DietPi-Software | rm -Rf /var/lib/mysql
[  OK  ] DietPi-Software | ln -s /mnt/dietpi_userdata/mysql /var/lib/mysql
[ INFO ] DietPi-Software | APT install for: mariadb-server php7.4-mysql, please wait...
[  OK  ] DietPi-Software | APT install for: mariadb-server php7.4-mysql
[ INFO ] DietPi-Software | Removing obsolete SysV mysql service
[  OK  ] DietPi-Software | update-rc.d mysql remove
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : jellyfin
[  OK  ] DietPi-Services | stop : lighttpd
[  OK  ] DietPi-Services | stop : php7.4-fpm
[  OK  ] DietPi-Services | stop : postgresql
[  OK  ] DietPi-Services | stop : mariadb
[  OK  ] DietPi-Services | stop : redis-server
[  OK  ] DietPi-Services | stop : smbd
[  OK  ] DietPi-Services | stop : nmbd

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Finalising install

[  OK  ] DietPi-Software | systemctl daemon-reload
[ SUB1 ] DietPi-Services > dietpi_controlled
[  OK  ] DietPi-Services | dietpi_controlled : nmbd
[  OK  ] DietPi-Services | dietpi_controlled : smbd
[  OK  ] DietPi-Services | dietpi_controlled : redis-server
[  OK  ] DietPi-Services | dietpi_controlled : mariadb
[  OK  ] DietPi-Services | dietpi_controlled : postgresql
[  OK  ] DietPi-Services | dietpi_controlled : php7.4-fpm
[  OK  ] DietPi-Services | dietpi_controlled : lighttpd
[  OK  ] DietPi-Services | dietpi_controlled : jellyfin
[  OK  ] DietPi-Services | dietpi_controlled : cron

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Install completed

[  OK  ] DietPi-Survey | Purging survey data
[ SUB1 ] DietPi-Services > restart
[  OK  ] DietPi-Services | restart : nmbd
[  OK  ] DietPi-Services | restart : smbd
[  OK  ] DietPi-Services | restart : redis-server
[FAILED] DietPi-Services | restart : mariadb
[  OK  ] DietPi-Services | restart : postgresql
[  OK  ] DietPi-Services | restart : php7.4-fpm
[FAILED] DietPi-Services | restart : lighttpd
[  OK  ] DietPi-Services | restart : jellyfin
[  OK  ] DietPi-Services | restart : cron
[FAILED] DietPi-Services | ncc maintenance:mode --off

You have a database backup available right?

I guess you would need to force a reinstallation using

apt install --reinstall mariadb-server

Wish it would help:

# apt install --reinstall mariadb-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 34.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main arm64 mariadb-server all 1:10.5.11-1 [34.8 kB]
Fetched 34.8 kB in 0s (98.0 kB/s)
(Reading database ... 35151 files and directories currently installed.)
Preparing to unpack .../mariadb-server_1%3a10.5.11-1_all.deb ...
Unpacking mariadb-server (1:10.5.11-1) over (1:10.5.11-1) ...
Setting up mariadb-server (1:10.5.11-1) ...

At the end, I can’t restart mariadb.service. Like before, without any useful error message.

Hmm in this case we might need to purge and remove everything related to mariadb otherwise I’m not sure how to fix but definitely you need a backup from before.

simply to echo what fhals has been experiencing.

I have tried reinstalls both of entire LEMP package & Mariadb on its own. I have renamed & recreated all configuration folders but still have no luck. DietPi v7.6.2 (beta) with all upgrades done. I have no useful information to add - similar messages & lack of error.log.

I made a full dump of all databases prior upgrade to bullseye, so I’ll be happy to volunteer.
What would be the best way to purge/delete/install without killing my nextcloud from being restored?

Basically this should fully remove everything related to MariaDB

https://dietpi.com/forum/t/mariadb-error/5039/15

Afterwards a reinstall of Nextcloud would be needed to setup database again. If SQL dump is present, it should be imported automatically.

Usually Nextcloud files should stay untouched. But let’s wait for MichaIng to confirm best way.

I did:

G_AGP mariadb-server
G_AGA
sed -i ‘/aSOFTWARE_INSTALL_STATE[88]/c\aSOFTWARE_INSTALL_STATE[88]=0’ /boot/dietpi/.installed
rm -Rf /{mnt/dietpi_userdata,var/lib,var/log,etc}/mysql
mkdir /mnt/dietpi_userdata/mysql
ln -s /mnt/dietpi_userdata/mysql /var/lib/mysql
apt install mariadb-server
systemctl status mariadb

…but no change:

‘Job for mariadb.service failed because a fatal signal was delivered to the control process’

The error log stays empty, correct?

Now it’s getting wicked.
Your steps were the ones I intended to do…
When you do a

sudo -u mysql /usr/sbin/mariadbd

is your result ‘Illegal instruction’ too?

ahh I did not notice that there is an additional user joining the topic.

Anyway, DietPi version is totally unrelated as it has no influence in MariaDB functionality.

to reply in order:

yes the error.log stays empty (in as much as it doesn’t even get created)
yes sudo -u mysql /usr/sbin/mariadbd gives ‘illegal instruction’

guys could you both share your system details

Required Information

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=7
G_DIETPI_VERSION_SUB=6
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘not applicable’
G_LIVE_PATCH_STATUS[1]=‘not applied’
G_LIVE_PATCH_STATUS[2]=‘not applied’
G_LIVE_PATCH_STATUS[3]=‘not applied’

echo $G_DISTRO_NAME $G_RASPBIAN
bullseye

uname -a
Linux DietPi 3.16.85+ #1 SMP PREEMPT Tue Jun 30 19:02:35 CEST 2020 aarch64 GNU/Linux

echo $G_HW_MODEL_NAME
Odroid C2 (aarch64)

G_DIETPI_VERSION_CORE=7
G_DIETPI_VERSION_SUB=6
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘beta’
G_GITOWNER=‘MichaIng’
bullseye
Linux 3.16.85+ #1 SMP PREEMPT aarch64 GNU/Linux
Odroid C2 (aarch64) (!!)

…it might be worth mentioning that error.log seems to be disabled by default (/etc/mysql/mariadb.conf.d/50-server.conf)

# When running under systemd, error logging goes via stdout/stderr to journald
# and when running legacy init error logging goes to syslog due to
# /etc/mysql/conf.d/mariadb.conf.d/50-mysqld_safe.cnf
# Enable this if you want to have error logging into a separate file
#log_error = /var/log/mysql/error.log

so no surprise that it doesn’t get written to :wink:

looking for Odroid C2 mariadb issues is interesting though I haven’t yet found ‘the’ solution

https://forum.odroid.com/viewtopic.php?t=40016

How could I overlook this?
Great find.
Unfortunately nothing will be logged. Neither in error, nor in general log.