nextcloud / spreed

🗨️ Nextcloud Talk – chat, video & audio calls for Nextcloud
https://nextcloud.com/talk
GNU Affero General Public License v3.0
1.6k stars 428 forks source link

Can not upgrade/enable Talk/Spreed after upgrading NextCloud to v29 #13123

Closed Stupidscript closed 1 day ago

Stupidscript commented 3 weeks ago

How to use GitHub


Steps to reproduce

  1. Upgraded NextCloud to v29.0.5.1
  2. Talk app became disabled
  3. Talk app shows in Disabled Apps with 'Remove' and 'Enable' buttons (was also an 'Upgrade to 19.0.9' but now gone)
  4. Click 'Enable' receive this error: An error occurred during the request. Unable to proceed. Database error when running migration 19000Date20240227084313 for app spreed The table with name "nextcloud.oc_talk_proxy_messages" already exists.
  5. Click 'Remove' and receive same error
  6. Go to 'Your Apps', same buttons ^^
  7. Click 'Remove' and app is (successfully?) removed from the list of 'Your Apps'
  8. Go to Featured Apps, find Talk, click 'Download & Enable'
  9. Same error as ^^, Talk app is now in 'Your Apps', same buttons ^^
  10. Clicking either button produces same error ^^

Expected behaviour

When I click 'Enable' or 'Upgrade' or 'Remove' I expect that action to occur successfully and completely

Actual behaviour

Does not 'Enable' or 'Upgrade' or 'Remove'

Talk app

**Talk app version: 19.0.8 (attempted to upgrade to v19.0.9 as prompted but no longer seeing that upgrade option, just 19.0.8)

Custom Signaling server configured: unknown

Custom TURN server configured: unknown

Custom STUN server configured: unknown

Browser

Microphone available: n/a

Camera available: n/a

Operating system: Ubuntu

Browser name: Chrome

Browser version: 127.0.6533.120 (Official Build) (64-bit)

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

Web server: Apache

Database: Maria

PHP version: 8.3

Nextcloud Version: 29.0.5.1

List of activated apps:

``` sudo -u www-data php occ app:list An unhandled exception has been thrown: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/collaborate.globalnation.tv/lib/private/DB/Connection.php:167 Stack trace: #0 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect() #1 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion() #2 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform() #3 /var/www/collaborate.globalnation.tv/lib/private/DB/ConnectionAdapter.php(200): Doctrine\DBAL\Connection->getDatabasePlatform() #4 /var/www/collaborate.globalnation.tv/lib/private/DB/QueryBuilder/QueryBuilder.php(121): OC\DB\ConnectionAdapter->getDatabasePlatform() #5 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(1239): OC\DB\QueryBuilder\QueryBuilder->expr() #6 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(264): OC\AppConfig->loadConfig() #7 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(1380): OC\AppConfig->searchValues() #8 /var/www/collaborate.globalnation.tv/lib/private/App/AppManager.php(131): OC\AppConfig->getValues() #9 /var/www/collaborate.globalnation.tv/lib/private/App/AppManager.php(152): OC\App\AppManager->getInstalledAppsValues() #10 /var/www/collaborate.globalnation.tv/lib/private/legacy/OC_App.php(234): OC\App\AppManager->getInstalledApps() #11 /var/www/collaborate.globalnation.tv/lib/private/AppFramework/Bootstrap/Coordinator.php(90): OC_App::getEnabledApps() #12 /var/www/collaborate.globalnation.tv/lib/base.php(709): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration() #13 /var/www/collaborate.globalnation.tv/lib/base.php(1184): OC::init() #14 /var/www/collaborate.globalnation.tv/console.php(48): require_once('...') #15 /var/www/collaborate.globalnation.tv/occ(11): require_once('...') #16 {main} ```

Nextcloud configuration:

``` sudo -u www-data php occ config:list system An unhandled exception has been thrown: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/collaborate.globalnation.tv/lib/private/DB/Connection.php:167 Stack trace: #0 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(453): OC\DB\Connection->connect() #1 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(411): Doctrine\DBAL\Connection->getDatabasePlatformVersion() #2 /var/www/collaborate.globalnation.tv/3rdparty/doctrine/dbal/src/Connection.php(318): Doctrine\DBAL\Connection->detectDatabasePlatform() #3 /var/www/collaborate.globalnation.tv/lib/private/DB/ConnectionAdapter.php(200): Doctrine\DBAL\Connection->getDatabasePlatform() #4 /var/www/collaborate.globalnation.tv/lib/private/DB/QueryBuilder/QueryBuilder.php(121): OC\DB\ConnectionAdapter->getDatabasePlatform() #5 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(1239): OC\DB\QueryBuilder\QueryBuilder->expr() #6 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(264): OC\AppConfig->loadConfig() #7 /var/www/collaborate.globalnation.tv/lib/private/AppConfig.php(1380): OC\AppConfig->searchValues() #8 /var/www/collaborate.globalnation.tv/lib/private/App/AppManager.php(131): OC\AppConfig->getValues() #9 /var/www/collaborate.globalnation.tv/lib/private/App/AppManager.php(152): OC\App\AppManager->getInstalledAppsValues() #10 /var/www/collaborate.globalnation.tv/lib/private/legacy/OC_App.php(234): OC\App\AppManager->getInstalledApps() #11 /var/www/collaborate.globalnation.tv/lib/private/AppFramework/Bootstrap/Coordinator.php(90): OC_App::getEnabledApps() #12 /var/www/collaborate.globalnation.tv/lib/base.php(709): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration() #13 /var/www/collaborate.globalnation.tv/lib/base.php(1184): OC::init() #14 /var/www/collaborate.globalnation.tv/console.php(48): require_once('...') #15 /var/www/collaborate.globalnation.tv/occ(11): require_once('...') #16 {main} ```

Server log (data/nextcloud.log)

``` Insert your server log here ```
nickvergessen commented 2 weeks ago

Seems like you manually corrupted the database at some point by either restoring an incomplete backup or manually removing some rows in e.g. oc_migrations table. Ref https://github.com/nextcloud/spreed/issues/772#issuecomment-384211357

Stupidscript commented 2 weeks ago

We did not do anything manually. We ran the NextCloud update, Talk disappeared from our Dashboards, we saw there was an upgrade for Talk, we tried to run it and started getting this error:

(screenshot from today's attempt to Download and Install after clicking the Remove button in my Disabled Apps dashboard) Screenshot 2024-08-26 101237

(screenshot from what is now in my Disabled Apps dashboard, Enable generates the same error) Screenshot 2024-08-26 101524

That looks like an error dated 2024-02-27, doesn't it? It implies the upgrade/removal/enable process can not proceed because a table already exists, not that one was removed. Am I reading that wrong? We have not done anything manually. Frankly, I'm not even sure how to get access to the database.

Do you have any suggestions how we can recover from this and get Talk back in our app? We used it just fine before the NextCloud upgrade. Thank you for your continuing attention and assistance.

nickvergessen commented 2 weeks ago

That looks like an error dated 2024-02-27, doesn't it? It implies the upgrade/removal/enable process can not proceed because a table already exists, not that one was removed. Am I reading that wrong? We have not done anything manually.

The message is that a migration file we created back in February is trying to create a database table that is already in your database. The easiest way to end up in this situation is:

  1. Performing an update
  2. Restore a previous backup without dropping newer tables (which means the list of migrations that are executed is reset, but the table still exists)
  3. Performing the update again

But okay, We ran the NextCloud update, Talk disappeared from our Dashboards sounds different. Do you still have the nextcloud.log file from that upgrade so we could check what happened there?

Can you run the following command:

occ migrations:status spreed

I'm not even sure how to get access to the database.

That might be necessary to go forward, or manually changing PHP files.

Stupidscript commented 2 weeks ago

Thank you for your response, Nick.

The nextcloud.log file is over 20GB, so I archived it and created a new one then attempted the Enable function to generate some log data. That 390K file is attached. nextcloud.log Here also is the 'updater.log' file, FYI: updater.log

We have never had any success running 'occ' or '.occ' or './occ' even if we change permissions to allow it to be executable. By default 'occ' is just a shell PHP script in a text file.

SmartKlabund commented 1 week ago

Exactly the same problem for me: Since NC19 working Talk was ok in 28.8, then upgrade to 29.0.6, Talk is then deactivated.

Error message after trying to activate:

Database error when running migration 19000Date20240227084313 for app spreed The table with name nextcloud_156971c6.oc_talk_proxy_messages already exists.’ could not enable apps

After removing the app and downloading and activating it again: the same message.

Very, very strange: the date in the error message is exactly the same as for Stupidscript - so it can't be due to the local upgrade. We certainly didn't update at the same time in February 2024.

Tables with Spreed in the name do not exist in the DB.

I am tempted to delete all tables oc_talk... tables. However, this would lead to the loss of all thrads etc.

Is there another way? Maybe only one table is interfering? Just the ‘oc_talk_proxy_messages’ table mentioned. Maybe it is enough to delete it?

Greetings, SmartKlabund

SystemKeeper commented 1 week ago

Please try the command that was suggested by nickvergessen and post the output here.

SmartKlabund commented 1 week ago

nickvergessen: Can you run the following command occ migrations:status spreed

Output:

Command "migrations:status" is not defined.

Did you mean one of these?
encryption:status
migrations:preview
twofactorauth:state

SystemKeeper commented 1 week ago

The status command is only available when you set 'debug' => true, in your config.php

SmartKlabund commented 1 week ago

Ok - Thank you, now is set. command: occ migrations:status spreed

Result:

In MigrationService.php line 495:

Migration step 'OCA\Talk\Migration\Version19000Date20240227084313' is unknown

migrations:status

nickvergessen commented 3 days ago

Can you check if you have multiple copies of the spreed app in different app directories on your server?

nickvergessen commented 2 days ago

@Stupidscript Unluckily the logs don't explain how you came to the situation:

Database error when running migration 19000Date20240227084313 for app spreed The table with name \"nextcloud.oc_talk_proxy_messages\" already exists.

My suggestion for now would be to drop the table directly in the database and then retry the enabling.

SmartKlabund commented 2 days ago

Can you check if you have multiple copies of the spreed app in different app directories on your server?

I checked: Only one directory "spreed".

Stupidscript commented 1 day ago
drop table oc_talk_proxy_messages
drop table oc_talk_retry_ocm

Then enabling succeeded. Unable to upgrade to v19.09 with unknown error, but that's a NextCloud issue, as no app can be upgraded at this point. Thanks for the help.

nickvergessen commented 1 day ago

Unable to upgrade to v19.09 with unknown error, but that's a NextCloud issue, as no app can be upgraded at this point.

That really sounds like a broader issue on your side then. But good that enabling worked again. I'm then closing this issue as your ticket is solved.