[Bug]: NC 24.0.8 - PHP8.1 : Return type of OCA\Files_Antivirus\Db\Rule::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed
FluffyUnicorn161 opened this issue · comments
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
The following error is displayed in my log:
Error: Return type of OCA\Files_Antivirus\Db\Rule::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/html/nextcloud/apps/files_antivirus/lib/Db/Rule.php#84
/var/www/html/nextcloud/apps/files_antivirus/lib/Db/Rule.php - line 27:
OC\Log\ErrorHandler::onError(8192, "Return type ... e", "/var/www/ht ... p", 84)
/var/www/html/nextcloud/lib/composer/composer/ClassLoader.php - line 571:
include("/var/www/ht ... p")
/var/www/html/nextcloud/lib/composer/composer/ClassLoader.php - line 428:
Composer\Autoload\includeFile("/var/www/ht ... p")
/var/www/html/nextcloud/apps/files_antivirus/lib/Db/RuleMapper.php - line 83:
Composer\Autoload\ClassLoader->loadClass("OCA\Files_ ... e")
/var/www/html/nextcloud/apps/files_antivirus/lib/Status.php - line 141:
OCA\Files_Antivirus\Db\RuleMapper->findAllMatchedByStatus(1)
/var/www/html/nextcloud/apps/files_antivirus/lib/Status.php - line 85:
OCA\Files_Antivirus\Status->getResponseRules()
/var/www/html/nextcloud/apps/files_antivirus/lib/Scanner/ExternalClam.php - line 72:
OCA\Files_Antivirus\Status->parseResponse("stream: OK\n")
/var/www/html/nextcloud/apps/files_antivirus/lib/Scanner/ScannerBase.php - line 108:
OCA\Files_Antivirus\Scanner\ExternalClam->shutdownScanner()
/var/www/html/nextcloud/apps/files_antivirus/lib/Controller/SettingsController.php - line 69:
OCA\Files_Antivirus\Scanner\ScannerBase->scanString("dummy scan content")
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:
OCA\Files_Antivirus\Controller\SettingsController->save("socket", "/var/run/cl ... k", "", 0, "", "/usr/bin/clamscan", "only_log", "26214400", -1)
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:
OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_An ... {}, "save")
/var/www/html/nextcloud/lib/private/AppFramework/App.php - line 172:
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_An ... {}, "save")
/var/www/html/nextcloud/lib/private/Route/Router.php - line 298:
OC\AppFramework\App::main("OCA\Files_ ... r", "save", OC\AppFramew ... {}, [ "files_ant ... "])
/var/www/html/nextcloud/lib/base.php - line 1030:
OC\Route\Router->match("/apps/files ... e")
/var/www/html/nextcloud/index.php - line 36:
OC::handleRequest()
Steps to reproduce
- Open the Log section in the NextCloud settings.
- Wait a few seconds.
Expected behavior
The error message should not occur.
Optimize the files, where JsonSerialize::jsonSerialize is used:
With the next update of PHP (8.1) the JsonSerialize::jsonSerialize method will now have this signature:
public function jsonSerialize(): mixed;
Installation method
None
Operating system
RHEL/CentOS
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "24.0.8.2",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"ldapIgnoreNamingRules": true,
"loglevel": 0,
"log_typer": "file",
"logfile": "\/var\/log\/nextcloud.log",
"theme": "",
"maintenance": false,
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"share_folder": "\/Shared",
"forcessl": true,
"secret": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "tls",
"overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"onlyoffice": {
"verify_peer_off": true
},
"mysql.utf8mb4": true,
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"password": "***REMOVED SENSITIVE VALUE***"
},
"encryption.legacy_format_support": false,
"encryption.key_storage_migrated": false,
"default_phone_region": "DE"
}
}
List of activated Apps
- accessibility: 1.10.0
- activity: 2.16.0
- admin_audit: 1.14.0
- approval: 1.0.10
- bruteforcesettings: 2.4.0
- calendar: 3.5.2
- cloud_federation_api: 1.7.0
- comments: 1.14.0
- contactsinteraction: 1.5.0
- dav: 1.22.0
- deck: 1.7.3
- extract: 1.3.5
- federatedfilesharing: 1.14.0
- federation: 1.14.0
- files: 1.19.0
- files_antivirus: 4.0.1
- files_external: 1.16.1
- files_pdfviewer: 2.5.0
- files_rightclick: 1.3.0
- files_sharing: 1.16.2
- files_trashbin: 1.14.0
- files_versions: 1.17.0
- files_videoplayer: 1.13.0
- firstrunwizard: 2.13.0
- forms: 2.5.1
- groupfolders: 12.0.2
- logreader: 2.9.0
- lookup_server_connector: 1.12.0
- nextcloud_announcements: 1.13.0
- notes: 4.5.1
- notifications: 2.12.1
- oauth2: 1.12.0
- password_policy: 1.14.0
- photos: 1.6.0
- polls: 3.8.3
- privacy: 1.8.0
- provisioning_api: 1.14.0
- recommendations: 1.3.0
- richdocuments: 6.3.2
- serverinfo: 1.14.0
- settings: 1.6.0
- sharebymail: 1.14.0
- spreed: 14.0.7
- support: 1.7.0
- survey_client: 1.12.0
- systemtags: 1.14.0
- tasks: 0.14.5
- text: 3.5.1
- theming: 1.15.0
- twofactor_backupcodes: 1.13.0
- updatenotification: 1.14.0
- user_ldap: 1.14.1
- user_status: 1.4.0
- viewer: 1.8.0
- weather_status: 1.4.0
- workflowengine: 2.6.0
Disabled:
- circles: 24.0.1
- dashboard: 7.0.0
- encryption: 2.8.1
- onlyoffice: 7.4.8
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
No response
Additional info
No response