Project

General

Profile

Actions

Bug #16627

open

PHP error when saving without interfaces selected

Added by Holger Touby 3 days ago. Updated 1 day ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
mDNS Bridge
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:
All

Description

I am encountering a reproducible PHP Fatal Error in the web GUI when interacting with the mDNS Bridge package on the latest 25.11 Development Snapshot.

System Information:

Version: pfSense Plus 25.11-SNAPSHOT

OS: FreeBSD 16.0-CURRENT (amd64)

Build: plus-RELENG_25_11-n256500-a43915e7ef55 (Mon Dec 1 19:02:15 UTC 2025)

The Error: When attempting to configure/disable the mDNS Bridge, the GUI crashes with the following error:

[08-Jan-2026 22:41:59 Europe/Berlin] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/www/mdns-bridge.php:74
Stack trace:
#0 {main}
thrown in /usr/local/www/mdns-bridge.php on line 74
Context & Steps leading to the issue: Prior to this, I experienced severe instability with the Avahi package (Kernel Panics, HTTP 50x errors, complete console lockups requiring hard power cycles). The system even reverted to a previous 24.11 Boot Environment automatically.

To rule out filesystem corruption or hardware failure:

I replaced the internal storage with a fresh, hardware-compatible SSD.

Performed a clean install of the 25.11 Snapshot.

Applied standard system tunables (including increasing PHP memory limit to 2048MB).

After uninstalling Avahi and testing mDNS Bridge, the system stability improved significantly (no crashes). However, when I attempted to disable the mDNS Bridge service (as I was finishing my tests), the PHP error above was triggered immediately.

Analysis: It appears that mdns-bridge.php on line 74 is passing a null value to count(). Since PHP 8.x, count(null) throws a TypeError instead of a warning. This likely requires a check for is_array() or !empty() before counting the configuration array.


Files

error.report.txt (946 Bytes) error.report.txt Holger Touby, 01/08/2026 10:10 PM
clipboard-202601100959-cth3w.png (27.6 KB) clipboard-202601100959-cth3w.png Lev Prokofev, 01/10/2026 06:59 AM
Actions #1

Updated by Holger Touby 3 days ago

Subject: mdns-bridge: Unclean uninstallation blocks avahi execution; remediation via package re-installation fails due to PHP Fatal Error (Deadlock)

Description: Uninstalling the mdns-bridge package while the service is actively running (without prior manual deactivation) leaves the system in an inconsistent state that prevents the subsequent activation of the avahi daemon. This "phantom" active state persists across system reboots.

Critically, the standard administrative remediation workflow—reinstalling mdns-bridge to gracefully stop and disable the service—is obstructed by a separate issue. Upon re-installation, accessing the package configuration triggers a PHP Fatal Error (as detailed in a separate report), rendering the GUI inaccessible. This creates a deadlock scenario where the user cannot run avahi due to legacy conflicts, yet cannot access mdns-bridge to resolve those conflicts.

Steps to Reproduce:

Install the mdns-bridge package and enable the service (State: Running).

Uninstall the package via the Package Manager without manually stopping or disabling the service first.

Install the avahi package.

Attempt to enable/start the avahi service.

Result: The system reports a conflict, indicating mdns-bridge is still active/configured.

Attempted Remediation: Re-install mdns-bridge to regain control of the service state.

Navigate to Services > mdns-bridge to stop the daemon.

Observed Result:

Blocking State: The avahi service fails to start due to persistent configuration artifacts from the removed mdns-bridge package.

Remediation Failure: Upon re-installing mdns-bridge (Step 5/6), the system throws a PHP Fatal Error, crashing the interface. This prevents the administrator from stopping the service or clearing the configuration via the GUI.

His is ore was the Reason of the 1st Bug.

and i can Reproduce it i try it now 3 Times now i try deinstallin avahi 1st thene mDNS-bridge .

It work This way you have to leave your OPTIONS in the Deamon Config THENE DISABLE THE DEAMON. If you Empty the setup of the Deamon you get the php crash (Testet)

Actions #2

Updated by Jim Pingle 2 days ago

  • Project changed from pfSense Plus to pfSense Packages
  • Category changed from Web Interface to mDNS Bridge
  • Priority changed from High to Normal
  • Release Notes deleted (Default)
Actions #3

Updated by Marcos M 2 days ago

  • Subject changed from PHP Fatal Error (TypeError) in mdns-bridge.php:74 on 25.11-SNAPSHOT when disabling service to PHP error when saving without interfaces selected interfaces
  • Status changed from New to In Progress
  • Assignee set to Marcos M
  • Affected Plus Version deleted (25.11)
  • Affected Architecture All added
  • Affected Architecture deleted (6100)
Actions #4

Updated by Marcos M 2 days ago

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

Updated by Marcos M 1 day ago

  • Subject changed from PHP error when saving without interfaces selected interfaces to PHP error when saving without interfaces selected
Actions #6

Updated by Lev Prokofev 1 day ago

The patch appears to work, but the system patches package fails to fetch it, presumably because it is not a diff.

Actions

Also available in: Atom PDF