Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Uncaught ValueError: SplFileObject::seek()

  • Minor

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);
}

 

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.