Project

General

Profile

Actions

Bug #8993

closed

PHP error from filter_rules_sort() when config.xml contains no rules

Added by Jim Pingle about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Rules / NAT
Target version:
Start date:
10/02/2018
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4.4
Affected Architecture:
All

Description

[01-Oct-2018 10:42:56 Etc/UTC] PHP Fatal error: Uncaught Error: Only variables can be passed by reference in /etc/inc/pfsense-utils.inc:2805
Stack trace:
#0 /usr/local/www/firewall_rules_edit.php(146): filter_rules_sort()
#1 {main}
thrown in /etc/inc/pfsense-utils.inc on line 2805

If someone removes all rules, leaving only automatic rules like the anti-lockout rule and bogons, this error can occur.

Actions #1

Updated by Jim Pingle about 3 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #2

Updated by Steve Beaver about 3 years ago

  • Target version changed from 2.4.4-GS to 2.4.4-p1
Actions #3

Updated by Steve Beaver about 3 years ago

  • Target version changed from 2.4.4-p1 to 2.4.4-GS
Actions #4

Updated by Luiz Souza about 3 years ago

  • Target version changed from 2.4.4-GS to 2.4.4-p1
Actions #5

Updated by Danilo Zrenjanin about 3 years ago

I couldn't replicate this one on:

SG-3100
2.4.4-RELEASE (arm)
built on Thu Sep 20 09:33:19 EDT 2018
FreeBSD 11.2-RELEASE-p3

I tried with a different type of rules with and without aliases. If there is a specific way how to replicate it, please provide more details.

Actions #6

Updated by Jim Pingle about 3 years ago

You have to delete all of the rules in the config so it only has <filter></filter>

So you'd have to hit it from LAN with the anti-lockout rule passing you through.

Actions #7

Updated by Paighton Bisconer about 3 years ago

  • Status changed from Feedback to Resolved

Was able to replicate this after verifying <filter></filter> in config, connecting on the Anti-lockout rule, and trying to add a new firewall rule on LAN I received this error when the GUI failed:

Fatal error: Uncaught Error: Only variables can be passed by reference in /etc/inc/pfsense-utils.inc:2864 Stack trace: #0 /usr/local/www/firewall_rules_edit.php(146): filter_rules_sort() #1 {main} thrown in /etc/inc/pfsense-utils.inc on line 2864 PHP ERROR: Type: 1, File: /etc/inc/pfsense-utils.inc, Line: 2864, Message: Uncaught Error: Only variables can be passed by reference in /etc/inc/pfsense-utils.inc:2864 Stack trace: #0 /usr/local/www/firewall_rules_edit.php(146): filter_rules_sort() #1 {main} thrown

After hitting the Back button in the browser I had an alert:

Notices
PHP errors
PHP ERROR: Type: 1, File: /etc/inc/pfsense-utils.inc, Line: 2864, Message: Uncaught Error: Only variables can be passed by reference in /etc/inc/pfsense-utils.inc:2864
Stack trace:
#0 /usr/local/www/firewall_rules_edit.php(146): filter_rules_sort()
#1 {main}
thrown    @ 2018-11-22 01:08:48

Crash report:

Crash report begins.  Anonymous machine information:

arm
11.2-RELEASE-p3
FreeBSD 11.2-RELEASE-p3 #11 220591260a0(factory-RELENG_2_4_4): Thu Sep 20 10:39:07 EDT 2018     root@buildbot3:/crossbuild/244/obj/armv6/zusWWsAv/arm.armv6/crossbuild/244/pfSense/tmp/FreeBSD-src/sys/pfSense-uFW

Crash report details:

PHP Errors:
[22-Nov-2018 01:08:48 Etc/UTC] PHP Fatal error:  Uncaught Error: Only variables can be passed by reference in /etc/inc/pfsense-utils.inc:2864
Stack trace:
#0 /usr/local/www/firewall_rules_edit.php(146): filter_rules_sort()
#1 {main}
  thrown in /etc/inc/pfsense-utils.inc on line 2864

No FreeBSD crash data found.

Upgraded to Current Base System 2.4.5.a.20181120.0855, retested with same steps, was able to add new firewall rule without issue.

Confirmed resolved.

Actions #8

Updated by Joachim Tingvold about 3 years ago

Any way to fix this manually? (i.e. if I don't want to update to dev)

Actions #9

Updated by Jim Pingle about 3 years ago

Apply the commit listed above using the System Patches package: https://www.netgate.com/docs/pfsense/development/system-patches.html

Actions #10

Updated by Joachim Tingvold about 3 years ago

Ah, cool! Thanks!

Actions

Also available in: Atom PDF