-
posidron started following Uncaught ValueError: SplFileObject::seek()
-
Uncaught ValueError: SplFileObject::seek()
Hi, I upgraded to 7.0.0 and then 7.0.1 and noticed that since then pretty much regularily the list of my devices in the "Array Devices" section on Main page was not showing up. There are quite few similar reports for this issue here and on Reddit but the solution made no direct sense in my case and I believe that issue (while same result) was already fixed (nchan memory increase in Nginx). There was no console error in any browser (Brave, Edge, Safari) and Nginx also was not showing any suspicious output. However, `/var/log/phplog` was flooded with: [15-Mar-2025 20:02:21 America/Los_Angeles] PHP Fatal error: Uncaught ValueError: SplFileObject::seek(): Argument #1 ($line) must be greater than or equal to 0 in /usr/local/emhttp/plugins/dynamix/include/Helpers.php:207 Stack trace: #0 /usr/local/emhttp/plugins/dynamix/include/Helpers.php(207): SplFileObject->seek(-1) #1 /usr/local/emhttp/plugins/dynamix/include/Helpers.php(221): tail(Object(SplFileObject)) #2 /usr/local/emhttp/plugins/dynamix/nchan/update_2(377): last_parity_log() #3 {main} thrown in /usr/local/emhttp/plugins/dynamix/include/Helpers.php on line 207 ls -al /boot/config/parity-checks.log -rw------- 1 root root 0 Jan 5 17:10 /boot/config/parity-checks.log It's been a while since I did a parity check and usually when it starts I abort the process (I assume that's why it is 0 bytes?) Anyway when running: echo "" > /boot/config/parity-checks.log ls -al /boot/config/parity-checks.log -rw------- 1 root root 1 Mar 15 23:12 /boot/config/parity-checks.log We add a one byte which fulfills the above `seek(-1)` and when I then refresh the Main page, all devices are back. I did not have this issue in < 7 versions. Perhaps a possible patch? function tail($file, $rows=1) { if (!file_exists($file) || !is_readable($file)) { return ''; } if (filesize($file) === 0) { return ''; } $file = new SplFileObject($file); $file->seek(PHP_INT_MAX); $totalLines = $file->key(); if ($totalLines <= 0) { return ''; } $position = max(0, $totalLines - $rows); $file->seek($position); $echo = []; while (!$file->eof()) { $line = $file->current(); if ($line !== false) { $echo[] = $line; } $file->next(); } return implode($echo); }
-
nginx running out of shared memory
Hm, am receiving the same error messages and behavior. But in my case it seems, it may be caused by my Windows VM - which performs some heavy memory intensive operations. Given that I have assigned a max of 32Gb as memory out of my 128GB available, it seems like it triggers some leak in the VM / host (?), which consumes all of my host memory, which then leads to nginx not being able to allocate any further memory and ultimately crashes my entire Unraid. Well, a theory, it seems not everybody with the same issue is actually running a Windows VM but if my Windows VM is not running, all seems fine. VirtIO drivers is the last stable version and machine is Q35-7.2.
posidron
Members
-
Joined
-
Last visited