We were seriously hit by Hurricane Irma. Solar Panels still hanging 50 food up in a tree. Generator and UPS destroyed. Power still down. Working on rented generator.
When I restarted the PBX, Asterisk came on fine, but FreePBX gave me an error message about a corrupted database.
After research I am trying to repair as root with
mysqlcheck --repair --all-databases
mysqlcheck: Got error: 1045: Access denied for user ‘root’@‘localhost’ (using password: Yes) when trying to connect
So I tried to do it with a password, but am not able to get it to work.
I have tried all kinds of user/password combinations.
root / admin etc.
I saw in one error message, that FreePBX seems to connect to Asterisk with admin and the password that I set when setting up the system. I had meanwhile changed the password.
mysqlcheck --repair --all-databases --user admin --password=xxxxxx
What password should I use? Why is root not able to handle this?
Thanks for any help!
Do you have a backup from module backup ? You can try
to restore it localy and find in conf the user mysql used by freepbx and the hash of the password.
Once a week I have FreePBX do a complete backup. Does that backup help?
How would I restore this?
If you were using the FreePBX Distro, there is no root MySQL password. You may be able to use:
fwconsole util tablefix
restore your backup if you have nothing to loose.
Install a new configuration with freepbx (same version, and same version of module backup), and use the module backup/restore to restore your backup.
In normal installations, there is no password required for “root” from the local machine, so try including the host name and user name:
mysqlcheck -u root -h 127.0.0.1 --repair --all-databases
That worked. Thanks
However, not I can not connect to the interfaces (UCP and Admin) via HTTP anymore.
Asterisk seams to run fine, at least there are calls in and out.
(Power came back. Yeah.)
Apache log is in
/var/log/httpd/access_log might be clues there.
Nothing there. Still working fine at 8:02 am and that is logged, nothing after-.
Somehow Asterisk runs, but FreePBX not.
I cant even SSH into the system. No response.
Ping and local console works.
Sounds like firewall or fail2ban to me. Quick n’ dirty fix would be restarting fail2ban
Or you could try to find which jail you’re in and unblock yourself.
grep [your-ip-address] /var/log/fail2ban.log
and look for something like this:
2017-09-05 03:10:36,079 fail2ban.actions: WARNING [apache-tcpwrapper] Ban [your-ip-address]
Then find which jail you’re in and do:
fail2ban-client set [jail name] unbanip [your-ip-address]
If that doesn’t do it, try adding your IP to the firewall as trusted:
fwconsole firewall trust [your-ip-address]
fwconsole firewall stop
fwconsole firewall start
Thank you everybody!! Amazing help!
It was the firewall. Somewhere in all of this it was enabled. We have a hardware firewall so we don’t use the build in one.
So, sql files repaired.
cool, but think to test the restore process by the module backup in the case of a futur irma…and backup daily isn’t bad
Yes, good idea. I will change the backup to daily.
Also, I will test the restore.
As I have FreePBX 13, can I just install a fresh FreePBX 13 on a new machine and restore?
Yes, but install the same version of the module backup.
You can use a virtual machine to restore your backup, I made this before use in production my freepbx setup for my customers.
I now did a backup, and all worked.
However, in the process, I lost my postfix settings. Is there a way to add them to the backup?
just add the /etc/postfix direcory to the manifest
exactly , you can add directory in you backup, very usefull if you have your CRM on the same server
Thanks. That works great!
Or TimeTrex, or any of a dozen other programs.