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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wonderfulShrineMaidenOfParadise opened this issue Nov 16, 2021 · 8 comments

Comments

@wonderfulShrineMaidenOfParadise
Copy link
Contributor

How to use GitHub

  • Please use the 馃憤 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Upgrade to 22.2.3 with Web UI or php -f updater/updater.phar
  2. php occ upgrade
  3. Workaround: nextcloud/server@710f7d6

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: nextcloud/server@710f7d6

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: nextcloud/server@710f7d6

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 wonderfulShrineMaidenOfParadise changed the title Upgrading: Symfony\Component\EventDispatcher\GenericEvent::getArgument() must be of the type string, int given Upgrading to 22.2.3: Symfony\Component\EventDispatcher\GenericEvent::getArgument() must be of the type string, int given Nov 16, 2021
@solracsf solracsf changed the title Upgrading to 22.2.3: Symfony\Component\EventDispatcher\GenericEvent::getArgument() must be of the type string, int given Symfony\Component\EventDispatcher\GenericEvent::getArgument() must be of the type string, int given Dec 30, 2021
@wonderfulShrineMaidenOfParadise
Copy link
Contributor Author

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

@wonderfulShrineMaidenOfParadise
Copy link
Contributor Author

Still happens on 22.2.6 and we know what happens next.

@tcitworld tcitworld transferred this issue from nextcloud/server Mar 23, 2022
@tcitworld
Copy link
Member

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 nextcloud/twofactor_webauthn#121 which is a similar issue. A way to fix this is scoping dependencies nextcloud/twofactor_webauthn#132

@marcelklehr
Copy link
Member

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
Copy link

ahcm commented Jul 26, 2022

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

@dbeniamine
Copy link

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

@nextcloud nextcloud locked as resolved and limited conversation to collaborators Jul 28, 2022
@marcelklehr
Copy link
Member

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

@marcelklehr
Copy link
Member

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.

@nextcloud nextcloud unlocked this conversation Jul 28, 2022
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

5 participants