GUI throws error when enabling firewall

firewall
Tags: #<Tag:0x00007f702bc0c2e8>

(Logistry) #1

connectivity - firewall - enable firewall, got the below error

Exception thrown with message “SQLSTATE[HY000] [2002] Connection refused::SQLSTATE[HY000] [2002] Connection refused”

Stacktrace:
#7 Exception in /var/www/html/admin/libraries/utility.functions.php:204
#6 die_freepbx in /var/www/html/admin/libraries/BMO/Database.class.php:142
#5 PDOException in /var/www/html/admin/libraries/BMO/Database.class.php:137
#4 PDO:__construct in /var/www/html/admin/libraries/BMO/Database.class.php:137
#3 FreePBX\Database:__construct in /var/www/html/admin/libraries/BMO/FreePBX.class.php:71
#2 FreePBX:__construct in /var/www/html/admin/bootstrap.php:153
#1 require_once in /etc/freepbx.conf:11
#0 include_once in /var/www/html/admin/config.php:100

see attached full pictures of the error.


PBX Firmware 12.7.5-1805-3.sng7
Firewall 13.0.56
FreePBX GUI 14.0.3.6

If anyone with more knowledge than me who can please take look at these errors and tell me whats wrong here.
Is this a bug?

Appreciate your responses

Cheers!


Issue After Power Outage
(Logistry) #2

Up please.

When I go to the GUI I get the above error with the same stacktrace.

Attached is what I get when logging into SSH.

This is from the GUI, I do notice that the error details is a bit different than my original post


So this seems to me that it’s the firewall which is causing it, can anyone please tell me what to look for?

Thanks


(Rob Thomas) #3

MySQL is not running - it’s crashed or been stopped. Restart MySQL or reboot your machine.


(Dave Burgess) #4

Once you get MySQL running again, you need to make sure you repair all of the databases.

Repair from the console as root with mysqlcheck --repair --all-databases

IIRC, there’s also an ‘fwconsole repairall’ command, but I might have dreamed that.


Distro Diag
(Logistry) #5

This keeps on happening. I have to reboot my PBX every time.

I tried to update framework today, and here’s what happened.

I tried running the database repair command, it says for almost every table the same error.

Anything I can look for?


(Rob Thomas) #6

The error is ‘MySQL Server has gone away’. That means it was running, and now it’s not. At a guess, you’re running out of memory, and MySQL is being killed.


(Logistry) #7

Thanks Rob,

That was my initial thought, the pbx running out of memory.
This pbx is a $5 VM on Vultr 1GB ram. I believe that some users here have the same VM deployed with no issues. I’m not trying to blame it on, but it seems to me that this issue only happens when the pbx firewall is running. Is there any way I can troubleshoot that?


(Tony Lewis - https://bit.ly/2SbDAyc) #8

CentOS 7 says 2GB min but 4GB recommended last time I checked.


(Logistry) #9

Hi Tony,

I understand that, some users here said that they have $5 instances running just fine. my question is how i can troubleshoot what is actually eating the memory that causes mysql to stop?


#10

if you don’t have any proper monitoring you could always start a screen session and just run

watch -n5 "ps aux >> /tmp/mem && date >> /tmp/mem && printf '\n\n\n' >> /tmp/mem" 

until it happens again

that’s a really lazy solution and will be very verbose but you shouldn’t really miss a thing. at least nothing process metrics-wise.

Just read through the /tmp/mem file it creates until you see something start to eat ram and die

If it’s happening quite suddenly just check your logs for mysql stopping and see if there’s anything happening right before.

also remember to do system updates, not just freepbx updates

if the machine is trying to update itself for some reason while asterisk/ apache/ mysql are running i could see it eating up the resources.


(Rob Thomas) #11

I should remind you that FreePBX has built in monitoring. Right there on the dashboard!

image

What’s causing it? Could be anything. But the minimum requirements are 2gb. I’d recommend 4, and 2 CPU’s, as the entry-level VM though.


(system) closed #12

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