Help, freepbx distro crashed

A few months ago a distro crashed and I found one of the disks to be faulty. So I replaced it. I use a brand new HP ml-110 server.

A month ago I installed freepbx distro. Today It crashed again. That is what I get from the GUI:


DB Error: connect failed

Trace Back

/var/www/html/admin/libraries/db_connect.php:63 die_freepbx()
[0]: DB Error: connect failed

/var/www/html/admin/bootstrap.php:98 require_once()
[0]: /var/www/html/admin/libraries/db_connect.php

/etc/freepbx.conf:9 require_once()
[0]: /var/www/html/admin/bootstrap.php

/var/www/html/admin/config.php:109 include_once()
[0]: /etc/freepbx.conf

I installed it in Software RAID mode.

My questions are: 1. is there a chance to recover without installing from fresh.
2. May it be related to the RAID mode? I read some places suggesting that in CentOS it may crash…I use the latest freepbx distro.

Please advise.

This is not crashed. This tells me MySQL is not running. What is the version of the Distro?

My version is 5.211.65-11-i386


This has nothing to do with RAID, what changes did you make just prior to this happening?

Do you take care of the server or do you have a tech?

The steps to fix are as follows:

Check is MySQL running (service mysql status)
Check if asterisk db is ok (series of MySQL commands)
Make sure password in /etc/freepbx.conf matches mySQL account for that username

mysql: unrecognized service

there is a match between the user and password in freepbx.conf
and in cdr_mysql.conf
both users are freepbxuser

what does

service mysqld status


that is when I type

service mysqld status

mysqld is stopped

service mysqld start
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]

OK so clear the lock file for mysql and start it.

in /var/lock/subsys no my mysql file exists

I also tried

amportal restart

Please wait…
/usr/local/sbin/amportal: line 46: [FATAL]: command not found

/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

OK I entered the follows:

mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak

and then restarted mysqld service successfuly and amportal restart brought the system back to life

Thank you so much for your prompt responses

Please consider to keep your FreePBX Distro 5.211.65-11 updated and so perform accordingly all the update steps (See Wiki’s FreePBX Distro pages for the CLI Update Scripts) up to FreePBX Distro 5.211.65-14.

I’m quite sure the MySQL lock issue was fixed in latest FreePBX Distro releases (I too suffered of that issue in the past): updating FreePBX Distro will let you avoid this issue next time your system will suddenly crash (see the old FPBXDISTRO-61 Ticket).

Thx willco

Just for reference: the FreePBX Ticket I was referring (the old FPBXDISTRO-61 Ticket) is the FREEPBX-7574 Ticket.

Well, I just tried now to upgrade distroo version which is 5.211.65-6 and not as I quoted before.

I downloaded the upgrade script, and followed the steps as described in the wiki, everything looked fine, alas, after reboot - no upgrade was made…It remains 5.211.65-6…

So you exectued the “” shell script as per Wiki’s instructions and the system, after a reboot, present itself still as FreePBX Distro 5.211.65-6?

What’s the content of /etc/schmooze/pbx-version file?

What’s the content of /var/log/pbx/upgrade/5.211.65-7 (log) file created while the above upgrade script was executed?

Quite interesting, reviewing my upgrade 5.211.65-7 log, to discover that, with exactly that FreePBX Distro 5.211.65-7 release, Developers introduced the mysql-init-fixer you probably need to fix your issue…so it was strange to see your system declared as a -11 when that issue was only fixed with -7.

I executed
Probably misunderstood the instructions…will try -7 at night on maintenace time…Will I have to upgrade it version by version till I reach -14?

Yes. It’s a step by step upgrade process.

Example: if your FreePBX Distro is 5.211.65-(N) then you should apply the upgrade-5.211.65-(N+1) script to reach the FreePBX Distro 5.211.65-(N+1) status, then, again if you want (and with reboots in between, when they’re requested), proceed up to the latest final available version (actually the 14th).

In your case you should execute eight upgrade scripts (from 7 to 14) to upgrade your FreePBX Distro 5.211.65-6 to 5.211.65-14. In half an hour (with reboots in between) you would be OK.


A bit cumbersome, I would say

That’s cumbersome BTW.

If you use the Commercial sys-admin module the upgrades are one touch. You can also copy all the names into a script file, run it and walk away.

We buy commercial modules that we think the customer needs. And BTW the end-point manager doesn’t work at all with wireless connected ip phones…so sometimes we even buy modules that of no use…