Project

General

Profile

Actions

Regression #13660

closed

Feature #13446: Upgrade PHP from 7.4 to 8.1

PHP8.1 error after applying floating rules changes

Added by Marcos M about 2 years ago. Updated about 2 years ago.

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

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Force Exclusion
Affected Version:
Affected Architecture:

Description

Tested on 23.01.a.20221114.0600

After applying floating rules changes, the following error showed under the rules table:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:54 Stack trace: #0 /usr/local/www/firewall_rules.php(85): get_pf_rules(Array, 1627764969, 1627764969) #1 /usr/local/www/firewall_rules.php(769): print_states(1627764969) #2 {main} thrown in /usr/local/www/firewall_rules.php on line 54 PHP ERROR: Type: 1, File: /usr/local/www/firewall_rules.php, Line: 54, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:54 Stack trace: #0 /usr/local/www/firewall_rules.php(85): get_pf_rules(Array, 1627764969, 1627764969) #1 /usr/local/www/firewall_rules.php(769): print_states(1627764969) #2 {main} thrown

Reloading the page then showed the rules correctly and the following alert/crash report was shown:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:54
Stack trace:
#0 /usr/local/www/firewall_rules.php(85): get_pf_rules(Array, 1627764969, 1627764969)
#1 /usr/local/www/firewall_rules.php(769): print_states(1627764969)
#2 {main}
  thrown in /usr/local/www/firewall_rules.php on line 54


Related issues

Has duplicate Bug #13721: PHP Fatal error - firewall_rules.php - FreeBSD 14.0-CURRENT #0 devel-main-n255818-a851396c4f4: Fri Dec 2 06:29:25 UTC 2022Duplicate

Actions
Actions #1

Updated by Jim Pingle about 2 years ago

  • Target version set to 2.7.0
  • Parent task set to #13446
  • Plus Target Version set to 23.01
  • Release Notes changed from Default to Force Exclusion
Actions #2

Updated by Marcos M about 2 years ago

I managed to trigger this a couple more times while changing limiter settings and simply browsing to the floating rules page - can't reproduce it consistently though.

Actions #3

Updated by Jim Pingle about 2 years ago

  • Has duplicate Bug #13721: PHP Fatal error - firewall_rules.php - FreeBSD 14.0-CURRENT #0 devel-main-n255818-a851396c4f4: Fri Dec 2 06:29:25 UTC 2022 added
Actions #4

Updated by Reid Linnemann about 2 years ago

  • Assignee set to Reid Linnemann

This is probably another case where the returned array can contain an element keyed 'error' that indicates some error encountered e.g. when calling the ioctl. This is a caveat of how the return value is used to return both values and error messages in some of the module funcs. I'll have a look and patch this up.

Actions #5

Updated by Reid Linnemann about 2 years ago

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

Updated by Jim Pingle about 2 years ago

  • Status changed from Feedback to Resolved

I loaded/edited/saved/applied a bunch of floating rules without error on the latest snapshot. Hard to say if it's solved 100% since it wasn't easy to consistently reproduce before, but it appears to be OK now.

If someone else hits it again we can reopen and revisit.

Actions

Also available in: Atom PDF