Hallo,
set Nextcloud 20 habe ich den kleinen Schonheitsfehler bei den Systeminfos das die Arbeisspeicher Auslastung und andere Werte nicht angezeigt werden.
Im Log habe ich immer folgenden Fehler.
Error: Invalid argument supplied for foreach() at /var/www/nextcloud/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#158
/var/www/nextcloud/apps/serverinfo/lib/OperatingSystems/DefaultOs.php - line 158:
OC\Log\ErrorHandler::onError()
/var/www/nextcloud/apps/serverinfo/lib/Os.php - line 132:
OCA\ServerInfo\OperatingSystems\DefaultOs->getNetworkInterfaces()
/var/www/nextcloud/apps/serverinfo/lib/Settings/AdminSettings.php - line 111:
OCA\ServerInfo\Os->getNetworkInterfaces()
/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 141:
OCA\ServerInfo\Settings\AdminSettings->getForm()
/var/www/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php - line 83:
OCA\Settings\Controller\AdminSettingsController->formatSettings()
/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 152:
OCA\Settings\Controller\AdminSettingsController->getSettings()
/var/www/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php - line 68:
OCA\Settings\Controller\AdminSettingsController->getIndexResponse()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:
OCA\Settings\Controller\AdminSettingsController->index()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:
OC\AppFramework\Http\Dispatcher->executeController()
/var/www/nextcloud/lib/private/AppFramework/App.php - line 152:
OC\AppFramework\Http\Dispatcher->dispatch()
/var/www/nextcloud/lib/private/Route/Router.php - line 308:
OC\AppFramework\App::main()
/var/www/nextcloud/lib/base.php - line 1008:
OC\Route\Router->match()
/var/www/nextcloud/index.php - line 37:
OC::handleRequest()
Hat jemand eine Idee wie ich das beheben kann?
Die betreffenden Zeilen in der DefaultOs.php ab Zeile 158 sehen so aus:
158 foreach ($interfaces as $interface) {
159 $iface = [];
160 $iface['interface'] = basename($interface);
161 $iface['mac'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "link/ether " | cut -d \' \' -f 6 | c>
162 $iface['ipv4'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "inet " | cut -d \' \' -f 6 | cut -f >
163 $iface['ipv6'] = shell_exec('ip -o -6 addr show ' . $iface['interface'] . ' | sed -e \'s/^.*inet6 \([^ ]\+\).*/\1/\'');
164 if ($iface['interface'] !== 'lo') {
165 $iface['status'] = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/operstate');
166 $iface['speed'] = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/speed');
167 if ($iface['speed'] !== '') {
168 $iface['speed'] = $iface['speed'] . 'Mbps';
169 } else {
170 $iface['speed'] = 'unknown';
171 }
172
173 $duplex = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/duplex');
174 if ($duplex !== '') {
175 $iface['duplex'] = 'Duplex: ' . $duplex;
176 } else {
177 $iface['duplex'] = '';
178 }
179 } else {
180 $iface['status'] = 'up';
181 $iface['speed'] = 'unknown';
182 $iface['duplex'] = '';
183 }
Ich denke es geht nicht wegen dem interface ‘lo’ dieses ist natürlich vorhanden, aber die eigentliche Schnittstelle ist enp2s0. Ein anpassen und Nginx, sowie PHP neu starten bringt auch nichts.
Mein System:
Ubuntu 20.04.3
Nginx
PHP 7.4
MysQL
32 GB RAM