SQL Issues with Talk/Spreed App

Nextcloud version : 20.0.1
Database : pgsql 12.4
PHP version : 7.4.12

Problem Description:
The Talk app gave me issues updating due to some version compatibility issues a long time ago. I eventually got around to attempting to fix it here recently, and I found threads such as this one which seemed to accurately describe the original problem. Seeing as I haven’t used Talk before, I figured I could just delete the SQL table mentioned here, and it would automatically be recreated when I reinstalled the Talk app in Nextcloud. That wasn’t the case. Now, I get the following error when trying to update or install the Talk app:

An error occured during the request. Unable to proceed. There is no table with name 'username.oc_talk_participants' in the schema.

I also am unable to successfully remove/uninstall the app through OCC or through the browser interface. I will not get an error when trying to remove the app, but the app will show up in my list of installed apps again shortly. I’ve tried various things with OCC to no success.

It’s obviously an SQL related issue, but I simply do not have the experience to know how to fix it. I assumed that it would just recreate the necessary tables if they were not found at the time of installation of the app, but it doesn’t. I could really use some help with this.

The output of your Nextcloud log in Admin > Logging:

[settings] Error: Doctrine\DBAL\Schema\SchemaException: There is no table with name 'username.oc_talk_participants' in the schema. at <<closure>>

 0. /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php line 172
 1. /usr/share/webapps/nextcloud/lib/private/DB/SchemaWrapper.php line 93
 2. /usr/share/webapps/nextcloud/apps/spreed/lib/Migration/Version8000Date20200331144101.php line 38
 3. /usr/share/webapps/nextcloud/lib/private/DB/MigrationService.php line 478
    OCA\Talk\Migration\Version8000Date20200331144101->changeSchema(OC\Migration\SimpleOutput {}, Closure {}, {tablePrefix: "oc_"})
 4. /usr/share/webapps/nextcloud/lib/private/DB/MigrationService.php line 414
    OC\DB\MigrationService->executeStep("8000Date20200331144101", false)
 5. /usr/share/webapps/nextcloud/lib/private/Installer.php line 157
 6. /usr/share/webapps/nextcloud/apps/settings/lib/Controller/AppSettingsController.php line 448
 7. /usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 169
    OCA\Settings\Controller\AppSettingsController->enableApps(["spreed"], [])
 8. /usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings\Con ... {}, "enableApps")
 9. /usr/share/webapps/nextcloud/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "enableApps")
10. /usr/share/webapps/nextcloud/lib/private/Route/Router.php line 308
    OC\AppFramework\App::main("OCA\\Settings\\ ... r", "enableApps", OC\AppFramework\ ... {}, {action: null,_r ... "})
11. /usr/share/webapps/nextcloud/lib/base.php line 1009
12. /usr/share/webapps/nextcloud/index.php line 37

POST /settings/apps/enable

The problems has already been discussed several times in the past. Hopefully you find a solution for the problem here:

Hello, Thanks for your response.

Unless I am missing something, the first link was resolved with a patch to the Talk app, the second was resolved with a clean install of Nextcloud, and the third is identical to the one I linked in my original post.

Maybe I am missing something from these links. If so, could you please make it a bit more obvious for me? I am not experienced with SQL in the slightest. Thank you very much.

Edit: I did see this, for completely uninstalling the app. I had looked for something like this before, but I was unable to find it. The comments related to it say it is now outdated, and is no longer applicable.

Unfortunately I’m personally not using PostgreSQL but MariaDB, so that I cannot tell you the exact command syntax. You can try to create the missing table on your own, if you don’t want to reinstall the talk app as recommend in the other discussions. Please make always sure that you’ve created a backup of your database before you modify anything.

Here you find the table structure:

> describe oc_talk_participants;
| Field                | Type                 | Null | Key | Default | Extra |
| user_id              | varchar(255)         | YES  | MUL | NULL    |       |
| room_id              | int(10) unsigned     | NO   | MUL | 0       |       |
| last_ping            | int(10) unsigned     | NO   | MUL | 0       |       |
| session_id           | varchar(255)         | NO   | MUL |         |       |
| participant_type     | smallint(5) unsigned | NO   |     | 0       |       |
| favorite             | tinyint(1)           | NO   |     | 0       |       |
| in_call              | int(11)              | NO   | MUL | 0       |       |
| notification_level   | int(11)              | YES  |     | 0       |       |
| last_joined_call     | datetime             | YES  |     | NULL    |       |
| last_read_message    | bigint(20)           | YES  |     | 0       |       |
| last_mention_message | bigint(20)           | YES  |     | 0       |       |
11 rows in set (0.00 sec)

Alright, thanks. I will attempt to recreate it on my own and work from there. I have attempted to reinstall Talk on my own to no avail, and I fear that these instructions linked to in my last post will not work properly, as mentioned in that very thread.

I will bump this thread if I am unable to recreate this table from your sample structure, if that’s okay with the site policy.

Thank you very much, I’ll try to figure out enough about SQL to make this happen.

One more question though before I attempt this: should this table be under any specific SQL user or group, or related concept? I believe Nextcloud uses two different SQL users to manage things, but I could be mistaken. Thanks again.

Edit (SOLUTION STARTS HERE): I appear to have fixed it by creating a new Nextcloud installation on a different computer, then exporting the table I wanted and importing it on my original server. Instructions as follows:

Fresh install of Nextcloud on second computer:

 pg_dump -C -t oc_talk_participants -U *username* -d *database_name*  > talk_participants.pgsql

Original install of Nextcloud on first computer:

psql -U *username* -d *database_name* < talk_participants.pgsql

That was it. The table provided below is not enough information to properly recreate it, so I finally broke down and decided to reinstall a fresh instance of Nextcloud, in order to get a fresh database table for my own use. It appears to work as of now, though I have yet to test it fully. I’ll update this post if it doesn’t work for some SQL related reason.

It’s a new table of the Nextcloud database, to which different users have access to. You’re usually not creating tables for specific users.