mail
mail copied to clipboard
Optional parameter $knownIds declared before required parameter $partialOnly is implicitly treated as a required parameter at /config/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php#111
Steps to reproduce
After the update to nextcloud 29 I see this message a lot in the logs.
Expected behavior
no PHP error in the logs
Actual behavior
The following message is shown in the logs: "Optional parameter $knownIds declared before required parameter $partialOnly is implicitly treated as a required parameter at /config/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php#111"
Mail app version
3.6.0
Mailserver or service
selfhosted
Operating system
docker
PHP engine version
None
Web server
None
Database
None
Additional info
No response
I have the same error message in my logs with NC 28 and can't tell where they are coming from. It is a freshly new (1 week old) NC installation.
NC 28.0.4 PHP 8.1.2 Mail Version: 3.6.0
Detailed log entry:
{
{
"reqId": "XXX",
"level": 3,
"time": "2024-04-26T06:47:54+00:00",
"remoteAddr": "XXX",
"user": "XXX",
"app": "PHP",
"method": "GET",
"url": "/nextcloud/index.php/apps/mail/api/accounts/1/test",
"message": "Optional parameter $knownIds declared before required parameter $partialOnly is implicitly treated as a required parameter at /var/www/vhosts/XXX.de/httpdocs/nextcloud/apps/mail/lib/Service/Sync/SyncService.php#111",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
"version": "28.0.4.1",
"data": {
"app": "PHP"
},
"id": "662b51e197ac8"
}
}
can't tell where they are coming from
You have upgraded to PHP8: https://php.watch/versions/8.0/deprecate-required-param-after-optional
It is unexpected to see this logged with level 3 (error). Deprecations should only show up at loglevel=0 (debug)
can't tell where they are coming from
You have upgraded to PHP8: https://php.watch/versions/8.0/deprecate-required-param-after-optional
I did not upgrade. The AIO package for Plesk is coming with 8.1.2 and PHP7 is EOL since quite a time. Even 8.1. is deprecated already according to the system requirements.
https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html
I have the same issue. Been using php8.3 since I installed it but didn't see these errors till I upgrade to nc29 and mail updated to 3.6.0. Also these aren't coming in on the debug log, they are coming in as errors.
It is unexpected to see this logged with level 3 (error). Deprecations should only show up at loglevel=0 (debug)
I was curious what changed in our code that introduced this specifically in 3.6.0 and it was #9420 (somewhat ironically).
The deprecation changed to an error in PHP 8.1.0 so the two scenarios collided in 3.6.0:
As of PHP 8.0.0, but prior to PHP 8.1.0, the below emits a deprecation notice on the definition, but runs successfully when called. As of PHP 8.1.0, an error of class ArgumentCountError is thrown, as it would be when called with positional arguments.
https://www.php.net/manual/en/migration81.incompatible.php
So is there something I can do to get rid of these failures as a workaround?
I have it too on a fresh installed Nextcloud 29 on Debian 12 with PHP 8.3
Nextcloud Hub 8 (29.0.0) Mail App 3.6.0
Same here. fresh installed Nextcloud 29 on Ubuntu 22.04 with PHP 8.3 Nextcloud Hub 8 (29.0.0) Mail App 3.6.1
Same here as well.
Seeing the same error.
Fixed in #9526
(not yet released however)