MySQL Failed
-
@rets34 I’m not seeing anything that stands out as problemattic.
It appears mariadb started okay, though I’m unsure.
Can you also provide
systemctl -l status mariadb
-
root@fog-desktop:/home/admin# systemctl -l status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: activating (start) since Thu 2020-07-30 12:16:53 CDT; 34s ago Process: 30832 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_rec Process: 30829 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status= Process: 30828 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0 Main PID: 30916 (mysqld) Tasks: 26 (limit: 4915) CGroup: /system.slice/mariadb.service └─30916 /usr/sbin/mysqld Jul 30 12:16:53 fog-desktop systemd[1]: Starting MariaDB database server... Jul 30 12:16:53 fog-desktop mysqld[30916]: 2020-07-30 12:16:53 139648654302336 [Note] /usr/sbin/mysqld (mysqld 1 root@fog-desktop:/home/admin# ^C root@fog-desktop:/home/admin# systemctl -l status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: failed (Result: timeout) since Thu 2020-07-30 12:18:26 CDT; 50min ago Process: 30916 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited Process: 30832 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_rec Process: 30829 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status= Process: 30828 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0 Main PID: 30916 (code=exited, status=0/SUCCESS) Jul 30 12:16:53 fog-desktop systemd[1]: Starting MariaDB database server... Jul 30 12:16:53 fog-desktop mysqld[30916]: 2020-07-30 12:16:53 139648654302336 [Note] /usr/sbin/mysqld (mysqld 1 Jul 30 12:18:23 fog-desktop systemd[1]: mariadb.service: Start operation timed out. Terminating. Jul 30 12:18:26 fog-desktop systemd[1]: mariadb.service: Failed with result 'timeout'. Jul 30 12:18:26 fog-desktop systemd[1]: Failed to start MariaDB database server. root@fog-desktop:/home/admin#
-
@rets34 said in MySQL Failed:
systemd[1]: mariadb.service: Failed with result ‘timeout’.
Please follow this information:
https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263The gist:
echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld systemctl restart mariadb
Then wait a couple of seconds and do the
systemctl -l status mariadb
-
root@fog-desktop:/home/admin# systemctl -l status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2020-07-30 13:37:37 CDT; 17s ago Process: 23218 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status Process: 23215 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS) Process: 23104 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_rec Process: 23102 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status= Process: 23101 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0 Main PID: 23188 (mysqld) Status: "Taking your SQL requests now..." Tasks: 29 (limit: 4915) CGroup: /system.slice/mariadb.service └─23188 /usr/sbin/mysqld Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: Processing databases Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: information_schema Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: mysql Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: performance_schema Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: Phase 6/7: Checking and upgrading tables Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: Processing databases Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: information_schema Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: performance_schema Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: Phase 7/7: Running 'FLUSH PRIVILEGES' Jul 30 13:37:39 fog-desktop /etc/mysql/debian-start[23221]: OK
That fixed it, however after a reboot I got ‘database connection unavailable’ again.
And back to square one with:Setting up and starting MySQL...............................Failed!
-
@rets34 you probably need to remove MySQL proper.
apt-get remove --purge mysql-server
Followed by the commands I gave below.
I gave the gist to get you up and running right away. Why you would reboot again, when that broke this the first time, seems strange. This is a server and should not need to be restarted every time you want to update fog.
-
@Tom-Elliott I was just if I had to reboot the machine for whatever reason that I wouldn’t have to worry about it failing. But the solution you posted has worked to get it working.
Now I just need to figure out how to get all my images to show up in the WebUI, got them all on the machine but don’t have an exported CSV from prior to database dying. -
@rets34 said in MySQL Failed:
Now I just need to figure out how to get all my images to show up in the WebUI, got them all on the machine but don’t have an exported CSV from prior to database dying.
You can simply re-create the image definitions in the web UI and make sure they are pointed to the existing directories. They won’t be overwritten unless you re-capture the image! It’s always good to keep a full daily database backup or at least pull a CSV dump every now and then.
-
I went through and pointed a couple to the old location, and it’s not showing Size?
-
@rets34 Size on client is only being updated when re-capturing the image. Don’t worry about it.
-
@Sebastian-Roth Makes sense to me.
Solved for me