Error in log when requesting system info on Freebsd

Nextcloud version (eg, 18.0.2): 20.0.5
Operating system and version (eg, Ubuntu 20.04): FreeBSD 12.2 RELEASE-p1
Apache or nginx version (eg, Apache 2.4.25): Hiawatha 10.11
PHP version (eg, 7.1): PHP 7.4.14

Extra info: system has two network interfaces.

The issue you are facing: error in log when requesting ‘system info’

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

Steps to replicate it: l

  1. go to admin pane
  2. and request ‘sytem info’
  3. visit logs

The output of your Nextcloud log in Admin > Logging:

Error PHP Error: Undefined offset: 0 at /usr/local/www/owncloud/apps/serverinfo/lib/OperatingSystems/FreeBSD.php#187

/usr/local/www/owncloud/apps/serverinfo/lib/OperatingSystems/FreeBSD.php - line 187:

OC\Log\ErrorHandler::onError(8, "Undefined offset: 0", "/usr/local/ ... p", 187, { 0: "And 7 ... }})

/usr/local/www/owncloud/apps/serverinfo/lib/Os.php - line 132:

OCA\ServerInfo\OperatingSystems\FreeBSD->getNetworkInterfaces()

/usr/local/www/owncloud/apps/serverinfo/lib/Settings/AdminSettings.php - line 111:

OCA\ServerInfo\Os->getNetworkInterfaces()

/usr/local/www/owncloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 141:

OCA\ServerInfo\Settings\AdminSettings->getForm()

/usr/local/www/owncloud/apps/settings/lib/Controller/AdminSettingsController.php - line 83:

OCA\Settings\Controller\AdminSettingsController->formatSettings([ [ OCA\Serv ... ]])

/usr/local/www/owncloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 152:

OCA\Settings\Controller\AdminSettingsController->getSettings("serverinfo")

/usr/local/www/owncloud/apps/settings/lib/Controller/AdminSettingsController.php - line 68:

OCA\Settings\Controller\AdminSettingsController->getIndexResponse("admin", "serverinfo")

/usr/local/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:

OCA\Settings\Controller\AdminSettingsController->index("serverinfo")

/usr/local/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:

OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "index")

/usr/local/www/owncloud/lib/private/AppFramework/App.php - line 152:

OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "index")

/usr/local/www/owncloud/lib/private/Route/Router.php - line 309:

OC\AppFramework\App::main("OCA\\Settin ... r", "index", OC\AppFramew ... {}, { section: " ... "})

/usr/local/www/owncloud/lib/base.php - line 1008:

OC\Route\Router->match("/settings/admin/serverinfo")

/usr/local/www/owncloud/index.php - line 37:

OC::handleRequest()

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

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'trusted_domains' =>
  array (
    0 => 'cloud.bospaling.nl',
  ),
  'debug' => false,
  'log_type' => 'file',
  'datadirectory' => '/usr/local/www/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  'installed' => true,
  'check_for_working_webdav' => false,
  'loglevel' => 2,
  'theme' => '',
  'maintenance' => false,
  'secret' => '',
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'bospaling.nl',
  'forcessl' => true,
  'mail_smtpsecure' => 'tls',
  'trashbin_retention_obligation' => 'auto',
  'appstoreenabled' => true,
  'appstore.experimental.enabled' => true,
  'enable_avatars' => false,
  'updatechecker' => true,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'bospaling.nl',
  'mail_smtpport' => '25',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'overwrite.cli.url' => 'https://cloud.bospaling.nl',
  'dbname' => 'owncloud',
  'dbhost' => '127.0.0.1',
  'dbuser' => '',
  'dbpassword' => '',
  'updater.release.channel' => 'stable',
  'mysql.utf8mb4' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
    1 => 'admin_notifications',
    2 => 'contacts',
  ),
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'defaultapp' => 'files',
  'redis' =>
  array (
    'host' => '/tmp/redis.sock',
    'port' => 0,
    'timeout' => 1.5,
  ),
);

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

PASTE HERE

i have same error, still the FreeBSD and network interface “unknown” issue,

Nextcloud 20.0.6 still has it.

Can you check the output of:

ifconfig | grep base

It parses the output of ifconfig, in my case it gives something like:

media: Ethernet 10Gbase-T <full-duplex>

and the regular expression in (line 183)

extracts the 10G from this string. And there something is not working for you, because $speed is no array. Either it is not present in the ifconfig command or php doesn’t get the output. The code should certainly be more error tolerant.

Please submit a bug report here: Issues · nextcloud/serverinfo · GitHub

On my FreeBSD setup it is working.

2 interfaces, 2 output lines:

ifconfig|grep base
media: Ethernet autoselect (1000baseT )
media: Ethernet autoselect (1000baseT )

I will submit a github bugreport later today. Don’t have the login here. (27 jan 2021: done)

I have the same problem with 20.06 on Freebsd as well.

root@Nextcloud:~ # ifconfig|grep base
media: Ethernet autoselect (1000baseT )
media: Ethernet autoselect (1000baseT )
root@Nextcloud:~ #

root@Nextcloud:~ # ifconfig | grep media:
media: Ethernet autoselect
media: Ethernet autoselect (1000baseT )
media: Ethernet autoselect
media: Ethernet autoselect
media: Ethernet autoselect (1000baseT )
media: Ethernet autoselect

here is GUI :

Then everything looks good, for those where the speed is not defined, there is “unknown” put in place.

there is still a problem. I manually change the interface
root@nas[/etc]# ifconfig bce2 media 1000baseT mediaopt full-duplex
root@nas[/etc]# ifconfig bce3 media 1000baseT mediaopt full-duplex
root@nas[/etc]# ifconfig bce3 media 1000baseT mediaopt full-duplex

then these 3 interfaces errors are gone from logs ( use to have 6 error msg, after changes, seems only 3)

will the “autoselect” causing the problem?
root@nas[/etc]# ifconfig | grep media
media: Ethernet 1000baseT
media: Ethernet autoselect (1000baseT )
media: Ethernet 1000baseT
media: Ethernet 1000baseT
media: Ethernet autoselect (1000baseT )
media: Ethernet autoselect

What you are referring to is not the problem in this ticket. I have an error in the system log. The interface speed is correctly displayed.

re0

Status: active
Speed: 1000 Mbps Duplex: full
MAC: 18:c0:4d:46:76:67
IPv4: 192.168.2.3
IPv6:

em0

Status: active
Speed: 1000 Mbps Duplex: full
MAC: 00:1b:21:c8:3f:9e
IPv4: 192.168.0.1 192.168.54.2
IPv6:

Bug report submitted: Parsing ifconfig output for system info in FreeBSD gives error · Issue #270 · nextcloud/serverinfo · GitHub