FreePBX | Register | Issues | Wiki | Portal | Support

Fatal error reading freepbx_settings


(Anthony C) #1

I was just in the GUI for one of my on-prem customers, looking at CDR reports and their entire system crashed completely, stopped processing calls etc.

I got straight to site within about 30 minutes and have the following error when trying to access the GUI…

Exception

fatal error reading freepbx_settings::

All fwconsole commands fail with the error:

Exception: SQLSTATE[HY000] [2002] Connection refused::SQLSTATE[HY000] [2002] Connection refused 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

I have managed to get Asterisk started but FreePBX/GUI still not working.

I have been googling for about half an hour and haven’t found anything which has made a difference - unable to run the usual fwconsole chown, etc.

Any ideas?!


(Lorne Gaetz) #2

Looks like mysql is not running, which can happen if disk space is exhausted.


(Anthony C) #3

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/SangomaVG-root 876G 101G 775G 12% /
devtmpfs 3.6G 0 3.6G 0% /dev
tmpfs 3.6G 0 3.6G 0% /dev/shm
tmpfs 3.6G 25M 3.6G 1% /run
tmpfs 3.6G 0 3.6G 0% /sys/fs/cgroup
/dev/sda1 1.9G 147M 1.7G 9% /boot
tmpfs 728M 0 728M 0% /run/user/0

service mariadb status
Redirecting to /bin/systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-06-03 15:40:32 BST; 22min ago
Process: 3827 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 3793 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 3825 (mysqld_safe)


(Anthony C) #4

After further investigation it looks like mysql was corrupted. I have restored a backup of the tables from last night and now get:
SQLSTATE[HY000] [2002] Permission denied::SQLSTATE[HY000] [2002] Permission denied

I have ensured that the freepbxuser account is created, given access to the tables and has the same password as in freepbx.conf

fwconsole chown works fine now but still can’t get into the GUI.