Failed opening 'ransomware_protection/personal.php' for inclusion

I recently updated my NC 20.0.8 to NC 21.0.0, a few days later the ransomware protection app was updated.

My current setup is as follows:
Nextcloud version: 21.0.0
PHP: 8.0.2
Webserver: Apache 2.4.38
Database: MariaDB 10.3.27
Ransonware protection version: 1.9.0

However, this upgrade didn’t go without issues and right now I’m in the process of cleaning up my protocol step by step. Right now I’m struggling with the following phenomenon.

Opening or refreshing the settings page triggers the following couple of erros in my Nextcloud’s protocol:

The first error is this one:

Error: include(ransomware_protection/personal.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/legacy/OC_App.php#660

/var/www/nextcloud/lib/private/legacy/OC_App.php - line 660:

OC\Log\ErrorHandler::onError()

/var/www/nextcloud/lib/private/legacy/OC_App.php - line 660:

include()

/var/www/nextcloud/lib/private/Settings/Manager.php - line 258:

OC_App::getForms()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 116:

OC\Settings\Manager->getPersonalSections()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 64:

OCA\Settings\Controller\AdminSettingsController->formatPersonalSections()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 148:

OCA\Settings\Controller\AdminSettingsController->getNavigationParameters()

/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 218:

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

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 157:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 302:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 993:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 37:

OC::handleRequest()

Which is immediately followed up by this one:

Error: include(): Failed opening ‘ransomware_protection/personal.php’ for inclusion (include_path=’/var/www/nextcloud/apps/news/vendor/pear/net_url2:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Crypt_Blowfish:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Date:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Exception:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Idna:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_ListHeaders:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mail:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_ManageSieve:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Mime:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Nls:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Secret:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Smtp:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Socket_Client:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Stream:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Stream_Filter:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Stream_Wrapper:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Stringprep:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Support:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Text_Filter:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Text_Flowed:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Translation:/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Util:/var/www/nextcloud/3rdparty/pear/archive_tar:/var/www/nextcloud/3rdparty/pear/console_getopt:/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps’) at /var/www/nextcloud/lib/private/legacy/OC_App.php#660

/var/www/nextcloud/lib/private/legacy/OC_App.php - line 660:

OC\Log\ErrorHandler::onError()

/var/www/nextcloud/lib/private/legacy/OC_App.php - line 660:

include()

/var/www/nextcloud/lib/private/Settings/Manager.php - line 258:

OC_App::getForms()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 116:

OC\Settings\Manager->getPersonalSections()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 64:

OCA\Settings\Controller\AdminSettingsController->formatPersonalSections()

/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 148:

OCA\Settings\Controller\AdminSettingsController->getNavigationParameters()

/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 218:

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

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 157:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 302:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 993:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 37:

OC::handleRequest()

Now I didn’t analyze what the coding actually does here. But if I had to guess based on the protocol output, I’d say Nexcloud tries to load the various forms for the settings page and fails to do so when trying to load the ransomware protection form for the personal settings area.

What confuses me here is that I’m pretty sure that this is not the case as I can clearly see the form being successfully displayed:

grafik

Does anyone know what causes this confusing error message and how to fix this? I really want to get my protocol as clean as possible. I’m not exactly sure when the errors occured for the first time, but I think it was rather after updating the ransomware protection app than upgrading Nextcloud. I already removed and reinstalled the ransomware protection app but with no success in terms of the error messages in the protocol. I also switched back and forth between PHP 8.0 and 7.4 with no effect.

Hi, this is a small bug in the ransomware_protection app. There was an issue for that on Github:

There is a fix already, which you can find here:

So the next app update should solve this problem.

If you want to fix that for yourself manually already, you can edit the file
/var/www/nextcloud/apps/ransomware_protection/lib/AppInfo/Application.php

and comment the line in question:

	public function boot(IBootContext $context): void {
		Util::connectHook('OC_Filesystem', 'preSetup', $this, 'addStorageWrapper');
		/** \OCP\App::registerPersonal('ransomware_protection', 'personal'); */
		$context->injectFn(\Closure::fromCallable([$this, 'registerNotificationNotifier']));
	}

Thank you very much!