server icon indicating copy to clipboard operation
server copied to clipboard

RuntimeException: "There can only be one Talk backend" on upgrade

Open AndyXheli opened this issue 3 years ago • 7 comments

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.Upgraded from NC 24.0.6 to NC 25.0.1 RC1

Browser log

``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```

Server configuration

Operating system: Ubuntu/RedHat/... Ubuntu 22.0.4 Web server: Apache/Nginx Apache2 Database: MySQL/Maria/SQLite/PostgreSQL MariaDb PHP version: 7.4/8.0/8.1 8.1 Nextcloud Version: (see admin page) 25.0.1 RC1

Server log (data/nextcloud.log)

{"reqId":"566XT8kErR6NkBz75Stl","level":4,"time":"2022-10-27T15:35:44-05:00","remoteAddr":"","user":"--","app":"spreed","method":"","url":"--","message":"Error during app service registration: There can only be one Talk backend","userAgent":"--","version":"24.0.6.1","exception":{"Exception":"RuntimeException","Message":"There can only be one Talk backend","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php","line":296,"function":"registerTalkBackend","class":"OC\\AppFramework\\Bootstrap\\RegistrationContext","type":"->"},{"file":"/var/www/nextcloud/apps/spreed/lib/AppInfo/Application.php","line":143,"function":"registerTalkBackend","class":"OCP\\AppFramework\\Bootstrap\\IRegistrationContext@anonymous\u0000/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php:142$4b","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":136,"function":"register","class":"OCA\\Talk\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":95,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Installer.php","line":143,"function":"runLazyRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":442,"function":"installApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":432,"function":"enable","class":"OC_App","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":285,"function":"upgradeAppStoreApps","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":141,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":225,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":213,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php","Line":432,"message":"Error during app service registration: There can only be one Talk backend","exception":[],"CustomMessage":"Error during app service registration: There can only be one Talk backend"},"id":"635aed9472e64"}

AndyXheli avatar Oct 27 '22 20:10 AndyXheli

cc @ChristophWurst Seems like apps are loaded/registered twice in the upgrade process, so the backend seems to be registered twice at the end.

The registerCalendarResourceBackend and registerCalendarRoomBackend also don't have such a check in place but simply overwrite it. Should be okay to do it for Talk too?

https://github.com/nextcloud/server/blob/68d0038eb0012ef908e7d2c23ec9a724baf820d2/lib/private/AppFramework/Bootstrap/RegistrationContext.php#L423-L450

nickvergessen avatar Nov 02 '22 06:11 nickvergessen

The registerCalendarResourceBackend and registerCalendarRoomBackend also don't have such a check in place but simply overwrite it.

For them we want to allow more than one. Hence the registration methods append to an array. For Talk we only expect to find one backend.

Do you have a clue why apps register twice? That is what we have to fix

ChristophWurst avatar Nov 02 '22 07:11 ChristophWurst

Were you able to solve this? I added a cron task on the host machine (since I am running nextcloud-aio on docker) to install the spreed app at each reboot to solve it temporarily.

@reboot /storage/homelab/system/nextcloud/enable_talk.sh

The enable_talk.sh:

#!/bin/bash

# This script is a temporary fix to enable the talk plugin in each server restart until the bug is fixed
sleep 300  # wait for container to startup
docker exec --user www-data nextcloud-aio-nextcloud php /var/www/html/occ app:install spreed

micdoug avatar Mar 12 '23 14:03 micdoug

Issue appeared on NC 26.0.0 upgrade

{"reqId":"nb3JjdGk8Dj0Qo2wrxAA","level":4,"time":"2023-03-21T10:11:34-05:00","remoteAddr":"1.1.1.1","user":"--","app":"spreed","method":"GET","url":"/core/ajax/update.php?requesttoken=SBjPlIsE1n6y%2F4XgNUqdzHkygwqOfGP%2FVniaaPH8xkI%3D%3AIWzgrblV7gbUtumxAC7WhBZWs2bhMhDPYkirErmXoTA%3D","message":"Error during app service registration: There can only be one Talk backend","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36","version":"25.0.4.1","exception":{"Exception":"RuntimeException","Message":"There can only be one Talk backend","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php","line":314,"function":"registerTalkBackend","class":"OC\\AppFramework\\Bootstrap\\RegistrationContext","type":"->"},{"file":"/var/www/nextcloud/apps/spreed/lib/AppInfo/Application.php","line":153,"function":"registerTalkBackend","class":"OCP\\AppFramework\\Bootstrap\\IRegistrationContext@anonymous\u0000/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php:152$1cb","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":142,"function":"register","class":"OCA\\Talk\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":94,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Installer.php","line":143,"function":"runLazyRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":451,"function":"installApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":431,"function":"enable","class":"OC_App","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":284,"function":"upgradeAppStoreApps","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":140,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":185,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php","Line":461,"message":"Error during app service registration: There can only be one Talk backend","exception":[],"CustomMessage":"Error during app service registration: There can only be one Talk backend"},"id":"64234832c85eb"}

AndyXheli avatar Mar 28 '23 20:03 AndyXheli

Also happen on NC 27

AndyXheli avatar Jul 09 '23 13:07 AndyXheli

I also just hit this now with nextcloud 28. It only appears to be happening when the spreed/talk app is installed via the occ cli tool via occ app:install spreed Installing it via the appstore UI does not trigger that issue.

nebulade avatar Dec 28 '23 17:12 nebulade

I also just hit this now with nextcloud 29

vgdh avatar Jun 29 '24 16:06 vgdh

I just hit the same issue with Nextcloud 30 as well yesterday..

Yes the spreed (aka Talk) application was and is still enabled. For now I only saw it twice, once in 16 May 2024. And now yesterday again after Nextcloud 30 upgrade

melroy89 avatar Sep 15 '24 13:09 melroy89

same issue with Nextcloud 31

xrogeman avatar May 12 '25 18:05 xrogeman

why would this be closed as not planned?

melroy89 avatar May 14 '25 14:05 melroy89

It shouldn't be closed. Apologies for that.

@AndyXheli please leave the ticket management to maintainers. Thank you.

ChristophWurst avatar May 14 '25 15:05 ChristophWurst

@ChristophWurst i never closed the ticket i was having some issue with my git account so that may be it sorry about that

AndyXheli avatar May 14 '25 15:05 AndyXheli