PBX 17 - Firewall Error Message

I had a VM die today. The install was an older FreePbx 16 and I decided to fire up a new VM and do an clean install of FreePbx 17 then do a restore of the old config.

After I do a restore, there is no audio either direction, so I headed over to the firewall to start troubleshooting and got this error message.

image

I then went back to a clean install and confirmed I could get to the firewall in the GUI. And I could.
I then did a restore and came up with the same result. The firewall throws error messages in the GUI.

Any ideas how I can begin to fix this?

Thanks as always for everyone’s help!

What’s the firewall version ?
Can you open a support case and give me the case number so I can work it ?

Is there a SSH command to get the firewall version?

I tried; fwconsole firewall -v

fwconsole ma list | grep firewall

Its Firewall version 17.0.1.30

Here is the link to the ticket;

try this: fwconsole ma downloadinstall firewall --tag= 17.0.1.32 && fwconsole reload

1 Like

Ill get this info back to you tomorrow. Its time to turn of the computer (here in California).

Here is the result.


root@ORD-PBX-GigRent-003:~# fwconsole ma downloadinstall firewall --tag= 17.0.1.32 && fwconsole reload
No repos specified, using: [standard] from last GUI settings

Downloading module 'firewall'
Processing firewall
Downloading...
 1211709/1211709 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 4 seconds
Generating CSS...Done
Module firewall version 17.0.1.30 successfully installed
Downloading module '17.0.1.32'
The following error(s) occured:
 - Retrieved Module XML Was Empty
root@ORD-PBX-GigRent-003:~# ^C

The GUI still throws this error message when trying to access the firewall

Whoops\Exception\ErrorException thrown with message "A non-numeric value encountered"

Stacktrace:
#5 Whoops\Exception\ErrorException in /var/www/html/admin/modules/firewall/Firewall.class.php:2306
#4 Whoops\Run:handleError in /var/www/html/admin/modules/firewall/Firewall.class.php:2306
#3 FreePBX\modules\Firewall:inRange in /var/www/html/admin/modules/firewall/Firewall.class.php:2268
#2 FreePBX\modules\Firewall:isTrusted in /var/www/html/admin/modules/firewall/Firewall.class.php:797
#1 FreePBX\modules\Firewall:showLockoutWarning in /var/www/html/admin/modules/firewall/page.firewall.php:23
#0 include in /var/www/html/admin/config.php:658

what( wich) version firewall showing now your PBX?
fwconsole ma list | grep firewall

i see your problem… Pls try this,

Downloading module '17.0.1.32'
The following error(s) occured:
 - Retrieved Module XML Was Empty
fwconsole ma refreshsignatures
fwconsole ma --edge upgradeall
fwconsole chown
fwconsole r --verbose

That did allot of stuff… but the error is still there.


root@ORD-PBX-GigRent-003:~# fwconsole ma refreshsignatures
fwconsole ma --edge upgradeall
fwconsole chown
fwconsole r --verbose
Getting Data from Online Server...
Done
Checking Signatures of Modules...
Checking accountcodepreserve...
Good
Checking adv_recovery...
Good
Checking allowlist...
Good
Checking amd...
Good
Checking announcement...
Good
Checking api...
Good
Checking areminder...
Good
Checking arimanager...
Good
Checking asterisk-cli...
Good
Checking asteriskinfo...
Good
Checking backup...
Good
Checking blacklist...
Good
Checking broadcast...
Good
Checking builtin...
Checking bulkhandler...
Good
Checking calendar...
Good
Checking callaccounting...
Good
Checking callback...
Good
Checking callerid...
Good
Checking callforward...
Good
Checking calllimit...
Good
Checking callrecording...
Good
Checking callwaiting...
Good
Checking cdr...
Good
Checking cdrpro...
Good
Checking cel...
Good
Checking certman...
Good
Checking cidlookup...
Good
Checking conferences...
Good
Checking conferencespro...
Good
Checking configedit...
Good
Checking contactmanager...
Good
Checking core...
Good
Checking cos...
Good
Checking customappsreg...
Good
Checking customcontexts...
Good
Checking dashboard...
Good
Checking daynight...
Good
Checking dictate...
Good
Checking directory...
Good
Checking disa...
Good
Checking donotdisturb...
Good
Checking dynroute...
Good
Checking endpoint...
Good
Checking extensionroutes...
Good
Checking extensionsettings...
Good
Checking fax...
Good
Checking faxpro...
Good
Checking featurecodeadmin...
Good
Checking filestore...
Good
Checking findmefollow...
Good
Checking firewall...
Good
Checking framework...
Good
Checking hotelwakeup...
Good
Checking iaxsettings...
Good
Checking infoservices...
Good
Checking ivr...
Good
Checking languages...
Good
Checking logfiles...
Good
Checking manager...
Good
Checking miscapps...
Good
Checking miscdests...
Good
Checking missedcall...
Good
Checking music...
Good
Checking oracle_connector...
Good
Checking outcnam...
Good
Checking outroutemsg...
Good
Checking paging...
Good
Checking pagingpro...
Good
Checking parking...
Good
Checking parkpro...
Good
Checking pbxmfa...
Good
Checking phpinfo...
Good
Checking pinsets...
Good
Checking pinsetspro...
Good
Checking pm2...
Good
Checking pms...
Good
Checking presencestate...
Good
Checking printextensions...
Good
Checking queueprio...
Good
Checking queues...
Good
Checking queuestats...
Good
Checking qxact_reports...
Good
Checking recording_report...
Good
Checking recordings...
Good
Checking restapps...
Good
Checking ringgroups...
Good
Checking sangomaconnect...
Good
Checking sangomacrm...
Good
Checking sangomartapi...
Good
Checking scribe...
Good
Checking setcid...
Good
Checking sipsettings...
Good
Checking sipstation...
Good
Checking sms...
Good
Checking smsplus...
Good
Checking soundlang...
Good
Checking superfecta...
Good
Checking sysadmin...
Good
Checking timeconditions...
Good
Checking tts...
Good
Checking ttsengines...
Good
Checking ucp...
Good
Checking userman...
Good
Checking vmblast...
Good
Checking vmnotify...
Good
Checking voicemail...
Good
Checking voicemail_report...
Good
Checking voipinnovations...
Good
Checking vqplus...
Good
Checking weakpasswords...
Good
Checking webcallback...
Good
Checking webrtc...
Good
Done
Updating Hooks...Done
Edge repository temporarily enabled
No repos specified, using: [standard] from last GUI settings

Module(s) requiring upgrades: cdr, cdrpro, endpoint, firewall, queues, sangomartapi
Upgrading module 'cdr' from 17.0.4.33 to 17.0.4.34
Downloading module 'cdr'
Processing cdr
Downloading...
 243352/243352 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 0 seconds
Removed Job and added cron
Checking if field cnum is present in cdr table..OK!
Checking if field cnam is present in cdr table..OK!
Checking if field outbound_cnum is present in cdr table..OK!
Checking if field outbound_cnam is present in cdr table..OK!
Checking if field dst_cnam is present in cdr table..OK!
Checking if field linkedid is present in cdr table..OK!
Checking if field peeraccount is present in cdr table..OK!
Checking if field sequence is present in cdr table..OK!
Generating CSS...Done
Module cdr version 17.0.4.34 successfully installed
Updating Hooks...Done
Chowning directories...Done
Upgrading module 'cdrpro' from 17.0.4.5 to 17.0.4.6
Downloading module 'cdrpro'
Processing cdrpro
Downloading...
 1356526/1356526 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 1 seconds
Updating tables cdrpro_report_scheduler, cdrpro_score_mes, cdrpro_processed_uniqueids, cdrpro_unprocessed_uniqueids, cdrpro_cdr, cdrpro_email_templates...Done
Cdrpro is not licensed.
Stopping CDRpro Service
Generating CSS...Done
Module cdrpro version 17.0.4.6 successfully installed
Updating Hooks...Done
Chowning directories...Done
Upgrading module 'endpoint' from 17.0.2 to 17.0.2.6
Downloading module 'endpoint'
Processing endpoint
Downloading...
 94994234/94994234 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 7 seconds
Create symlink...Done
Checking database tables...Done
Migrating tables as required...Done
Checking Settings and Defaults...Done
Generating Configs...Done
Downloading Firmware...Done (Background)
updating Logout phones config...(Background)Generating CSS...Done
Module endpoint version 17.0.2.6 successfully installed
Updating Hooks...Done
Chowning directories...Done
Upgrading module 'firewall' from 17.0.1.30 to 17.0.1.32
Downloading module 'firewall'
Processing firewall
Downloading...
 1211484/1211484 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 0 seconds
Generating CSS...Done
Module firewall version 17.0.1.32 successfully installed
Updating Hooks...Done
Chowning directories...Done
Upgrading module 'queues' from 17.0.1.13 to 17.0.2
Downloading module 'queues'
Processing queues
Downloading...
 432324/432324 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 0 seconds
Updating tables queues_details, queues_config...Done
Generating CSS...Done
Module queues version 17.0.2 successfully installed
Updating Hooks...Done
Chowning directories...Done
Upgrading module 'sangomartapi' from 17.0.9 to 17.0.9.1
Downloading module 'sangomartapi'
Processing sangomartapi
Downloading...
 800967/800967 [============================] 100%
Finished downloading
Extracting...Done
Download completed in 1 seconds
Updating tables restapps_rtapi_conferences, sangomartapi_registry, sangomartapi_login_register, chat_push_tokens, sangomartapi_call_queue_members...Done
Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
Running installation..

Broadcast message from root@ORD-PBX-GigRent-003 (somewhere) (Mon Feb  3 10:49:3

Firewall service now starting.


npm WARN deprecated [email protected]: The sprintf package is deprecated in favor of sprintf-js.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: No longer maintained, please upgrade to swagger-client@3.

added 260 packages, and audited 261 packages in 16s

26 packages are looking for funding
  run `npm fund` for details

8 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Finished updating libraries!
Begin setting up Chat database...
Done setting up Chat database.
Begin setting up Queue database...
Done setting up Queue database...
Restarting Sangoma RT API Server
Stopping Sangoma RT API Server...
Stopped Sangoma RT API Server
Starting Sangoma RT API Server...
Started Sangoma RT API Server. PID is 12389
Generating CSS...Done
Module sangomartapi version 17.0.9.1 successfully installed
Updating Hooks...Done
Chowning directories...Done
All upgrades completed successfully!
Updating Hooks...Done
Chowning directories...Done
Chowning directories...Done
Chowning directories...Done
Chowning directories...Done
Chowning directories...Done
Chowning directories...Done
Resetting temporarily repository state
Taking too long? Customize the chown command, See https://sangomakb.atlassian.net/wiki/spaces/FP/pages/10289397/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done in 6 seconds
Setting specific permissions...
 15249 [============================]
Finished setting permissions
Reload Started
Reload Complete
root@ORD-PBX-GigRent-003:~#

And the error…

Whoops\Exception\ErrorException thrown with message "A non-numeric value encountered"

Stacktrace:
#5 Whoops\Exception\ErrorException in /var/www/html/admin/modules/firewall/Firewall.class.php:2345
#4 Whoops\Run:handleError in /var/www/html/admin/modules/firewall/Firewall.class.php:2345
#3 FreePBX\modules\Firewall:inRange in /var/www/html/admin/modules/firewall/Firewall.class.php:2307
#2 FreePBX\modules\Firewall:isTrusted in /var/www/html/admin/modules/firewall/Firewall.class.php:797
#1 FreePBX\modules\Firewall:showLockoutWarning in /var/www/html/admin/modules/firewall/page.firewall.php:23
#0 include in /var/www/html/admin/config.php:658

You have not applied changes, Not run last 2 commands.


fwconsole chown
fwconsole r --verbose

Same end result. The error is still there.

fwconsole chown
Taking too long? Customize the chown command, See https://sangomakb.atlassian.net/wiki/spaces/FP/pages/10289397/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done in 5 seconds
Setting specific permissions...
 15249 [============================]
Finished setting permissions
root@ORD-PBX-GigRent-003:~# fwconsole r --verbose
Reload Started
Reload Complete
root@ORD-PBX-GigRent-003:~#

Are you able to refresh your browser and try again.
result of --verbose is not showing any errors…

Even with a hard reload on chrome (CTRL key hold down while clicking refresh) the error is still there.

I pulled the screenshot off of the config running on FreePBX 16. Could an non numeric entry like this cause the issue with the Restore to FreePBX 17?

If that’s the rule, you can try this (using SSH as root)

1: fwconsole m
2: Type this: 
UPDATE kvstore_FreePBX_modules_Firewall 
SET val = REPLACE(val, ',"all.sipis.acrobits.cz":"internal"', '') 
WHERE `key` = 'networkmaps';

After that, try to access to the Firewall module in your browser.

If not, you can just go ahead and remove the firewall module and re-install it.

fwconsole ma remove firewall --force && fwconsole ma downloadinstall firewall && fwconsole reload

fwconsole firewall trust x.x.x.x
fwconsole firewall list trusted

Add and check ip (fqdn) basic checks.

Here is the result


MariaDB [asterisk]> UPDATE kvstore_FreePBX_modules_Firewall
    -> SET val = REPLACE(val, ',"all.sipis.acrobits.cz":"internal"', '')
    -> WHERE `key` = 'networkmaps';
Query OK, 0 rows affected (0.004 sec)
Rows matched: 1  Changed: 0  Warnings: 0

Doing the firewall uninstall and reinstall gets me to this screen…

After I enable the firewall, I get the same error.

2 Likes

Is there a way to scrub all the firewall settings and load “factory default” settings?

You can try to do the following:

1) fwconsole m
2) truncate kvstore_FreePBX_modules_Firewall;
3) fwconsole ma remove firewall && fwconsole ma downloadinstall firewall && fwconsole reload

After that, try to access to the firewall and see how it goes.