Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #9602

Open
loddi opened this issue Apr 25, 2024 · 8 comments

Comments

@loddi
Copy link

loddi commented Apr 25, 2024

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

@PottiMc
Copy link

PottiMc commented Apr 26, 2024

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"
}
}

@ChristophWurst
Copy link
Member

can't tell where they are coming from

You have upgraded to PHP8: https://php.watch/versions/8.0/deprecate-required-param-after-optional

@ChristophWurst
Copy link
Member

It is unexpected to see this logged with level 3 (error). Deprecations should only show up at loglevel=0 (debug)

@PottiMc
Copy link

PottiMc commented Apr 26, 2024

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

@xkasprx
Copy link

xkasprx commented Apr 27, 2024

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.image

@joshtrichards
Copy link
Member

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

@PottiMc
Copy link

PottiMc commented May 2, 2024

So is there something I can do to get rid of these failures as a workaround?

@Sanookmakmak
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants