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

PHP Fatal error: causes update from 18.0.7 to 18.0.8 to fail #317

Closed
HaleyACS opened this issue Aug 31, 2020 · 26 comments · Fixed by #319
Closed

PHP Fatal error: causes update from 18.0.7 to 18.0.8 to fail #317

HaleyACS opened this issue Aug 31, 2020 · 26 comments · Fixed by #319

Comments

@HaleyACS
Copy link

Nextcloud system becomes unusable:

A occ -h returns:
cf394fd77aca:/var/www/html$ occ -h -sh: occ: not found cf394fd77aca:/var/www/html$ ./occ -h PHP Fatal error: Declaration of Symfony\Component\Console\Input\ArrayInput::hasParameterOption($values, bool $onlyParams = false) must be compatible with Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in /var/www/html/custom_apps/suspicious_login/vendor/symfony/console/Input/ArrayInput.php on line 202
Data log shows:
{"reqId":"UU9bPOOz4PvChBABRmpU","level":3,"time":"2020-08-31 17:35:21","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Declaration of Symfony\\Component\\Console\\Input\\ArrayInput::hasParamet erOption($values, bool $onlyParams = false) must be compatible with Symfony\\Component\\Console\\Input\\InputInterface::hasParameterOption($values, $onlyParams = false) at /var/www/html/custom_apps/suspicious_login/ven dor/symfony/console/Input/ArrayInput.php#202","userAgent":"--","version":"18.0.8.2"}
Going into the docker-session, one can disable the app with:
cf394fd77aca:/var/www/html$ ./occ app:disable suspicious_login suspicious_login disabled

@ChristophWurst
Copy link
Member

Hmmmm. Smells like a conflict with another app. Could you disable all optional apps, then try again? If that works re-enable the now disabled apps step by step and always retry occ, as soon as it breaks we know the conflicting app.

@mhbates
Copy link

mhbates commented Aug 31, 2020

I had the same issue and just solved it by disabling Suspicious Login via occ. I didn't test to see if it was a specific app conflict, but I know that most optional apps were already disabled at that point.

@jakeh999
Copy link

jakeh999 commented Aug 31, 2020

I also have this issue. Version 3.2 seems to completely break Nextcloud 18. Shown in the log: "Argument 1 passed to "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given."

Reverting to version 3.1 fixes it.

@Chillstice
Copy link

Here to report that I also had this issue after the latest update to suspicous_login. @mhbates suggestion to disable it via occ worked.

@toxiclung
Copy link

+1
back online after disabled

@ChristophWurst
Copy link
Member

Okay, so here's the deal: if nobody helps locate the conflict, we won't be able to fix the bug.

@HaleyACS
Copy link
Author

HaleyACS commented Sep 1, 2020

Disabled everything that I can disable - still not working, same issue. Note that I checked the log and nextcloud after each disabled app.
I can't play around too much, as this system is in production and classes start today in france.
`
var/www/html # ./occ app:list
Enabled:

  • cloud_federation_api: 1.1.0
  • dav: 1.14.0
  • federatedfilesharing: 1.8.0
  • federation: 1.8.0
  • files: 1.13.1
  • lookup_server_connector: 1.6.0
  • oauth2: 1.6.0
  • provisioning_api: 1.8.0
  • settings: 1.0.0
  • suspicious_login: 3.2.0
  • twofactor_backupcodes: 1.7.0
  • user_external: 0.10.0
  • viewer: 1.2.0
  • workflowengine: 2.0.0
    Disabled:
  • accessibility
  • activity
  • admin_audit
  • calendar
  • circles
  • comments
  • contacts
  • encryption
  • files_external
  • files_pdfviewer
  • files_rightclick
  • files_sharing
  • files_trashbin
  • files_versions
  • files_videoplayer
  • firstrunwizard
  • geoblocker
  • logreader
  • nextcloud_announcements
  • notes
  • notifications
  • password_policy
  • photos
  • privacy
  • quota_warning
  • recommendations
  • serverinfo
  • sharebymail
  • socialsharing_email
  • spreed
  • support
  • survey_client
  • systemtags
  • tasks
  • text
  • theming
  • updatenotification
  • user_ldap
    `

@Coffeeri
Copy link

Coffeeri commented Sep 1, 2020

I also had a conflict with the following error-message:

> sudo -u www-data php occ log:tail

PHP Fatal error: Declaration of Symfony\Component\Console\Style\OutputStyle::write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) must be compatible with Symfony\Component\Console\Output\OutputInterface::write($messages, $newline = false, $options = 0) in /var/www/nextcloud/apps/suspicious_login/vendor/symfony/console/Style/OutputStyle.php on line 52

I disabled the app via occ for now.

My enabled apps:

  • accessibility: 1.4.0
  • activity: 2.11.0
  • admin_audit: 1.8.0
  • analytics: 2.4.1
  • audioplayer: 2.11.2
  • audioplayer_editor: 0.2.2
  • audioplayer_sonos: 1.1.1
  • calendar: 2.0.4
  • camerarawpreviews: 0.7.8
  • checksum: 0.4.5
  • cloud_federation_api: 1.1.0
  • comments: 1.8.0
  • contacts: 3.3.0
  • dav: 1.14.0
  • deck: 1.0.5
  • extract: 1.2.4
  • federatedfilesharing: 1.8.0
  • federation: 1.8.0
  • files: 1.13.1
  • files_accesscontrol: 1.8.1
  • files_automatedtagging: 1.8.3
  • files_external: 1.9.0
  • files_markdown: 2.3.0
  • files_pdfviewer: 1.7.0
  • files_rightclick: 0.15.2
  • files_sharing: 1.10.1
  • files_trashbin: 1.8.0
  • files_versions: 1.11.0
  • files_videoplayer: 1.7.0
  • firstrunwizard: 2.7.0
  • groupfolders: 6.0.7
  • logreader: 2.3.0
  • lookup_server_connector: 1.6.0
  • mail: 1.4.1
  • maps: 0.1.6
  • news: 14.2.1
  • nextcloud_announcements: 1.7.0
  • notifications: 2.6.0
  • oauth2: 1.6.0
  • ocr: 6.0.55
  • onlyoffice: 4.3.0
  • password_policy: 1.8.0
  • photos: 1.0.0
  • privacy: 1.2.0
  • provisioning_api: 1.8.0
  • recommendations: 0.6.0
  • serverinfo: 1.8.0
  • settings: 1.0.0
  • sharebymail: 1.8.0
  • spreed: 8.0.10
  • support: 1.1.1
  • survey_client: 1.6.0
  • systemtags: 1.8.0
  • text: 2.0.0
  • theming: 1.9.0
  • twofactor_backupcodes: 1.7.0
  • twofactor_totp: 5.0.0
  • twofactor_u2f: 6.0.0
  • updatenotification: 1.8.0
  • user_ldap: 1.8.0
  • user_saml: 3.1.2
  • viewer: 1.2.0
  • workflow_pdf_converter: 1.3.2
  • workflow_script: 1.3.2
  • workflowengine: 2.0.0

@grimSBZ
Copy link

grimSBZ commented Sep 1, 2020

I am trying to give a full bug report here.
environment

  • OS: Debian 10
  • phpversion(): 7.3.19-1~deb10u1
  • nginx vesion: 1.14.2-2+deb10u3
  • mariadb version: 1:10.3.23-0+deb10u1

steps to reproduce

  • download and extracted nextcloud 18.0.8 from https://nextcloud.com/changelog/#latest18
  • installed into a clean database - settings left to default in web installer including apps
  • started occ log:watch
  • logged in, downloaded and activated app suspicious_login in web-interface
  • browsed to /apps/files/ - error page is shown "internal server error"

The following error has been loggend 5 times in a row:

  Error    index              Exception: Argument 1 passed to                                2020-09-01T11:13:07+00:00
                              "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()"

                              must be an object, string given. at
                              lib/private/AppFramework/Http/Dispatcher.php line 109

                              0. .../App.php line 125
                                 OC\AppFramework\Http\Dispatcher->dispatch(
                                   OCA\Fil ... {},
                                   "index"
                                 )
                              1. .../RouteActionHandler.php line 47
                                 OC\AppFramework\App::main(
                                   "OCA\\Files\\Controller ... r",
                                   "index",
                                   OC\AppFramework\Depende ... {},
                                   {_route:"files.view.index"}
                                 )
                              2. <<closure>>
                                 OC\AppFramework\Routing\RouteActionHandler->__invoke(
                                   {_route:"files.view.ind ... "}
                                 )
                              3. lib/private/Route/Router.php line 299
                                 call_user_func(
                                   OC\AppFramework\Routing\RouteActio ... {},
                                   {_route:"files.view.index"}
                                 )
                              4. lib/base.php line 1013
                                 OC\Route\Router->match("\/apps\/files\/")
                              5. index.php line 38
                                 OC::handleRequest(

                                 )

further information for sudo -u www-data php occ app:list
Enabled:

  • accessibility: 1.4.0
  • activity: 2.11.0
  • bruteforcesettings: 2.0.1
  • calendar: 2.0.4
  • cloud_federation_api: 1.1.0
  • comments: 1.8.0
  • contacts: 3.3.0
  • dav: 1.14.0
  • documentserver_community: 0.1.7
  • federatedfilesharing: 1.8.0
  • federation: 1.8.0
  • files: 1.13.1
  • files_pdfviewer: 1.7.0
  • files_rightclick: 0.15.2
  • files_sharing: 1.10.1
  • files_trashbin: 1.8.0
  • files_versions: 1.11.0
  • files_videoplayer: 1.7.0
  • firstrunwizard: 2.7.0
  • logreader: 2.3.0
  • lookup_server_connector: 1.6.0
  • mail: 1.4.1
  • nextcloud_announcements: 1.7.0
  • notifications: 2.6.0
  • oauth2: 1.6.0
  • onlyoffice: 4.3.0
  • password_policy: 1.8.0
  • photos: 1.0.0
  • privacy: 1.2.0
  • provisioning_api: 1.8.0
  • recommendations: 0.6.0
  • serverinfo: 1.8.0
  • settings: 1.0.0
  • sharebymail: 1.8.0
  • support: 1.1.1
  • survey_client: 1.6.0
  • suspicious_login: 3.2.0
  • systemtags: 1.8.0
  • text: 2.0.0
  • theming: 1.9.0
  • twofactor_backupcodes: 1.7.0
  • updatenotification: 1.8.0
  • viewer: 1.2.0
  • workflowengine: 2.0.0
    Disabled:
  • admin_audit
  • encryption
  • files_external
  • spreed
  • user_ldap

After occ app:disable suspicious_login its working again.

@ChristophWurst
Copy link
Member

ChristophWurst commented Sep 1, 2020

Okay thanks. In that case the conflict might be between Nextcloud and the app, which is … a bummer and really hard to fix. Let me see if I can delete the release, drop Nextcloud 18 support, and re-release.

Please downgrade to the previous version. Thanks.

@HaleyACS
Copy link
Author

HaleyACS commented Sep 1, 2020

Can we downgrade on the CLI? I don't know how to actually do that.

@ChristophWurst
Copy link
Member

You can't. Download the tarball, replace everything in the apps dir. Run the upgrade procedure. Done.

@ChristophWurst
Copy link
Member

Interesting though, a pure installation of Nextcloud 17/18/19/20 with this app installed does not cause any errors. So I think it might be caused by one other app.

@ChristophWurst
Copy link
Member

@Coffeeri @grimSBZ would you have a few mins to try disable all of your many apps, see if the problem remains and then re-endable them one after the other until your installation breaks?

@grimSBZ
Copy link

grimSBZ commented Sep 1, 2020

@Coffeeri @grimSBZ would you have a few mins to try disable all of your many apps, see if the problem remains and then re-endable them one after the other until your installation breaks?

As mentioned these are all default apps (and recommended). But just for fun i did disabled all enabled apps - at least those who can be disabled. I dont get any error page.

  • enable suspicious_login and the nextcloud shows an internal server error
  • enable another app via occ - lets say support - i get a stack trace
$ sudo -u www-data php occ app:enable support
An unhandled exception has been thrown:
TypeError: Argument 1 passed to "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" must be an object, string given. in /var/www/testcloud2/3rdparty/symfony/event-dispatcher/EventDispatcher.php:63
Stack trace:
#0 /var/www/testcloud2/lib/private/EventDispatcher/SymfonyAdapter.php(70): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('\\OC\\Repair::ste...', Object(Symfony\Component\EventDispatcher\GenericEvent))
#1 /var/www/testcloud2/lib/private/Repair.php(204): OC\EventDispatcher\SymfonyAdapter->dispatch('\\OC\\Repair::ste...', Object(Symfony\Component\EventDispatcher\GenericEvent))
#2 /var/www/testcloud2/lib/private/Repair.php(103): OC\Repair->emit('\\OC\\Repair', 'step', Array)
#3 /var/www/testcloud2/lib/private/legacy/app.php(981): OC\Repair->run()
#4 /var/www/testcloud2/lib/private/Installer.php(160): OC_App::executeRepairSteps('support', Array)
#5 /var/www/testcloud2/core/Command/App/Enable.php(117): OC\Installer->installApp('support', false)
#6 /var/www/testcloud2/core/Command/App/Enable.php(91): OC\Core\Command\App\Enable->enableApp('support', Array, false, Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/testcloud2/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\App\Enable->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/testcloud2/3rdparty/symfony/console/Application.php(915): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/testcloud2/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\App\Enable), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/testcloud2/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/testcloud2/lib/private/Console/Application.php(214): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/testcloud2/console.php(99): OC\Console\Application->run()
#13 /var/www/testcloud2/occ(11): require_once('/var/www/testcl...')

@ChristophWurst
Copy link
Member

Got it. So it might the difference between default apps (the ones that are packaged) and shipped apps (the ones that live in https://github.com/nextcloud/server). Thanks for testing!

@wienfuchs
Copy link

Landed here because update of this app from 3.1.0 to 3.2.0 broke my nextcloud 18.0.8 installation raising the mentioned error in nextcloud log. Manually downgrading to 3.1.0 through download of tarball fixed it. So there's something obvious: Changes from 3.1.0 to 3.2.0 throws the Symphony execption and therefore breaks nextcloud 18.0.8 in total.

@ChristophWurst
Copy link
Member

So there's something obvious

How is it obvious?

@wienfuchs
Copy link

wienfuchs commented Sep 2, 2020

So there's something obvious

How is it obvious?

When one has a working system (for years) and simply upgrades one (this) app and it does not work, then downgrades to previous version and it works again, this is what I would call "obvious". Don't agree?

@HaleyACS
Copy link
Author

HaleyACS commented Sep 2, 2020

Well, if you only check the size of the archives 3.1 vs 3.2 - there is a substantial difference.
smurphy@pandora:~/Downloads$ ls -lh suspicious_login-3.* -rw-rw-r-- 1 smurphy smurphy 1,2M sept. 2 09:51 suspicious_login-3.1.tar.gz -rw-rw-r-- 1 smurphy smurphy 1,8M sept. 2 09:51 suspicious_login-3.2.tar.gz
600K compressed in difference? And - 3.1 did not have the vendor/symfony inside.

Question: Which PHP Version are you folks running?
Having PHP 7.3.21 (as provided by the official nextcloud docker image).

@ChristophWurst
Copy link
Member

And - 3.1 did not have the vendor/symfony inside.

Bingo! There is a new dev dependency that was accidentally added as production dependency. Let me fix that …

@ChristophWurst
Copy link
Member

See #319. It also contains a test build without this dependency.

@wienfuchs
Copy link

See #319. It also contains a test build without this dependency.

This one works fine with me. Also show's as 3.2.0 so is confirmed to be proper installed :)

@wienfuchs
Copy link

Question: Which PHP Version are you folks running?
Having PHP 7.3.21 (as provided by the official nextcloud docker image).

PHP 7.4.9 working as a charm

@HaleyACS
Copy link
Author

HaleyACS commented Sep 2, 2020

@ChristophWurst Let us know when you released the last one in the official app-store :)
Thx :)

@ChristophWurst
Copy link
Member

v3.2.1 released: https://github.com/nextcloud/suspicious_login/releases/tag/v3.2.1

You can update via the apps settings of your Nextcloud, though due to caching of the latest releases you might not see the update immediately there.

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

Successfully merging a pull request may close this issue.

9 participants