serverinfo icon indicating copy to clipboard operation
serverinfo copied to clipboard

Usage of opcache_get_status() causes crash if function is disabled

Open Obererpel opened this issue 4 years ago • 0 comments

Steps to reproduce

  1. Log in as user
  2. Click Settings -> System

Expected behaviour

The System Monitor shows. Alternatively an error message indicates, that opcache_get_status() is disabled and therefore the System Monitor is not usable.

Actual behaviour

I get an internal server error. The following entries are found in the log:

[index] Error: Exception: Return value of OCA\ServerInfo\PhpStatistics::getOPcacheStatus() must be of the type array, null returned at <<closure>>

0. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/AppFramework/App.php line 152
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "index")
1. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/Route/Router.php line 308
   OC\AppFramework\App::main("OCA\\Settings\\ ... r", "index", OC\AppFramework\ ... {}, {section: "serve ... "})
2. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/base.php line 1008
   OC\Route\Router->match("/settings/admin/serverinfo")
3. /home/webpages/lima-city/#########/www/##.####.nextcloud/index.php line 37
   OC::handleRequest()

GET /index.php/settings/admin/serverinfo
from ###.###.###.### by user at 2021-01-13T21:06:00+00:00
[PHP] Error: Error: opcache_get_status() has been disabled for security reasons at /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/serverinfo/lib/PhpStatistics.php#83 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(2, "opcache_get_sta ... s", "/home/webpages/ ... p", 83, [])
 1. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/serverinfo/lib/PhpStatistics.php line 83
    opcache_get_status(false)
 2. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/serverinfo/lib/PhpStatistics.php line 50
    OCA\ServerInfo\PhpStatistics->getOPcacheStatus()
 3. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/serverinfo/lib/Settings/AdminSettings.php line 115
    OCA\ServerInfo\PhpStatistics->getPhpStatistics()
 4. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php line 141
    OCA\ServerInfo\Settings\AdminSettings->getForm()
 5. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/settings/lib/Controller/AdminSettingsController.php line 83
    OCA\Settings\Controller\AdminSettingsController->formatSettings([[OCA\ServerInfo ... ]])
 6. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php line 152
    OCA\Settings\Controller\AdminSettingsController->getSettings("serverinfo")
 7. /home/webpages/lima-city/#########/www/##.####.nextcloud/apps/settings/lib/Controller/AdminSettingsController.php line 68
    OCA\Settings\Controller\AdminSettingsController->getIndexResponse("admin", "serverinfo")
 8. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 169
    OCA\Settings\Controller\AdminSettingsController->index("serverinfo")
 9. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings\Con ... {}, "index")
10. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "index")
11. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/private/Route/Router.php line 308
    OC\AppFramework\App::main("OCA\\Settings\\ ... r", "index", OC\AppFramework\ ... {}, {section: "serve ... "})
12. /home/webpages/lima-city/#########/www/##.####.nextcloud/lib/base.php line 1008
    OC\Route\Router->match("/settings/admin/serverinfo")
13. /home/webpages/lima-city/#########/www/##.####.nextcloud/index.php line 37
    OC::handleRequest()

GET /index.php/settings/admin/serverinfo
from ###.###.###.### by user at 2021-01-13T21:06:00+00:00

Server configuration

Operating system: Linux 30adfd66817f 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 Shared Hoster at lima-city.de

Web server: Apache/2.4

Database: MySQL,

PHP version: 7.4.13 Zend OPcache v7.4.13 disable_functions | dl, syslog, opcache_get_status

Nextcloud version: (see Nextcloud admin page) Nextcloud 20.0.4.

Where did you install Nextcloud from: Nextcloud homepage, internal upgrader/updater

List of activated apps:

Enabled:

  • accessibility: 1.6.0
  • activity: 2.13.4
  • bruteforcesettings: 2.0.1
  • calendar: 2.1.3
  • cloud_federation_api: 1.3.0
  • contacts: 3.4.3
  • contactsinteraction: 1.1.0
  • dashboard: 7.0.0
  • dav: 1.16.2
  • federatedfilesharing: 1.10.2
  • federation: 1.10.1
  • files: 1.15.0
  • files_pdfviewer: 2.0.1
  • files_rightclick: 0.17.0
  • files_sharing: 1.12.1
  • files_trashbin: 1.10.1
  • files_versions: 1.13.0
  • files_videoplayer: 1.9.0
  • firstrunwizard: 2.9.0
  • geoblocker: 0.4.5
  • logreader: 2.5.0
  • lookup_server_connector: 1.8.0
  • nextcloud_announcements: 1.9.0
  • notifications: 2.8.0
  • oauth2: 1.8.0
  • password_policy: 1.10.1
  • photos: 1.2.1
  • privacy: 1.4.0
  • provisioning_api: 1.10.0
  • recommendations: 0.8.0
  • serverinfo: 1.10.0
  • settings: 1.2.0
  • systemtags: 1.10.0
  • text: 3.1.0
  • theming: 1.11.0
  • twofactor_backupcodes: 1.9.0
  • updatenotification: 1.10.0
  • user_status: 1.0.1
  • viewer: 1.4.0
  • weather_status: 1.0.0
  • workflowengine: 2.2.0 Disabled:
  • admin_audit
  • comments
  • encryption
  • files_external
  • files_markdown
  • sharebymail
  • support
  • survey_client
  • user_ldap

Nextcloud configuration:

{
    "system": { 
        "dbtype": "mysql",
        "version": "20.0.4.0",
        "mysql.utf8mb4": true,
        "installed": true,
        "updater.release.channel": "stable",
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
    }
}

Obererpel avatar Jan 13 '21 21:01 Obererpel