nextcloud / bookmarks

đź”– Bookmark app for Nextcloud
https://apps.nextcloud.com/apps/bookmarks
GNU Affero General Public License v3.0
1.01k stars 173 forks source link

`Symfony\Component\EventDispatcher\GenericEvent::getArgument()` must be of the type string, int given #1770

Closed wonderfulShrineMaidenOfParadise closed 2 years ago

wonderfulShrineMaidenOfParadise commented 2 years ago

How to use GitHub

Steps to reproduce

  1. Upgrade to 22.2.3 with Web UI or php -f updater/updater.phar
  2. php occ upgrade
  3. Workaround: https://github.com/nextcloud/server/commit/710f7d629469e91df76ff3dae998ac3ce18e9c15

Another attempt of upgrading:

  1. Upgrade to 22.2.5 with Web UI or php -f updater/updater.phar
  2. php occ upgrade
  3. Workaround: https://github.com/nextcloud/server/commit/710f7d629469e91df76ff3dae998ac3ce18e9c15

Yet another attempt of upgrading:

  1. Upgrade to 22.2.6 with Web UI or php -f updater/updater.phar
  2. php occ upgrade
  3. Workaround: https://github.com/nextcloud/server/commit/710f7d629469e91df76ff3dae998ac3ce18e9c15

Expected behaviour

Upgrading and migration work without errors.

Actual behaviour

PHP type error.

Server configuration

Operating system:

postmarketOS 21.06 / Alpine 3.14 postmarketOS 21.12 / Alpine 3.15

Web server:

nginx

Database:

mariadb

PHP version:

php 7.4.25 php 7.4.27 php 7.4.28

Nextcloud version: (see Nextcloud admin page)

22.2.2.0 -> 22.2.3.0 22.2.3.0 -> 22.2.5.1 22.2.5.1 -> 22.2.6.2

Updated from an older Nextcloud/ownCloud or fresh install:

Updated from 22.2.2.0 to 22.2.3.0 Updated from 22.2.3.0 to 22.2.5.1 Updated from 22.2.5.1 to 22.2.6.2

Where did you install Nextcloud from: Official archive / php -f updater/updater.php

Signing status:

(Unavailable)

List of activated apps:

(Skipped)

Nextcloud configuration:

(Skipped)

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

PHP outputs

Browser log ``` postmarketos-msm8916:/var/www/localhost/htdocs/nextcloud$ sudo -u nextcloud php occ upgrade Nextcloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade Setting log level to debug An unhandled exception has been thrown: TypeError: Argument 1 passed to Symfony\Component\EventDispatcher\GenericEvent::getArgument() must be of the type string, int given, called in /var/www/localhost/htdocs/nextcloud/lib/private/EventDispatcher/GenericEventWrapper.php on line 83 and defined in /var/www/localhost/htdocs/nextcloud/apps/bookmarks/vendor/symfony/event-dispatcher/GenericEvent.php:57 Stack trace: #0 /var/www/localhost/htdocs/nextcloud/lib/private/EventDispatcher/GenericEventWrapper.php(83): Symfony\Component\EventDispatcher\GenericEvent->getArgument() nextcloud/server#1 /var/www/localhost/htdocs/nextcloud/lib/private/Updater.php(513): OC\EventDispatcher\GenericEventWrapper->getArgument() nextcloud/server#2 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(251): OC\Updater->OC\{closure}() nextcloud/server#3 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners() nextcloud/server#4 /var/www/localhost/htdocs/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(123): Symfony\Component\EventDispatcher\EventDispatcher->dispatch() nextcloud/server#5 /var/www/localhost/htdocs/nextcloud/lib/private/Repair.php(258): OC\EventDispatcher\SymfonyAdapter->dispatch() nextcloud/server#6 /var/www/localhost/htdocs/nextcloud/lib/private/Repair.php(122): OC\Repair->emit() nextcloud/server#7 /var/www/localhost/htdocs/nextcloud/lib/private/Updater.php(251): OC\Repair->run() nextcloud/server#8 /var/www/localhost/htdocs/nextcloud/lib/private/Updater.php(132): OC\Updater->doUpgrade() nextcloud/server#9 /var/www/localhost/htdocs/nextcloud/core/Command/Upgrade.php(235): OC\Updater->upgrade() nextcloud/server#10 /var/www/localhost/htdocs/nextcloud/apps/bookmarks/vendor/symfony/console/Command/Command.php(299): OC\Core\Command\Upgrade->execute() nextcloud/server#11 /var/www/localhost/htdocs/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run() nextcloud/server#12 /var/www/localhost/htdocs/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(295): Symfony\Component\Console\Application->doRunCommand() nextcloud/server#13 /var/www/localhost/htdocs/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun() nextcloud/server#14 /var/www/localhost/htdocs/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run() nextcloud/server#15 /var/www/localhost/htdocs/nextcloud/console.php(99): OC\Console\Application->run() nextcloud/server#16 /var/www/localhost/htdocs/nextcloud/occ(11): require_once('/var/www/localh...') nextcloud/server#17 {main}server1-postmarketos-msm8916:/var/www/localhost/htdocs/nextcloud$ sudo nano /var/www/localhost/htdocs/nextcloud/lib/private/EventDispatcher/GenericEventWrapper.php ```
wonderfulShrineMaidenOfParadise commented 2 years ago

Still happens on 22.2.5. And temporarily solved with the same workaround.

wonderfulShrineMaidenOfParadise commented 2 years ago

Still happens on 22.2.6 and we know what happens next.

tcitworld commented 2 years ago

This is because the bookmarks app brings symfony/console through php-cs-fixer and psalm, and then that brings a different incompatible version of the symfony EventDispatcher component.

If you don't need development dependencies, you can use composer install --no-dev next time.

For Bookmarks devs: See https://github.com/nextcloud/twofactor_webauthn/issues/121 which is a similar issue. A way to fix this is scoping dependencies https://github.com/nextcloud/twofactor_webauthn/pull/132

marcelklehr commented 2 years ago

composer install --no-dev is used by default in Makefile and the latest release does not come with either symfony/console nor symfony/event-dispatcher.

ahcm commented 2 years ago

I just applied the fix of the OP to an upgrade from 24.0.2 to 24.0.3.

dbeniamine commented 2 years ago

I had to use this fix to upgrade from 23.0.7 to 24.0.3

marcelklehr commented 2 years ago

Please refrain from commenting here, as this turned out not to be a bookmarks app issue.

marcelklehr commented 2 years ago

If this is still an issue, please open a new issue on the server repository. The issue occurs when an app depends on a dependency of Symfony's event dispatcher that is too new. The responsible app can be inferred from the stack trace of the error, usually.