Php errors "A non-numeric value encountered at var /www/nextcloud/apps/serverinfo..." and "Error PHP Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#327"

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 18.0.1
Operating system and version (eg, Ubuntu 17.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): nginx/1.17.8
PHP version (eg, 7.1): PHP 7.4.3

The issue you are facing: In the adminstration settings: System -> Disk information for the first partition vda1 (swap) is wrong/empty but listed.
NextCloudPartitions

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Login as admin
  2. Settings
  3. System

The output of your Nextcloud log in Admin > Logging:
I think, Disk-related:

number_format() expects parameter 1 to be float, string given at /var/www/stemcloud/apps/serverinfo/templates/settings-admin.php#35
A non-numeric value encountered at /var/www/stemcloud/apps/serverinfo/templates/settings-admin.php#119	
A non-numeric value encountered at /var/www/stemcloud/apps/serverinfo/lib/Os.php#157
A non-numeric value encountered at /var/www/stemcloud/apps/serverinfo/lib/Os.php#158

I think, this error messages are triggert by a missleading interpretation of the first partition.

And there a continuously more errors reported like this:

Error	PHP	Trying to access array offset on value of type int at /var/www/stemcloud/lib/private/Files/Node/Node.php#327

And in nextcloud.log this causes following message:

{"reqId":"bFsAm91nr9iUTGwywOAN","level":3,"time":"2020-02-26T18:00:02+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#327","userAgent":"--","version":"18.0.1.3"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'hidden',
  'secret' => 'hidden',
  'trusted_domains' => 
  array (
    0 => 'my.domain.org',
  ),
  'datadirectory' => '/var/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '18.0.1.3',
  'overwrite.cli.url' => 'https://my.domain.org',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/var/run/mysqld/mysqld.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'hidden',
  'installed' => true,
  'instanceid' => 'hidden',
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' => 
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'logfile' => '/var/nextcloud_data/nextcloud.log',
  'loglevel' => 2,
  'logtimezone' => 'Europe/Berlin',
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'quota_include_external_storage' => false,
  'share_folder' => '/Shares',
  'skeletondirectory' => '',
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'admin',
  'mail_domain' => 'domain.org',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.domain.org',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'admin@domain.org',
  'mail_smtppassword' => 'hidden',
);

The output of your Apache/nginx/system log in /var/log/____:
No errors in nginx - error.log

<my-IP> - - [26/Feb/2020:18:01:07 +0100] "GET /apps/serverinfo/update HTTP/2.0" 200 287 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36"
<my-IP> - - [26/Feb/2020:18:01:07 +0100] "GET /ocs/v2.php/apps/serverinfo/api/v1//basicdata?format=json HTTP/2.0" 200 190 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36"

The function of my cloudserver seems not to be influenced by this error messages - but they’re annoying. Is there a way to stop them?
Thank you for reading


I’ve got same errors in mass in logfile too

In my case it could be the efi partition?!

The logs began to run crazy of these errors since i updated my cloud to 18.0.4.2 and combined it with php 7.4.5.
System is an ubuntu server 18.04.4

my error messages are
Error PHP Trying to access array offset on value of type int at /var/www/nextcloud/lib/private/Files/Node/Node.php#327

Since now i didn’t get errors when moving files or up- or downloading files to / from the cloudserver.
But as frank_bxl said - those errors are annoying and i have to append that they are flooding my logfiles.

So please give us a hint to solve that problem.

Please check the bug tracker of this app and add your reports if you can’t find any report:

You can also submit a pull request with a fix.

An issue on the Bug Tracker is open under