September 15Sep 15 I ran into an issue where the Unraid WebGUI login page worked normally, but immediately after logging in, /Mainreturned:HTTP 500 Internal Server ErrorThis happened while a disk reconstruction was actively running, so rebooting, stopping the array, or restarting emhttpdwas not an acceptable troubleshooting option.Nginx itself was working, PHP-FPM was running, the PHP socket existed, and there was plenty of free RAM-filesystem space/inodes. Nginx's error log also wasn't showing anything useful when /Main failed.The breakthrough was checking PHP's actual error log:tail -f /var/log/phplogWhen I attempted to load /Main, it showed:PHP Fatal error: Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, false given in /usr/local/emhttp/plugins/dynamix/template.php:55Looking at that section of template.php showed:// Read network settings extract(parse_ini_file('state/network.ini',true));Checking the expected file:ls -l /usr/local/emhttp/state/network.inireturned:No such file or directoryHowever, searching for the runtime copy found it here:/var/local/emhttp/network.iniI initially restored that individual file:cp -a /var/local/emhttp/network.ini /usr/local/emhttp/state/network.iniThat got PHP past line 55, but /Main still returned HTTP 500. Checking /var/log/phplog again showed the next error:PHP Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /usr/local/emhttp/plugins/dynamix/template.php:59That line depended on another state file, state/var.ini. This established that the problem wasn't limited to network.ini: multiple runtime .ini files were missing from /usr/local/emhttp/state/.Final fixInstead of restoring them individually, I copied the existing runtime state INI files from /var/local/emhttp/ into the location Dynamix was expecting:cp -a /var/local/emhttp/*.ini /usr/local/emhttp/state/I then refreshed /Main.The Unraid WebGUI immediately started working normally again.Root causeThe immediate cause was missing runtime state files under:/usr/local/emhttp/state/Dynamix's template.php expected files such as:state/network.ini state/var.inibut they weren't present. Valid copies still existed under:/var/local/emhttp/Because parse_ini_file('state/network.ini', true) returned false, PHP 8 threw a fatal TypeError when Dynamix passed that result to extract(). After restoring network.ini, PHP progressed further and failed on the missing data normally supplied by var.ini.Copying the complete set of existing .ini runtime files resolved the GUI.Important noteThis is not the first time this has happened. It is usually when intense disk activity runs for an extended period such as a rebuild or disk to disk copy operation. While a reboot generally resolves it, I did not reboot Unraid, stop the array, restart emhttpd, restart PHP-FPM, or interrupt the disk reconstruction. The repair was performed while the reconstruction continued running.The remaining question is why /usr/local/emhttp/state/ lost these runtime state files in the first place. The fix restored the GUI, but the underlying event that caused those files to disappear still needs to be determined. nasvm-diagnostics-20260915-1922.zip
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.