MariaDB Database Server Fails To Start

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Webmin version 2.021
Virtualmin version 7.7
Related packages MariaDB Database Server

Hello,

I recently updated the Let’s Encrypt certificate and applied it to all services. After applying, our MariaDB server stopped and will not run.

root@hostname:~# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.38 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-06-14 13:23:32 PDT; 16s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 5578 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 5588 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 5598 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, >
    Process: 5681 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 5681 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Jun 14 13:23:30 hostname.url systemd[1]: Starting MariaDB 10.3.38 database server...
Jun 14 13:23:30 hostname.url mysqld[5681]: 2023-06-14 13:23:30 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 128186)
Jun 14 13:23:32 hostname.url systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 14 13:23:32 hostname.url systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 14 13:23:32 hostname.url systemd[1]: Failed to start MariaDB 10.3.38 database server.
...skipping...
● mariadb.service - MariaDB 10.3.38 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-06-14 13:23:32 PDT; 16s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 5578 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 5588 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 5598 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, >
    Process: 5681 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 5681 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Jun 14 13:23:30 hostname.url systemd[1]: Starting MariaDB 10.3.38 database server...
Jun 14 13:23:30 hostname.url mysqld[5681]: 2023-06-14 13:23:30 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 128186)
Jun 14 13:23:32 hostname.url systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 14 13:23:32 hostname.url systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 14 13:23:32 hostname.url systemd[1]: Failed to start MariaDB 10.3.38 database server.

Any help is appreciated.

Have you rebooted the system?

the line that sticks out is
Could not increase number of max_open_files to more than 32768

Googling that I found that I found this.

The max files warning is a red herring. It is not why it won’t start (it is a warning, not a fatal error).

You’ll have to look in the mariadb.log for actual errors.

1 Like

It looks like it is related to the cert. Any easy way to resolve this?

2023-06-15  8:03:44 0 [Note] Starting MariaDB 10.3.38-MariaDB-0ubuntu0.20.04.1 source revision c73985f2ce8a391582787f3e310a011c1a712bec as process 108770
2023-06-15  8:03:44 0 [Note] InnoDB: Using Linux native AIO
2023-06-15  8:03:44 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-06-15  8:03:44 0 [Note] InnoDB: Uses event mutexes
2023-06-15  8:03:44 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-06-15  8:03:44 0 [Note] InnoDB: Number of pools: 1
2023-06-15  8:03:44 0 [Note] InnoDB: Using generic crc32 instructions
2023-06-15  8:03:44 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-06-15  8:03:44 0 [Note] InnoDB: Completed initialization of buffer pool
2023-06-15  8:03:44 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-06-15  8:03:44 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2023-06-15  8:03:44 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-06-15  8:03:44 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-06-15  8:03:44 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-06-15  8:03:44 0 [Note] InnoDB: Waiting for purge to start
2023-06-15  8:03:44 0 [Note] InnoDB: 10.3.38 started; log sequence number 11078522283; transaction id 21203625
2023-06-15  8:03:44 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-06-15  8:03:44 0 [Note] Plugin 'FEEDBACK' is disabled.
SSL error: Unable to get private key from '/etc/mysql/mysql-ssl.key'
2023-06-15  8:03:44 0 [ERROR] Failed to setup SSL
2023-06-15  8:03:44 0 [ERROR] SSL error: Unable to get private key
2023-06-15  8:03:44 0 [ERROR] Aborting

It looks like “mysql-ssl.key” is there.

Pretty sure that’s not where you’ll find the private key from Let’s Encrypt. I think there were some threads about this recently and one person said they just disabled the cert.

I had a similar issue with Postgresql and moved the certs to the Postgresql directory. Never figured out why I had to do that. I compared to a working copy and could not find any differences.

Thanks for the suggestion. I commented out the cert lines and now it’s working again.

1 Like

Glad you got it going. I’m really not sure if the cert means much if you aren’t using remote connections, but, now that it’s working you have time to figure out if you think you need it.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.