Upgrade from 13 to 14 Issues

Upgrade finished, but the GUI and any fwconsole command, as well as asterisk does not work.

Exception: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)::SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in file /var/www/html/admin/libraries/utility.functions.php on line 204
Stack trace:
  1. Exception->() /var/www/html/admin/libraries/utility.functions.php:204
  2. die_freepbx() /var/www/html/admin/libraries/BMO/Database.class.php:142
  3. PDOException->() /var/www/html/admin/libraries/BMO/Database.class.php:137
  4. PDO->__construct() /var/www/html/admin/libraries/BMO/Database.class.php:137
  5. FreePBX\Database->__construct() /var/www/html/admin/libraries/BMO/FreePBX.class.php:71
  6. FreePBX->__construct() /var/www/html/admin/bootstrap.php:153
  7. require_once() /etc/freepbx.conf:9
  8. include_once() /var/lib/asterisk/bin/fwconsole:12

Space is not an issue

[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          246G   52G  182G  23% /
devtmpfs        2.9G     0  2.9G   0% /dev
tmpfs           2.9G     0  2.9G   0% /dev/shm
tmpfs           2.9G  8.8M  2.9G   1% /run
tmpfs           2.9G     0  2.9G   0% /sys/fs/cgroup
/dev/sda1       246G   52G  182G  23% /

It appears that /var/lib/mysql/mysql.sock does not exsist

I already tried running the post upgrade script

[root@localhost ~]# /tmp/post_upgrade
######### Starting upgrade repair on Tue Apr  7 14:46:05 EDT 2020 #########
######### Cleaning old EL5 and EL6 packages #########
rpm: error while loading shared libraries: librpmbuild.so.1: cannot open shared object file: No such file or directory
grepgrepgrep: : error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
: error while loading shared librarieserror while loading shared libraries: : libpcre.so.0: cannot open shared object file: No such file or directory
libpcre.so.0: cannot open shared object file: No such file or directory
######### Enabling and starting mariadb #########
Error running /usr/bin/systemctl start mariadb - Retrying. Output was:
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
Error running /usr/bin/systemctl start mariadb - Retrying. Output was:
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
Error running /usr/bin/systemctl start mariadb - Retrying. Output was:
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
/tmp/post_upgrade: line 71: [: -ne: unary operator expected
######### Running mysql_upgrade #########
Error running /usr/bin/mysql_upgrade - Retrying. Output was:
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL ERROR: Upgrade failed
Error running /usr/bin/mysql_upgrade - Retrying. Output was:
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL ERROR: Upgrade failed
Error running /usr/bin/mysql_upgrade - Retrying. Output was:
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL ERROR: Upgrade failed
######### Attempting to check for internet connectivity #########
grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
######### Invalid certificate. It is likely that something is doing SSL interception #########
######### Please assign this machine to the unfiltered zone and retry #########

How do I get this machine back in service?

Thanks

Find out why mariadb is not starting?

systemctl restart mysql

(read the response, if it didn’t restart, do what it suggests)

[root@localhost ~]# systemctl restart mysql
Failed to restart mysql.service: Unit not found.

Your OS? How did you install?

updatedb;locate *.service|egrep “sql|maria”

The FreePBX distro. Standard Install

Returns

[root@localhost ~]# updatedb;locate *.service|egrep "sql|maria"
/etc/systemd/system/multi-user.target.wants/mariadb.service
/usr/lib/systemd/system/mariadb.service

then

systemctl restart mariadb
[root@localhost ~]# 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.

did you you do the suggested remediations yet?

[root@localhost ~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-04-07 16:27:54 EDT; 1min 19s ago
  Process: 14743 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=1/FAILURE)

Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: my.cnf files. You can ignore these by doing:
Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf
Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: You can also try to start the mysqld daemon with:
Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: shell> /usr/libexec/mysqld --skip-grant-tables --general-log &
Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: and use the command line tool /usr/bin/mysql
Apr 07 16:27:54 localhost.localdomain mariadb-prepare-db-dir[14743]: to connect to the mysql database and look at the grant tables:
Apr 07 16:27:54 localhost.localdomain systemd[1]: mariadb.service: control process exited, code=exited status=1
Apr 07 16:27:54 localhost.localdomain systemd[1]: Failed to start MariaDB database server.
Apr 07 16:27:54 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
Apr 07 16:27:54 localhost.localdomain systemd[1]: mariadb.service failed.

journalctl -xe doesn’t return much details

Would you consider that a good place to start fixing it might be adjusting the permissions of the asterisk user?
But a bigger consideration might be “how, in any way ,did you deviate from the standard recipes?”

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