You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pfSense CE 2.8.1 + RESTAPI 2.6.5: dhcp static mapping creates empty <dhcpd><wan></wan> and causes crash on DNS Resolver Apply (related to #781) #787
On pfSense CE 2.8.1 with the KEA DHCP backend and pfSense-pkg-RESTAPI-2.6_5, calling the v2 dhcp_server/static_mapping endpoint for a non-WAN interface (e.g. opt1) introduces an empty element into config.xml.
When the DNS Resolver configuration is applied (either via the GUI or via /api/v2/services/dns_resolver/apply while KEA is enabled), pfSense crashes.
This looks like a remaining instance of the problem that was addressed in #781 (“DHCPServer model initializing config for non-static interfaces”) since the v2.6.5 release notes say:
“Fixes an issue where the DHCPServer model could unintentionally initialize a DHCP server configuration for non-static interfaces. #781”
To Reproduce
Start from a clean config with KEA enabled and no <dhcpd><wan> block.
Add static mapping with POST /api/v2/services/dhcp_server/static_mapping endpoint
Download config.xml
Apply static mapping with POST /api/v2/services/dhcp_server/apply
In dns server add host override with: /api/v2/services/dns_resolver/host_override
Apply new host override with /api/v2/services/dns_resolver/apply
Expected behavior
In the taken file in step 4. there should be no empty <dhcpd><wan></wan>
The new DHCP end DNS entries should be applied with no errors.
Actual behavior
Empty <dhcpd><wan></wan> is introduced in config.xml
pfsense crashes with this error:
PHP ERROR: Type: 1, File: /etc/inc/util.inc, Line: 3961, Message: Uncaught TypeError: array_get_path(): Argument #1 ($arr) must be of type array, string given, called in /usr/local/pfSense/include/www/services_dhcp.inc on line 162 and defined in /etc/inc/util.inc:3961
Stack trace:
#0 /usr/local/pfSense/include/www/services_dhcp.inc(162): array_get_path() #1 /etc/inc/system.inc(628): kea_earlydnsreg_mappings() #2 /etc/inc/system.inc(660): system_hosts_entries() #3 /etc/inc/services.inc(4983): system_hosts_generate() #4 /usr/local/www/services_unbound.php(88): services_unbound_configure() #5 {main}
thrown
pfSense Version & Package Version:
pfSense Version: [e.g. pfSense 2.8.1]
Package Version [e.g. v2.6_5]
Affected Endpoints:
/api/v2/services/dhcp_server/static_mapping
/api/v2/services/dns_resolver/apply
Additional context
I had to make this workaround to make thinks work:
I went to Services → DHCP Server → set WAN with a dummy range while keeping DHCP disabled , saved & applied
that fills <wan></wan> with content and avoids crash. But it's not clean...
Thanks for reporting. I'll see what more can be done within a patch release for this. There is already work being done for v2.7.0 to address this issue on a more fundamental level, but it requires some breaking changes which is why it can't be included in a simple patch.
In the meantime, your workaround is valid or a PATCH request to /api/v2/services/dhcp_server with the problematic interface value and enable set to false should serve the same purpose.
Activity
jaredhendrickson13 commentedon Nov 24, 2025
Thanks for reporting. I'll see what more can be done within a patch release for this. There is already work being done for v2.7.0 to address this issue on a more fundamental level, but it requires some breaking changes which is why it can't be included in a simple patch.
In the meantime, your workaround is valid or a PATCH request to /api/v2/services/dhcp_server with the problematic
interfacevalue andenableset tofalseshould serve the same purpose.fix(DHCPServer): ensure dhcp servers are initialized as assoc arrays #…
jaredhendrickson13 commentedon Nov 26, 2025
v2.6.6 includes a small change to avoid the crash in the meantime. Let me know if you still have issues.
v2.7.0 should be out in the next few weeks which will change the way the DHCP server endpoints work to better avoid issues like this in the future.