Project

General

Profile

Actions

Regression #13983

closed

Multiple PHP errors in the DHCP Server when the configuration contains an empty section for an interface

Added by Car F almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
DHCP (IPv4)
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

Seeing multiple pfSense 23.01 users having these PHP fatal error crashes. I got it in the DHCP Server tab by simply clicking the "save" button.

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/system.inc:422
Stack trace:
#0 /etc/inc/system.inc(520): system_hosts_dhcpd_entries()
#1 /etc/inc/system.inc(551): system_hosts_entries(Array)
#2 /etc/inc/services.inc(2772): system_hosts_generate()
#3 /usr/local/www/services_dhcp.php(788): services_unbound_configure()
#4 {main}
thrown in /etc/inc/system.inc on line 422

After that system is unresponsive with no connection. Rebooting via console works but while bootup more PHP errors (with the same "Cannot access offset of type string on string in" message) and the system fails to start. Only reverting config does help.

This issue happens with multiple clean installs on a Netgate 6100 MAX.


Files

PHP_errors.log (2.85 KB) PHP_errors.log aleksei prokofiev, 02/26/2023 05:28 AM
Actions #1

Updated by Marcos M almost 2 years ago

  • Tracker changed from Bug to Regression
  • Subject changed from PHP Fatal Error to PHP error with DHCP Server
  • Description updated (diff)
  • Category changed from FreeBSD to DHCP Server (IPv4)
  • Priority changed from High to Normal
  • Affected Architecture deleted (6100)

Additional report:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/services_dhcp.php:140
Stack trace:
#0 {main}
thrown in /usr/local/www/services_dhcp.php on line 140

Actions #2

Updated by Marcos M almost 2 years ago

  • Project changed from pfSense Plus to pfSense
  • Category changed from DHCP Server (IPv4) to DHCP (IPv4)
  • Affected Plus Version deleted (23.01)
  • Affected Version set to 2.7.0

Additional report:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/services.inc:542
Stack trace:
#0 /etc/inc/services.inc(483): services_dhcpdv4_configure()
#1 /etc/rc.bootup(371): services_dhcpd_configure()
#2 {main}
thrown in /etc/inc/services.inc on line 542

After saving LAN interface config on the same system:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/services.inc:542
Stack trace: #0 /etc/inc/services.inc(483): services_dhcpdv4_configure()
#1 /etc/inc/interfaces.inc(7492): services_dhcpd_configure()
#2 /usr/local/www/interfaces.php(483): restart_interface_services('lan', NULL)
#3 {main}
thrown in /etc/inc/services.inc on line 542

After saving the DHCP Server config:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/services_dhcp.php:140
Stack trace:
#0 {main}
thrown in /usr/local/www/services_dhcp.php on line 140

Actions #3

Updated by Marcos M almost 2 years ago

Additional report:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/services.inc:1659
Stack trace:
#0 /etc/inc/services.inc(486): services_dhcpdv6_configure(Array)
#1 /etc/rc.bootup(371): services_dhcpd_configure()
#2 {main}
  thrown in /etc/inc/services.inc on line 1659

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/services.inc:62
Stack trace:
#0 /etc/inc/service-utils.inc(705): services_radvd_configure()
#1 /usr/local/www/status_services.php(46): service_control_start('radvd', Array)
#2 {main}
  thrown in /etc/inc/services.inc on line 62

Actions #4

Updated by Jim Pingle over 1 year ago

  • Assignee set to Jim Pingle
  • Target version set to 2.7.0
  • Plus Target Version set to 23.05
Actions #5

Updated by aleksei prokofiev over 1 year ago

Another one report but from xg-7100-1U

Actions #6

Updated by Jim Pingle over 1 year ago

  • Status changed from New to In Progress

Looks like most (or all?) of these are from having an empty interface config in DHCP settings, e.g.

    <dhcpd>
        [...]
        <opt1></opt1>
    </dhcpd>

I'm working on fixes but in the meantime, editing those bad items out of the config would solve it locally.

Actions #7

Updated by Jim Pingle over 1 year ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #8

Updated by Christopher Cope over 1 year ago

  • Status changed from Feedback to Resolved

Tested on

23.05-DEVELOPMENT (amd64)
built on Wed Mar 15 06:04:38 UTC 2023
FreeBSD 14.0-CURRENT
Working as expected. Marking resolved.

Actions #9

Updated by Jim Pingle over 1 year ago

  • Subject changed from PHP error with DHCP Server to Multiple PHP errors in the DHCP Server when the configuration contains an empty section for an interface

Updating subject for release notes.

Actions

Also available in: Atom PDF