For at least a week now (since I noticed), more than 50% of our 120+ FreePBX machines fail to start the firewall after a reboot. The only time consuming fix so far has been to logon to the web UI of each server, disable the firewall and enable it again in order to get the service started. This is happening both on FreePBX 14 and FreePBX 15, both of which are fully up to date (both in terms of yum and modules).
This is what the firewall shows after reboot (even several hours or days after boot):
PHP Warning: mkdir(): No such file or directory in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 22
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't create /var/run/asterisk/firewall directory' in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php:25
Stack trace:
#0 phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php(14): FreePBX\modules\Firewall\Lock::canLock('firewall')
#1 /var/www/html/admin/modules/firewall/hooks/voipfirewalld(3): include('phar:///var/www...')
#2 {main}
thrown in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 25
PHP Warning: mkdir(): No such file or directory in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 22
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't create /var/run/asterisk/firewall directory' in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php:25
Stack trace:
#0 phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php(14): FreePBX\modules\Firewall\Lock::canLock('firewall')
#1 /var/www/html/admin/modules/firewall/hooks/voipfirewalld(3): include('phar:///var/www...')
#2 {main}
thrown in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 25
I will check other systems to see if I find similar errors.
On a second system, the error is a bit different but similar:
Unparseable output from getservices - ["Exception: Asterisk is not connected in file \/var\/www\/html\/admin\/libraries\/php-asmanager.php on line 242","Stack trace:"," 1. Exception->() \/var\/www\/html\/admin\/libraries\/php-asmanager.php:242"," 2. AGI_AsteriskManager->send_request() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:447"," 3. FreePBX\\modules\\Firewall\\Smart->getPjsipContacts() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:437"," 4. FreePBX\\modules\\Firewall\\Smart->getRegistrations() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:69"," 5. FreePBX\\modules\\Firewall\\Smart->getAllPorts() \/var\/www\/html\/admin\/modules\/firewall\/Firewall.class.php:1110"," 6. FreePBX\\modules\\Firewall->getSmartPorts() \/var\/www\/html\/admin\/modules\/firewall\/bin\/getservices:22"] - returned 1
PHP Warning: Error while sending QUERY packet. PID=4377 in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php on line 378
Unable to connect to Database, sleeping 2 seconds and retrying. (1)
Unable to connect to Database, sleeping 2 seconds and retrying. (2)
PHP Warning: mkdir(): No such file or directory in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 22
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't create /var/run/asterisk/firewall directory' in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php:25
Stack trace:
#0 phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php(14): FreePBX\modules\Firewall\Lock::canLock('firewall')
#1 /var/www/html/admin/modules/firewall/hooks/voipfirewalld(3): include('phar:///var/www...')
#2 {main}
thrown in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 25
Third system has a slighty different error, but same ending:
Unparseable output from getservices - ["Exception: Asterisk is not connected in file \/var\/www\/html\/admin\/libraries\/php-asmanager.php on line 248","Stack trace:"," 1. Exception->() \/var\/www\/html\/admin\/libraries\/php-asmanager.php:248"," 2. AGI_AsteriskManager->send_request() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:447"," 3. FreePBX\\modules\\Firewall\\Smart->getPjsipContacts() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:437"," 4. FreePBX\\modules\\Firewall\\Smart->getRegistrations() \/var\/www\/html\/admin\/modules\/firewall\/Smart.class.php:69"," 5. FreePBX\\modules\\Firewall\\Smart->getAllPorts() \/var\/www\/html\/admin\/modules\/firewall\/Firewall.class.php:1477"," 6. FreePBX\\modules\\Firewall->getSmartPorts() \/var\/www\/html\/admin\/modules\/firewall\/bin\/getservices:22"] - returned 1
PHP Warning: mkdir(): No such file or directory in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 22
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't create /var/run/asterisk/firewall directory' in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php:25
Stack trace:
#0 phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php(14): FreePBX\modules\Firewall\Lock::canLock('firewall')
#1 /var/www/html/admin/modules/firewall/hooks/voipfirewalld(3): include('phar:///var/www...')
#2 {main}
thrown in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 25
The common denominator seems to be this: 'Can't create /var/run/asterisk/firewall directory'
I suppose this can be fixed with fwconsole chown, however is there a way to replicate the disable / enable from the GUI as a command-line? Some sort of firewall restart command?
Hello,
Has there been any update on this? I am running into the same thing on both a FPBX13 and FPBX15 server. fwconsole firewall start does not seem to help. My “solution” is to back down the firewall module to the previous one.
I can’t repro this @sorvani. My 15 system running firewall 15.0.6.32 starts within 3 minutes on boot, but we have reports of start being delayed for as long as 5 minutes. What version of Firewall? I can’t think of anything in Firewall that might affect how/when Asterisk starts.
1603908456: wait_response returned false. Restarting monitoring thread.
PHP Warning: Error while sending QUERY packet. PID=27971 in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php on line 378
Unable to connect to Database, sleeping 2 seconds and retrying. (1)
PHP Warning: mkdir(): No such file or directory in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 22
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't create /var/run/asterisk/firewall directory' in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php:25
Stack trace:
#0 phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/firewall.php(14): FreePBX\modules\Firewall\Lock::canLock('firewall')
#1 /var/www/html/admin/modules/firewall/hooks/voipfirewalld(3): include('phar:///var/www...')
#2 {main}
thrown in phar:///var/www/html/admin/modules/firewall/hooks/voipfirewalld/lock.php on line 25
Starting firewall.
1603908913: Wall: 'Firewall service now starting.
' returned 0