nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.14k stars 3.94k forks source link

[Bug]: 3rdparty incompatible dependencies: stecman/symfony-console-completion and symfony/console #43930

Open marcelklehr opened 4 months ago

marcelklehr commented 4 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

PHP Fatal error: Declaration of Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand::mergeApplicationDefinition($mergeArgs = true) must be compatible with Symfony\Component\Console\Command\Command::mergeApplicationDefinition(bool $mergeArgs = true): void in /var/www/nextcloud/3rdparty/stecman/symfony-console-completion/src/CompletionCommand.php on line 57

Steps to reproduce

After upgrading to version 6.1.1 and updating Next cloud to 28.0.3, I receive a message in the admin panel about the need to download models (they were downloaded earlier and everything worked fine). When trying to run in /var/www/next cloud "sudo -u www-data php c recognize:download-models" I get the following message "PHP Fatal error: Declaration of Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand::mergeApplicationDefinition($mergeArgs = true) must be compatible with Symfony\Component\Console\Command\Command::mergeApplicationDefinition(bool $mergeArgs = true): void in /var/www/nextcloud/3rdparty/stecman/symfony-console-completion/src/CompletionCommand.php on line 57"

Expected behavior

Command gets executed as it should.

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

original issue: https://github.com/nextcloud/recognize/issues/1107

joshtrichards commented 4 months ago

Looks like we need to bump it since we're still on v0.11.0:

stecman/symfony-console-completion#95

joshtrichards commented 4 months ago

Though I think they're incorrect in the associated PR re: this only impacting Symfony 6.x, as we're on 5.x. Unfortunately they only fixed it in a version of stecman that isn't compatible with Symfony 5.x. I've asked if they can backport to a a 0.11.x release.

For what it's worth, I don't think this is new bug in v28.0.3. The Symfony 5.x code base has had defined this way for a LONG time. Our recent minor Symfony bump doesn't look like it introduced this.

ThibautPlg commented 2 months ago

Hello, I'm facing the exact same problem, however I have multiple Nextcloud 28 instances on the same server and only one of the two is impacted. The Nextcloud files are identical.

I came to the conclusion that an app caused the issue. Backup your database, note the enabled app, then disable them all.

update oc_appconfig set configvalue="no" where configkey ="enabled";

Enable each one from the interface while checking if the occ command is now working as expected every time.

On my side, it was an on-development app that caused the issue, so I can't really point you the faulty one on your side.

EDIT and follow-up: turns out it was a dev dependency that was shipped in the app (symfony/console > 6.0), more like an error from our side. Can still be a hint for your own case.

Regards,