Unattended-upgrade of mariadb

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
ScottyG
Posts: 6
Joined: Sat May 22, 2021 12:33 am

Unattended-upgrade of mariadb

Post by ScottyG »

Greetings,

Somehow, (my mistake) I left <all updates> listed for software and updates.

On 8/13/2021, i began getting : "ZoneMinder Error Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm SQLSTATE[HY000] [2002] No such file or directory" when connecting to ZM.

In the history log:
Commandline: /usr/bin/unattended-upgrade
Upgrade: mariadb-common:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1), mariadb-server-core-10.3:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1), mariadb-server-10.3:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1), mariadb-client-10.3:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1), mariadb-server:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1), mariadb-client-core-10.3:amd64 (1:10.3.30-0ubuntu0.20.04.1, 1:10.3.31-0ubuntu0.20.04.1)
End-Date: 2021-08-13 06:53:07

Bear in mind that mysql will not start as a service. Looking for some insight.

Code: Select all

mariadb.service - MariaDB 10.3.31 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-08-17 15:12:28 EDT; 18s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 755555 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 755556 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 755558 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: 755605 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 755605 (code=exited, status=1/FAILURE)
     Status: "Starting final batch to recover 107 pages from redo log"

Aug 17 15:12:27 10-10-0-103 systemd[1]: Starting MariaDB 10.3.31 database server...
Aug 17 15:12:27 10-10-0-103 mysqld[755605]: 2021-08-17 15:12:27 0 [Note] /usr/sbin/mysqld (mysqld 10.3.31-MariaDB-0ubuntu0.20.04.1) starting as process 755605 ...
Aug 17 15:12:28 10-10-0-103 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 17 15:12:28 10-10-0-103 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 17 15:12:28 10-10-0-103 systemd[1]: Failed to start MariaDB 10.3.31 database server.
I am an RTFM kind of a guy, but not sure of next steps.

Been running 1.36.5 flawlessly since May and been using ZM for about the last 2.5 years using the ppa from iconnor on ubuntu focal

Thanks for your help.
ScottyG
Posts: 6
Joined: Sat May 22, 2021 12:33 am

Re: Unattended-upgrade of mariadb

Post by ScottyG »

just an update... I have identified that a socket is not present. I am currently in safe mode, and doing a sql backup. once it is completed, my POA is to 1. drop the db, remove mariadb, then reinstall mariadb. Lastly, restore the database. Will keep this thread updated as I muddle through this in case someone else runs into this issue.
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Unattended-upgrade of mariadb

Post by bbunge »

ScottyG wrote: Wed Aug 18, 2021 2:34 pm just an update... I have identified that a socket is not present. I am currently in safe mode, and doing a sql backup. once it is completed, my POA is to 1. drop the db, remove mariadb, then reinstall mariadb. Lastly, restore the database. Will keep this thread updated as I muddle through this in case someone else runs into this issue.
Sounds like a wise choice. I did a test yesterday and set up an old image of 20.04 with Mariadb, Apache and PhP. Installed ZM 1.36.5, added a couple of cams then upgraded the system Had 88 updates and when done Zoneminder still worked.

You may want to check that php-mysql and libapache2-mod-php are installed. Also possible the upgrade replaced the php.ini file.
lbm
Posts: 89
Joined: Mon Mar 26, 2018 7:44 pm

Re: Unattended-upgrade of mariadb

Post by lbm »

I believe it should post some mysql errors to why it would not start in /var/log/syslog or /var/log/mysql/error.log. The ones from systemd is sometimes not really that telling.
Post Reply