Recurrent crash of mariadb,

Creating a bug report/issue

I have searched the existing open and closed issues

root@DietPi:~# cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=16
G_DIETPI_VERSION_RC=3
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘applied’
G_LIVE_PATCH_STATUS[1]=‘applied’

echo $G_DISTRO_NAME $G_RASPBIAN
bookworm 0
uname --all
Linux DietPi 6.12.34+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux
uname --allLinux DietPi 6.12.34+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.34-1+rpt1~bookworm (2025-06-26) aarch64 GNU/Linux
echo $G_HW_MODEL_NAMERPi 4 Model B (aarch64)

Recurrent crash of mariadb,

journalctl -u mariadb
Aug 31 14:31:51 DietPi systemd\[1\]: Starting mariadb.service - MariaDB 10.11.11 database server…
Aug 31 14:31:52 DietPi mariadbd\[3386180\]: 2025-08-31 14:31:52 0 \[Warning\] Can’t create test file ‘/var/lib/mysql/DietPi.lower-test’ (Errcode: 5 “Input/output error”)
Aug 31 14:31:52 DietPi mariadbd\[3386180\]: 2025-08-31 14:31:52 0 \[Note\] Starting MariaDB 10.11.11-MariaDB-0+deb12u1 source revision e69f8cae1a15e15b9e4f5e0f8497e1f17bdc81a4 server_uid EJbk0imF++9Nyt0bHYAVpWCDJtk= as process 3386180
Aug 31 14:31:52 DietPi mariadbd\[3386180\]: 2025-08-31 14:31:52 0 \[ERROR\] mariadbd: Can’t create/write to file ‘./ddl_recovery.log’ (Errcode: 5 “Input/output error”)
Aug 31 14:31:52 DietPi mariadbd\[3386180\]: 2025-08-31 14:31:52 0 \[ERROR\] DDL_LOG: Failed to create ddl log file: ./ddl_recovery.log
Aug 31 14:31:52 DietPi mariadbd\[3386180\]: 2025-08-31 14:31:52 0 \[ERROR\] Aborting
Aug 31 14:31:52 DietPi systemd\[1\]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 31 14:31:52 DietPi systemd\[1\]: mariadb.service: Failed with result ‘exit-code’.
Aug 31 14:31:52 DietPi systemd\[1\]: Failed to start mariadb.service - MariaDB 10.11.11 database server.
  • cat /var/log/mysql/error.log
    cat: /var/log/mysql/error.log: No such file or directory

    @DietPi:~# readlink /var/lib/mysql
    /mnt/dietpi_userdata/mysql
    root@DietPi:~#

    @DietPi:~# readlink -f /var/lib/mysql
    /mnt/ssd/dietpi_userdata/mysql

  • cat /var/log/mysql/error.log
    cat: /var/log/mysql/error.log: No such file or directory

@DietPi:~# readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
root@DietPi:~#

@DietPi:~# readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
root@DietPi:~#

@DietPi:~# readlink -f /var/lib/mysql
/mnt/ssd/dietpi_userdata/mysql

Despite restarting, the service does not restart,

after restarting all services ((Re)start ALL enabled services, mariadb does not restart (Failed)
I have to reboot the Raspberry Pi for the service to resume, and after 12 to 24 hours, MariaDB crashes again.

I need help with this, thank you.

I guess you connect your SSD to the RPi4 just using USB ports without external PSU for the drive correct? Its well known that RPi4 USB ports technically not able to power SSD or HDD. Therefore it is highly recommended to use external PSU or powered USB hub

You should see kernel error messages as soon as the issue appears

dmesg -l 0,1,2,3
root@DietPi:\~# dmesg -l 0,1,2,3
\[    5.498862\] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
\[    5.500614\] Bluetooth: hci0: BCM: ‘brcm/BCM4345C0.raspberrypi,4-model-b.hcd’
\[    5.502245\] Bluetooth: hci0: BCM: ‘brcm/BCM4345C0.hcd’
\[    5.503894\] Bluetooth: hci0: BCM: ‘brcm/BCM.raspberrypi,4-model-b.hcd’
\[    5.505897\] Bluetooth: hci0: BCM: ‘brcm/BCM.hcd’
\[  153.779014\] BTRFS error (device sda1): parent transid verify failed on logical 1070229815296 mirror 1 wanted 1840 found 942
\[  153.789867\] BTRFS error (device sda1): parent transid verify failed on logical 1070229815296 mirror 2 wanted 1840 found 942

I guess you connect your SSD to the RPi4 just using USB ports without external PSU for the drive correct? Yes, 1 SSD and 1 Hard drive, I will fix that.

Thanks for your feedback.