PDA

View Full Version : Upgraded F26 to F27 and now MariaDb won't start



bill.damage
20th November 2017, 01:41 PM
Have been through several successive dnf system-upgrades with no problem, this time though something went very wrong. It did it on 2 separate servers too.
On reboot, mariadb does not start. Also, the bacula db was not updated.
I noticed that /var/run/mariadb is not created on boot, but can start it manually ... until the next boot. This is what I do (ignore the dodgy permissions, it's just to illustrate):


[root@sabbath run]# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@sabbath run]# mkdir /var/run/mariadb
[root@sabbath run]# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@sabbath run]# chmod +777 /var/run/mariadb
[root@sabbath run]# systemctl restart mariadb
[root@sabbath run]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.9-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>


What's the correct way to start it on boot as it used to, please?

zuser
20th November 2017, 04:55 PM
I think "systemctl enable" should do it as always.
Did you check "systemctl status mariadb.service" and "journalctl -xe" for details
as suggested? What was indicated?

bill.damage
20th November 2017, 05:22 PM
Hey thanks for your help. Well, I did the systemctl enable mariadb.service anyway, then rebooted.



[root@sabbath ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[root@sabbath ~]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.2 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-11-20 16:08:26 GMT; 7min ago
Process: 1117 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)
Process: 1022 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 901 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 1117 (code=exited, status=1/FAILURE)

Nov 20 16:06:41 sabbath systemd[1]: Starting MariaDB 10.2 database server...
Nov 20 16:06:48 sabbath mysql-prepare-db-dir[1022]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Nov 20 16:06:48 sabbath mysql-prepare-db-dir[1022]: If this is not the case, make sure the /var/lib/mysql is empty before running empty before running mysql-prepare-db-dir.
Nov 20 16:06:52 sabbath mysqld[1117]: 2017-11-20 16:06:52 139818348309760 [Note] /usr/libexec/mysqld (mysqld 10.2.9-MariaDB) starting
Nov 20 16:06:52 sabbath mysqld[1117]: 2017-11-20 16:06:52 139818348309760 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 table_cache: 431
Nov 20 16:08:26 sabbath systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 16:08:26 sabbath systemd[1]: Failed to start MariaDB 10.2 database server.
Nov 20 16:08:26 sabbath systemd[1]: mariadb.service: Unit entered failed state.
Nov 20 16:08:26 sabbath systemd[1]: mariadb.service: Failed with result 'exit-code'.

[root@sabbath ~]# journalctl -xe
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit bacula-dir.service has finished starting up.
--
-- The start-up result is done.
Nov 20 16:18:36 sabbath audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=s
Nov 20 16:18:36 sabbath audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=su
Nov 20 16:18:36 sabbath audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=s
Nov 20 16:19:06 sabbath bacula-dir[6843]: bacula-dir: dird.c:1155-0 Could not open Catalog "MyCatalog", database "bacula".
Nov 20 16:19:06 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:06 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:06 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:06 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:07 sabbath bacula-dir[6843]: bacula-dir: dird.c:1160-0 mysql.c:271 Unable to connect to MySQL server.
Nov 20 16:19:07 sabbath bacula-dir[6843]: Database=bacula User=bacula
Nov 20 16:19:07 sabbath bacula-dir[6843]: MySQL connect failed either server not running or your authorization is incorrect.
Nov 20 16:19:07 sabbath bacula-dir[6843]: 20-Nov 16:19 bacula-dir ERROR TERMINATION
Nov 20 16:19:07 sabbath bacula-dir[6843]: Please correct configuration file: /etc/bacula/bacula-dir.conf
Nov 20 16:19:07 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:07 sabbath bacula-dir[6843]: 20-Nov 16:19 Message delivery ERROR: fopen /data/Bacula/Working/log failed: ERR=Permission denied
Nov 20 16:19:07 sabbath systemd[1]: bacula-dir.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 16:19:07 sabbath audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=fa
Nov 20 16:19:07 sabbath systemd[1]: bacula-dir.service: Unit entered failed state.
Nov 20 16:19:07 sabbath systemd[1]: bacula-dir.service: Failed with result 'exit-code'.
Nov 20 16:19:07 sabbath systemd[1]: bacula-dir.service: Service hold-off time over, scheduling restart.
Nov 20 16:19:07 sabbath systemd[1]: Stopped Bacula-Director, the Backup-server.
-- Subject: Unit bacula-dir.service has finished shutting down
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit bacula-dir.service has finished shutting down.
Nov 20 16:19:07 sabbath audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=s
Nov 20 16:19:07 sabbath audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=su
Nov 20 16:19:07 sabbath systemd[1]: Started Bacula-Director, the Backup-server.
-- Subject: Unit bacula-dir.service has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit bacula-dir.service has finished starting up.
--
-- The start-up result is done.
Nov 20 16:19:07 sabbath audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=bacula-dir comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=s



Also, the /var/log/mariadb.log file ends with



2017-11-20 16:08:26 139817789175552 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 2 "No such file or directory")
2017-11-20 16:08:26 139817789175552 [ERROR] Can't start server: can't create PID file: No such file or directory


That's what put me onto asking the question about that dir at the start.

zuser
20th November 2017, 06:56 PM
Just a guess but possibly a SELinux issue after upgrade. If currently set to "Enforcing", try "Disabled".

No help I know but FWIW, I had F26 in Virtualbox running Nextcloud server using MySQL. After your post, I did dnf upgrade and all runs fine. I have SELinux disabled.