MariaDB error Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
Fabio
Posts: 38
Joined: Fri Dec 18, 2020 2:43 pm

MariaDB error

Post by Fabio »

Hi all!
I've reinstalled dietpi and Nextcloud (after some issues with owncloud), so i've started with a brand new configuration...
Everything was working fine, till this moring that i've got this error typing

Code: Select all

diepi-services status:

Code: Select all

[FAILED] DietPi-Services | ● mariadb.service - MariaDB 10.3.27 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2021-03-01 08:07:32 GMT; 1min 19s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 6565 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
  Process: 6566 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 6568 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 || exit 1 (code=exited, status=0/SUCCESS)
  Process: 6626 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
 Main PID: 6626 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Mar 01 08:07:31 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 6626 ...
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Mar 01 08:07:32 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Mar 01 08:07:32 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Mar 01 08:07:32 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
Do you know how to fix this problem?
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: MariaDB error

Post by Joulinar »

hi,

pls can you provide following information

Code: Select all

systemctl restart mariadb.service
journalctl -u mariadb
cat /var/log/mysql/error.log
readlink /var/lib/mysql
readlink -f /var/lib/mysql
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Fabio
Posts: 38
Joined: Fri Dec 18, 2020 2:43 pm

Re: MariaDB error

Post by Fabio »

Hello @Joulinar, you are always trying to save me! :lol:
Here you have:

Code: Select all

root@DietPi:~# systemctl restart mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@DietPi:~# journalctl -u mariadb
-- Logs begin at Sun 2021-02-28 08:25:29 GMT, end at Mon 2021-03-01 10:46:20 GMT. --
Feb 28 08:26:27 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
Feb 28 08:26:29 DietPi mysqld[599]: 2021-02-28  8:26:29 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 599 ...
Feb 28 08:26:29 DietPi mysqld[599]: 2021-02-28  8:26:29 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Feb 28 08:26:29 DietPi mysqld[599]: 2021-02-28  8:26:29 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Feb 28 08:26:29 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 08:26:29 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Feb 28 08:26:29 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
Mar 01 08:07:31 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 6626 ...
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Mar 01 08:07:32 DietPi mysqld[6626]: 2021-03-01  8:07:32 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Mar 01 08:07:32 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Mar 01 08:07:32 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Mar 01 08:07:32 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
Mar 01 10:46:19 DietPi systemd[1]: Starting MariaDB 10.3.27 database server...
Mar 01 10:46:20 DietPi mysqld[7352]: 2021-03-01 10:46:20 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 7352 ...
Mar 01 10:46:20 DietPi mysqld[7352]: 2021-03-01 10:46:20 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Mar 01 10:46:20 DietPi mysqld[7352]: 2021-03-01 10:46:20 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Mar 01 10:46:20 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Mar 01 10:46:20 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Mar 01 10:46:20 DietPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
root@DietPi:~# cat /var/log/mysql/error.log
2021-03-01 10:46:20 0 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 30 "Read-only file system")
2021-03-01 10:46:20 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2021-03-01 10:46:20 0 [ERROR] Plugin 'Aria' init function returned error.
2021-03-01 10:46:20 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2021-03-01 10:46:20 0 [Note] InnoDB: Using Linux native AIO
2021-03-01 10:46:20 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-03-01 10:46:20 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-03-01 10:46:20 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-03-01 10:46:20 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-03-01 10:46:20 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-03-01 10:46:20 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-03-01 10:46:20 0 [ERROR] Aborting

Warning: Memory not freed: 392
root@DietPi:~# readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
root@DietPi:~# readlink -f /var/lib/mysql
/mnt/HD_1T/dietpi_userdata/mysql
root@DietPi:~# 
root@DietPi:~# 
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: MariaDB error

Post by Joulinar »

Hi,

your system is trying to open a file and this is gonna fail

Code: Select all

2021-03-01 10:46:20 0 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 30 "Read-only file system")
2021-03-01 10:46:20 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
As far as I can see you moved dietpi_userdata to an external HDD mounted to /mnt/HD_1T/
Can you check if the HDD is connected correctly? Maybe do a reboot? Or check if the file is existing?

And check that the HDD is writable because of Errcode: 30 "Read-only file system"
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Fabio
Posts: 38
Joined: Fri Dec 18, 2020 2:43 pm

Re: MariaDB error

Post by Fabio »

The drive is correctly mounted, and the everything is working properly.
I've checked the drive via dietpi-drive_manager and there was a check on the read only.
I've removed the check and restored to system default, fixed the dietpi-userdata and now it's working again!
Thanks as always for your support!
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: MariaDB error

Post by Joulinar »

strange that there was a r/o flag. Usually this happen only, if there are issues on the device. You could have a look to kernel messages for such thinks (to be sure)

Code: Select all

dmesg -l err,crit,alert,emerg
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply