Missing database-colums and errors when trying to use Talk

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Some useful links to gather information about your Nextcloud Talk installation:
Information about Signaling server: /index.php/index.php/settings/admin/talk#signaling_server
Information about TURN server: /index.php/settings/admin/talk#turn_server
Information about STUN server: /index.php/settings/admin/talk#stun_server

Nextcloud version (eg, 24.0.1): 32.0.2
Talk Server version (eg, 14.0.2): 22.0.4
Custom Signaling server configured: no
Custom TURN server configured: no
Custom STUN server configured: no

The issue you are facing:

After upgrading to 32.0.2 I get DbalExceptions in my log that have it’s origin in the Talk- (Spreed)-app. There are columns missing, obiviously in the table oc__talk_attendees.

I also tried to fix this issue by removing the Talk-app, but the old database-tables remain in the system (shouldn’t they be also deleted when removing an app?)

Also after re-installing the Talk-app the missing columns are not available!?

I am also unable to create a meeting or talk. When trying to do this I already get an error message in Web-UI.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Seeing the below error in the logs. No idea how to fix it

  2. Delete the Talk app - the Talk related tables remain in the database

  3. Reinstall Talk app and see that the missing columns are still there.

The output of your Nextcloud log in Admin > Logging or errors in nextcloud.log in /var/www/:

[no app in context] Fehler: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'a.has_unread_threads' in 'SELECT'
	GET /ocs/v2.php/apps/spreed/api/v4/room?modifiedSince=0&includeStatus=true&includeLastMessage=true
	von 2a02:8070:e283:fb3f:5e4d:dc1d:f045:c55b von admin um 28.11.2025, 14:00:01

Full error message is:

{“reqId”:“h8lPlcDX3hjet12SRaun”,“level”:3,“time”:“2025-11-28T00:53:24+01:00”,“remoteAddr”:“2a02:8070:e283:fb3f:5e4d:dc1d:f045:c55b”,“user”:“andreas”,“app”:“no app in context”,“method”:“GET”,“url”:“/ocs/v2.php/search/providers/talk-message/search?term=linux&from=%2Fapps%2Fcalendar%2FtimeGridWeek%2F2025-12-05”,“message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0”,“version”:“32.0.2.2”,“exception”:{“Exception”:“OC\DB\Exceptions\DbalException”,“Message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“Code”:1054,“Trace”:[{“file”:“/var/www/nextcloud/server/lib/private/DB/ConnectionAdapter.php”,“line”:53,“function”:“wrap”,“class”:“OC\DB\Exceptions\DbalException”,“type”:“::”},{“file”:“/var/www/nextcloud/server/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:291,“function”:“executeQuery”,“class”:“OC\DB\ConnectionAdapter”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:394,“function”:“executeQuery”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:355,“function”:“getRoomsForActor”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Search/MessageSearch.php”,“line”:135,“function”:“getRoomsForUser”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Search/SearchComposer.php”,“line”:365,“function”:“search”,“class”:“OCA\Talk\Search\MessageSearch”,“type”:“->”},{“file”:“/var/www/nextcloud/server/core/Controller/UnifiedSearchController.php”,“line”:117,“function”:“search”,“class”:“OC\Search\SearchComposer”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:204,“function”:“search”,“class”:“OC\Core\Controller\UnifiedSearchController”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:118,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/App.php”,“line”:153,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Route/Router.php”,“line”:321,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/nextcloud/server/ocs/v1.php”,“line”:61,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/nextcloud/server/ocs/v2.php”,“line”:8,“args”:[“/var/www/nextcloud/server/ocs/v1.php”],“function”:“require_once”}],“File”:“/var/www/nextcloud/server/lib/private/DB/Exceptions/DbalException.php”,“Line”:56,“Previous”:{“Exception”:“Doctrine\DBAL\Exception\InvalidFieldNameException”,“Message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“Code”:1054,“Trace”:[{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Connection.php”,“line”:1976,“function”:“convert”,“class”:“Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter”,“type”:“->”},{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Connection.php”,“line”:1918,“function”:“handleDriverException”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Connection.php”,“line”:1111,“function”:“convertExceptionDuringQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/Connection.php”,“line”:420,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/ConnectionAdapter.php”,“line”:50,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:291,“function”:“executeQuery”,“class”:“OC\DB\ConnectionAdapter”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:394,“function”:“executeQuery”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:355,“function”:“getRoomsForActor”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Search/MessageSearch.php”,“line”:135,“function”:“getRoomsForUser”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Search/SearchComposer.php”,“line”:365,“function”:“search”,“class”:“OCA\Talk\Search\MessageSearch”,“type”:“->”},{“file”:“/var/www/nextcloud/server/core/Controller/UnifiedSearchController.php”,“line”:117,“function”:“search”,“class”:“OC\Search\SearchComposer”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:204,“function”:“search”,“class”:“OC\Core\Controller\UnifiedSearchController”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:118,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/App.php”,“line”:153,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Route/Router.php”,“line”:321,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/nextcloud/server/ocs/v1.php”,“line”:61,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/nextcloud/server/ocs/v2.php”,“line”:8,“args”:[“/var/www/nextcloud/server/ocs/v1.php”],“function”:“require_once”}],“File”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php”,“Line”:69,“Previous”:{“Exception”:“Doctrine\DBAL\Driver\PDO\Exception”,“Message”:“SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“Code”:1054,“Trace”:[{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php”,“line”:132,“function”:“new”,“class”:“Doctrine\DBAL\Driver\PDO\Exception”,“type”:“::”},{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Connection.php”,“line”:1104,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/Connection.php”,“line”:420,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/ConnectionAdapter.php”,“line”:50,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:291,“function”:“executeQuery”,“class”:“OC\DB\ConnectionAdapter”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:394,“function”:“executeQuery”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:355,“function”:“getRoomsForActor”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Search/MessageSearch.php”,“line”:135,“function”:“getRoomsForUser”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Search/SearchComposer.php”,“line”:365,“function”:“search”,“class”:“OCA\Talk\Search\MessageSearch”,“type”:“->”},{“file”:“/var/www/nextcloud/server/core/Controller/UnifiedSearchController.php”,“line”:117,“function”:“search”,“class”:“OC\Search\SearchComposer”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:204,“function”:“search”,“class”:“OC\Core\Controller\UnifiedSearchController”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:118,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/App.php”,“line”:153,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Route/Router.php”,“line”:321,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/nextcloud/server/ocs/v1.php”,“line”:61,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/nextcloud/server/ocs/v2.php”,“line”:8,“args”:[“/var/www/nextcloud/server/ocs/v1.php”],“function”:“require_once”}],“File”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php”,“Line”:24,“Previous”:{“Exception”:“PDOException”,“Message”:“SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“Code”:“42S22”,“Trace”:[{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php”,“line”:130,“function”:“execute”,“class”:“PDOStatement”,“type”:“->”},{“file”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Connection.php”,“line”:1104,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/Connection.php”,“line”:420,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/ConnectionAdapter.php”,“line”:50,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:291,“function”:“executeQuery”,“class”:“OC\DB\ConnectionAdapter”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:394,“function”:“executeQuery”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Manager.php”,“line”:355,“function”:“getRoomsForActor”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/apps/spreed/lib/Search/MessageSearch.php”,“line”:135,“function”:“getRoomsForUser”,“class”:“OCA\Talk\Manager”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Search/SearchComposer.php”,“line”:365,“function”:“search”,“class”:“OCA\Talk\Search\MessageSearch”,“type”:“->”},{“file”:“/var/www/nextcloud/server/core/Controller/UnifiedSearchController.php”,“line”:117,“function”:“search”,“class”:“OC\Search\SearchComposer”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:204,“function”:“search”,“class”:“OC\Core\Controller\UnifiedSearchController”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/Http/Dispatcher.php”,“line”:118,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/AppFramework/App.php”,“line”:153,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/nextcloud/server/lib/private/Route/Router.php”,“line”:321,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/nextcloud/server/ocs/v1.php”,“line”:61,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/nextcloud/server/ocs/v2.php”,“line”:8,“args”:[“/var/www/nextcloud/server/ocs/v1.php”],“function”:“require_once”}],“File”:“/var/www/nextcloud/server/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php”,“Line”:130}}},“message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”,“exception”:{“query”:“SELECT r.type, r.read_only, r.lobby_state, r.sip_enabled, r.assigned_hpb, r.token, r.name, r.description, r.password, r.avatar, r.active_since, r.default_permissions, r.call_permissions, r.call_flag, r.last_activity, r.last_message, r.lobby_timer, r.object_type, r.object_id, r.listable, r.message_expiration, r.remote_server, r.remote_token, r.breakout_room_mode, r.breakout_room_status, r.call_recording, r.recording_consent, r.has_federation, r.mention_permissions, r.transcription_language, r.id AS r_id, a.room_id, a.actor_type, a.actor_id, a.display_name, a.pin, a.participant_type, a.favorite, a.notification_level, a.notification_calls, a.last_joined_call, a.last_read_message, a.last_mention_message, a.last_mention_direct, a.read_privacy, a.permissions, a.access_token, a.remote_id, a.invited_cloud_id, a.phone_number, a.call_id, a.state, a.unread_messages, a.last_attendee_activity, a.archived, a.important, a.sensitive, a.has_unread_threads, a.has_unread_thread_mentions, a.has_unread_thread_directs, a.id AS a_id FROM *PREFIX*talk_rooms r LEFT JOIN *PREFIX*talk_attendees a ON (a.actor_id = :dcValue1) AND (a.actor_type = :dcValue2) AND (a.room_id = r.id) WHERE a.id IS NOT NULL”},“CustomMessage”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘a.has_unread_threads’ in ‘SELECT’”},“id”:“69295515353b0”}

I compared the table oc_talk_attendees in my Nextcloud with an other installation. After adding the missing columns, three all together, in the database via …

ALTER TABLE oc_talk_attendees ADD COLUMN IF NOT EXISTS has_unread_threads TINYINT(1) NULL DEFAULT 0;
ALTER TABLE oc_talk_attendees ADD COLUMN IF NOT EXISTS has_unread_thread_mentions TINYINT(1) NULL DEFAULT 0;
ALTER TABLE oc_talk_attendees ADD COLUMN IF NOT EXISTS has_unread_thread_directs TINYINT(1) NULL DEFAULT 0;

it looks as if Talk is back to work. But I am still unsure about …

  • what’s the reason the 3 columns in this table were missing
  • why did a new installation of the Talk app didn’t create the missing columns
  • are there other tables missing columns

How can I check wether my database is up to date, missing definitions, …? Currently I’m absolutely uncertain about the reliability of my Nextcloud installation.

Does anyone has a hint how I can check the correct definition of my database tables?

what’s the reason the 3 columns in this table were missing

These columns were added relatively recently via this PR. Specifically here.

These column get created automatically when Spreed (Talk) is first installed and/or the app is upgraded.

Any chance you did a database restore or attempted to downgrade at some point or anything like that? If you can track down logs from the time period when the Spreed app was upgraded to that version there might be clues too.

why did a new installation of the Talk app didn’t create the missing columns

Apps often don’t automatically remove their DB data. Some apps implement dedicated commands for deleting their data. I don’t believe Talk does.

Does anyone has a hint how I can check the correct definition of my database tables?

There are some occ db:schema commands that you might find helpful for this.

Login to your Nextcloud using a browser.
Call “Administration settings” and wait for the result of the selftest.
You should get displayed, if indices, field types or fields are missing resp. wrong and get a hint, how to solve.

I know this feature for missing indices, but not for missing database fields. And in the described situation the admin-page did indeed not show the problem, only the protocol hat exeptions that were a hint for the missing column(s). First solution for me was to add the columns manually on database level.

As described: In my situation they were not created automatically when I did a new installation of the before deleted Talk-app.

Perhaps a longer time ago. During this upgrade I did nothing like this. But it might indeed have happened a longer time ago.

Thanks for pointing me into this direction. But the available commands just have the current schema as output, they do not help directly in finding problems or fixing the schema.

Actually I tried db:add-missing-columns before I posted here. But this also did not fix the problem with the missing columns - I had to add them manually.