Solved: PHP error in Boot Environments
-
Two to three weeks ago I submitted:
I understand this is a random bug. Mine occurred when I attempted to create a fourth clone of my boot environment so I could go back to an earlier clone to wipe out attempted changes.
Is there a work around or update to remedy this fatal error.
It appears the only consequence is in creating, editing, deleting boot environments since what is normally a list of boot environments is propagated by the text of the message.
I can access the boot environments when rebooting under diagnostics in the drop down menu.[22-Mar-2024 13:26:31 America/Denver] PHP Fatal error: Uncaught ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements in /usr/local/pfSense/include/www/system_be.inc:418
Stack trace:
#0 /usr/local/pfSense/include/www/system_be.inc(418): array_combine(Array, Array)
#1 /usr/local/pfSense/include/www/system_be.inc(456): _zfs_get_properties(Array)
#2 /usr/local/www/system_be.php(79): be_bootenv_list()
#3 {main}
thrown in /usr/local/pfSense/include/www/system_be.inc on line 418
[22-Mar-2024 13:26:46 America/Denver] PHP Fatal error: Uncaught ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements in /usr/local/pfSense/include/www/system_be.inc:418
Stack trace:
#0 /usr/local/pfSense/include/www/system_be.inc(418): array_combine(Array, Array)
#1 /usr/local/pfSense/include/www/system_be.inc(456): _zfs_get_properties(Array)
#2 /usr/local/www/system_be.php(79): be_bootenv_list()
#3 {main}
thrown in /usr/local/pfSense/include/www/system_be.inc on line 4180
This was the answer which saved me:
https://forum.netgate.com/topic/180065/solved-php-error-in-boot-environments?_=1712608736510
Not real clear for desperate people; proceed to diagnostic - command prompt. Type in "bectl list" in "execute shell command box" and press the "execute" button; what should happen is the current list of Boot Environments should appear. In my case and the solution at the above link is to use the "bectl destroy" command to destroy the last entry that generated the crash report. I copied and pasted the last entry from the above generated list, but only include the name - up to the colon not the size and date after the colon, then again press the "execute" button, reenter "bectl list" and "execute" to confirm it worked (The last entry should be no longer listed. Go back to the dashboard - system - boot environments and it should appear normal. -
Did you actually open a bug for that?
There's a good chance it's fixed though in which case it will be in the RC which should be very close.
Steve
-
@stephenw10
When I began my preliminary investigation (duckduckgo search) the results lead me to a bug "PHP Fatal error: Uncaught ValueError" being worked on in freeBSD and the claim was it was random - as in really difficult to duplicate. The report on the progress did not show it as closed.Currently I am on 23.09.1, FreeBSD 14.0-CURRENT which I believe is the latest stable.
Not so concerned about whether it is fixed, but if it occurs again how to fix it again.
Also the solution I found was from 2023, so I assume it is known. -
Ah, Ok I see. So it somehow created a BE with an invalid name. Or in someway unreadable in the gui.
Do you have the output from
bectl list
? -
@stephenw10
I have the current list after the repair, not the corrupted list.
I do a lot of editing on the names and descriptions to be specific about where in the timeline each Boot Environment sets. If I have inserted incorrect characters in the names usually it will not allow the save. I don't see how the description would play a part since the description - my limited understanding allows all characters. -
Yes the input error checking should prevent that. So more likely it was upgraded or cloned, or something else that creates a new BE name automatically, and that somehow created an invalid name.
-
@stephenw10
So, thinking about this, and the bug report for freebsd, might the problem be not recognizing the name as proper but still counting it as another Boot Environment which then throws off the bug. There is a mismatch between what is the true number of Boot Environments and the refusal to recognize the name. All "bectl destroy" does is correct the number. -
You have a link to the FreeBSD bug?
Uncaught ValueError
could be almost anything. -
@stephenw10
I will attempt to find.