System Info Page failed with 504 timed out

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, 18.0.2): 17.0.5
Operating system and version (eg, Ubuntu 20.04): FreeNAS-11.3-U2
Apache or nginx version (eg, Apache 2.4.25): nginx-1.16.1
PHP version (eg, 7.1): PHP 7.1.33

The issue you are facing:

The system info page failed with 504 timed out error

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

Steps to replicate it:

  1. Login Nextcloud web interface with an admin account
  2. Click on the user icon on the upper left corner
  3. Click on Settings from the pull down menu
  4. Click on System on the left pane

The output of your Nextcloud log in Admin > Logging:

Error	PHP	A non-numeric value encountered at /usr/local/www/nextcloud/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#52 2020-04-21T18:04:10+0100

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

<?php
$CONFIG = array (
  'instanceid' => '***REMOVED-FOR-SECURITY***',
  'passwordsalt' => '***REMOVED-FOR-SECURITY***',
  'secret' => '***REMOVED-FOR-SECURITY***',
  'trusted_domains' => 
  array (
    0 => '***REMOVED-FOR-SECURITY***',
    1 => '***REMOVED-FOR-SECURITY***',
    2 => '***REMOVED-FOR-SECURITY***',
    3 => '***REMOVED-FOR-SECURITY***',
    4 => '***REMOVED-FOR-SECURITY***',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '17.0.5.0',
  'overwrite.cli.url' => '***REMOVED-FOR-SECURITY***',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'dbuser' => '***REMOVED-FOR-SECURITY***',
  'dbpassword' => '***REMOVED-FOR-SECURITY***',
  'installed' => true,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
    ),
  ),
  'maintenance' => false,
  'mysql.utf8mb4' => true,
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '***REMOVED-FOR-SECURITY***',
  'mail_domain' => '***REMOVED-FOR-SECURITY***',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '***REMOVED-FOR-SECURITY***',
  'mail_smtpport' => '***REMOVED-FOR-SECURITY***',
  'mail_smtpname' => '***REMOVED-FOR-SECURITY***',
  'mail_smtppassword' => '***REMOVED-FOR-SECURITY***',
  'memcache.local' => '\OC\Memcache\APCu',
);

The output of your Apache/nginx/system log in /var/log/____:
–access.log–

***REMOVED-FOR-SECURITY*** - ***REMOVED-FOR-SECURITY*** [21/Apr/2020:18:05:10 +0100] "GET /settings/admin/serverinfo HTTP/2.0" 504 562 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36" "-"rt=60.000 ut=60.001 cs=-

–error.log–

2020/04/21 18:05:10 [error] 19429#101714: *1676 upstream timed out (60: Operation timed out) while reading response header from upstream, client: ***REMOVED-FOR-SECURITY***, server: ***REMOVED-FOR-SECURITY***, request: "GET /settings/admin/serverinfo HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "***REMOVED-FOR-SECURITY***"

I have read the corresponding file “/usr/local/www/nextcloud/apps/serverinfo/lib/OperatingSystems/DefaultOs.php”. The problem seems to be an error on line 50.

        public function getMemory() {
                $memory = shell_exec('cat /proc/meminfo  | grep -i \'MemTotal\' | cut -f 2 -d ":" | awk \'{$1=$1}1\'');
                $memory = explode(' ', $memory);
                $memory = round($memory[0] / 1024);

/proc/meminfo does not exist on FreeBSD. An implementation on FreeBSD and derived OS should be:

        public function getMemory() {
                // Linux version
                // $memory = shell_exec('cat /proc/meminfo  | grep -i \'MemTotal\' | cut -f 2 -d ":" | awk \'{$1=$1}1\'');
                // FreeBSD version
                $memory = shell_exec('sysctl hw.physmem | cut -f 2 -d ":" | awk \'{$1=$1}1\'');
                $memory = explode(' ', $memory);
                $memory = round($memory[0] / 1024);

Great! It seems to be fixed on next release. :smiling_face_with_three_hearts: