NC35 update problems with missing tables / missing index

I also encountered similar database related warnings after upgrading manually from 34.0.4 to 35.0.0. The occ upgrade command gave me these warnings:

    The database schema does not match what is expected for the installed version:
    - missing table 'oc_federated_invites'
    - unexpected table 'oc_ex_event_handlers'
    - unexpected table 'oc_ex_translation_q'
    - unexpected table 'oc_ex_translation'
    - unexpected table 'oc_ex_speech_to_text_q'
    - unexpected table 'oc_ex_text_processing_q'
    - unexpected table 'oc_ex_text_processing'
    - unexpected table 'oc_ex_speech_to_text'
    - unexpected table 'oc_file_metadata'
    - oc_filecache: unexpected index 'fs_storage_path_prefix'
    - oc_activity: missing index 'activity_object'
    - oc_share_external: column 'id' differs in: autoincrement
    - oc_text_steps: unexpected index 'text_steps_doc_id_id_index'
    Run "occ db:schema:check -v" for details.

Furthermore, the administration settings show me the following error on database checks:

Tables scanning sequentially
Notice ·
pg.tables_without_index_use
Failing

Some tables have many sequential scans and no index scans, suggesting a missing index.

17 table(s) have > 1M sequential scans without any index scans.

    oc_share
    oc_preferences
    oc_flow_operations
    oc_webhook_listeners
    oc_users
    oc_share_external
    oc_accounts
    oc_group_user

Add appropriate indexes to the affected tables (pg_stat_user_tables shows the full scan statistics).

Value
    17

Nevertheless, nextcloud seems to be working okay and I have not received any errors while using it. This instance is using php 8.4 and PostgreSQL 14 with only the standard set of plugins.

occ db:add-missing-indices did not change the situation.

I’ve been running into DB errors as well after upgrade to AIO 14.1.1 in docker. System works until /sda fills up and locks the system.
no app in context DbalExceptionAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535
Error core QueryExceptionThe number of parameters must not exceed 65535. Restriction by PostgreSQL.
Error core QueryExceptionMore than 1000 expressions in a list are not allowed on Oracle.
I can’t locate what’s causing this.

EDIT: I think it might be related to the ‘External Storage’ app current version.

Took some time but I finally got the logs to calm down and freed 60+GB of data.

# Place Nextcloud into maintenance mode before running these to prevent users from hitting the instance mid-operation
# Limit what is logged
docker exec -u www-data nextcloud-aio-nextcloud php occ config:app:set admin_audit logged_actions --value="login,logout,user_create,user_delete"
# Disable audit logging
docker exec -u www-data nextcloud-aio-nextcloud php occ app:disable admin_audit
# Limit the maximum size of a log file before it rotates (e.g., 100 MB)
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:set log_rotate_size --value=104857600 --type=int
# Define the file type configuration parameter explicitly
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:set log_type_audit --value="file"
# Automatically delete audit log entries older than 7 days
docker exec -u www-data nextcloud-aio-nextcloud php occ config:app:set admin_audit log_retention --value=7 --type=int
# Restrict overall logging levels to exclude debug info (Level 2 = Info, Level 3 = Warn)
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:set loglevel --value=2 --type=int
# Verify the log configuration changes applied
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:get log_rotate_size
# Empty trash (free space optional)
docker exec -u www-data nextcloud-aio-nextcloud php occ trashbin:cleanup --all
# Limit future thumbnails to 1024x1024 max (change as needed)
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:set preview_max_x --value 1024
docker exec -u www-data nextcloud-aio-nextcloud php occ config:system:set preview_max_y --value 1024
# Remove existing bloated log files
rm /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/audit.log
rm /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/audit.log.1
# Check system cron status
docker exec -u www-data nextcloud-aio-nextcloud php occ backgroundjob:status
# Force NC to update the database so it knows the files are gone
docker exec -u www-data nextcloud-aio-nextcloud php occ files:scan-app-data
# Restart to confirm changes
docker restart nextcloud-aio-nextcloud

# check space with
du -sh /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/* | sort -h

For me, a lot of missing and unexpected tables but no error at all.

Same happend to me after update from 35.0.0 to 35.0.1:

`$ sg users "php occ db:schema:check"`
`missing table 'oc_federated_invites'`
`unexpected table 'oc_user_export_jobs'`
`unexpected table 'oc_webhook_listeners'`
`unexpected table 'oc_guests_transfers'`
`unexpected table 'oc_preferences_ex'`
`unexpected table 'oc_recent_contact'`
`unexpected table 'oc_guests_users'`
`unexpected table 'oc_ocm_token_map'`
`unexpected table 'oc_webhook_tokens'`
`unexpected table 'oc_user_import_jobs'`
`unexpected table 'oc_appconfig_ex'`

(Shared hosting environment)

Your errors look unrelated to the new tooling. To identify source you’d need to post the full log entries (full stack trace), not the collapsed entries. You may want to do so in a dedicated thread since not related.

same error, after update from 34.0.3.2 to 35.0.1.1

The database schema does not match what is expected for the installed version:
  - missing table 'oc_federated_invites'
  - unexpected table 'oc_passwords_challenge'
  - unexpected table 'oc_passwords_folder'
  - unexpected table 'oc_passwords_folder_rv'
  - unexpected table 'oc_passwords_keychain'
  - unexpected table 'oc_passwords_password'
  - unexpected table 'oc_passwords_password_rv'
  - unexpected table 'oc_passwords_pw_tag_rel'
  - unexpected table 'oc_passwords_registration'
  - unexpected table 'oc_passwords_session'
  - unexpected table 'oc_passwords_share'
  - unexpected table 'oc_passwords_tag'
  - unexpected table 'oc_passwords_tag_rv'
  - oc_activity: missing index 'activity_object'
Run "occ db:schema:check -v" for details.

Should I be worried? the webpage is working but client struglle to sync

same error type with postgresql 18
error message :
Tables scanning sequentially

Information ·pg.tables_without_index_use

Échoue

Some tables have many sequential scans and no index scans, suggesting a missing index.

3 table(s) have > 1M sequential scans without any index scans.

  • oc_users
  • oc_mimetypes
  • oc_files_lock

Add appropriate indexes to the affected tables (pg_stat_user_tables shows the full scan statistics).

Valeur

3

but
occ db:schema:check -v
missing table ‘oc_federated_invites’
unexpected table ‘oc_ex_text_processing_q’
unexpected table ‘oc_ex_text_processing’
unexpected table ‘oc_appconfig_ex’
unexpected table ‘oc_ex_speech_to_text_q’
unexpected table ‘oc_ex_speech_to_text’
unexpected table ‘oc_ex_event_handlers’
unexpected table ‘oc_preferences_ex’
unexpected table ‘oc_ex_translation_q’
unexpected table ‘oc_ex_translation’
oc_mimetypes: unexpected index ‘idx_oc_mimetypes_id’
oc_mimetypes: unexpected index ‘idx_oc_mimetypes_mimetype’
oc_filecache: unexpected index ‘fs_storage_path_prefix’
oc_filecache: unexpected index ‘idx_oc_filecache_mimetype’
oc_group_user: unexpected index ‘idx_oc_group_user_gid_uid’
oc_group_user: unexpected index ‘idx_oc_group_user_uid’
oc_groups: unexpected index ‘idx_oc_groups_displayname’
oc_groups: unexpected index ‘idx_oc_groups_displayname_trgm’
oc_groups: unexpected index ‘idx_oc_groups_gid’
oc_users: unexpected index ‘idx_oc_users_displayname’
oc_users: unexpected index ‘idx_oc_users_uid’
oc_users: unexpected index ‘idx_oc_users_uid_lower’
oc_users: unexpected index ‘idx_oc_users_uid_trgm’
oc_activity: missing index ‘activity_object’
oc_bookmarks: column ‘url’ differs in: type
oc_bookmarks: column ‘title’ differs in: type
oc_bookmarks: column ‘description’ differs in: type
oc_bookmarks_folders: column ‘title’ differs in: type
oc_bookmarks_folders_public: column ‘description’ differs in: type
oc_files_lock: unexpected index ‘idx_oc_files_lock_creation’
oc_files_lock: unexpected index ‘idx_oc_files_lock_file_id’
oc_files_lock: unexpected index ‘idx_oc_files_lock_file_type_ttl’
oc_files_lock: unexpected index ‘idx_oc_files_lock_file_user’
oc_files_lock: unexpected index ‘idx_oc_files_lock_type’
oc_files_lock: unexpected index ‘idx_oc_files_lock_user_id’
oc_share_external: column ‘id’ differs in: autoincrement
oc_text_steps: unexpected index ‘text_steps_doc_id_id_index’
Disabled apps (not affecting exit code):
If the schema for a disabled app differs from what is expected, this might indicate the app was updated
since it was disabled. Missing migrations will be applied once the app is enabled again.
app_api:
- missing table ‘oc_ex_apps_talk_bots’
- oc_ex_ui_files_actions: missing column ‘default_action’
richdocuments:
**- oc_richdocuments_wopi: missing index ‘rd_wopi_expiry_idx’

**

when i use :

i have a 403,
when i look the debug i have :
{“message”:“Password confirmation is required”}
i suppose need to write my admin nextcloud password ?
if yes howto do ?

Yes, after upgrade from v34 to v35 I got the following:

$ occ db:schema:check -v

missing table ‘oc_federated_invites’
unexpected table ‘oc_privatedata’
unexpected table ‘oc_calendar_appt_bookings’
unexpected table ‘oc_music_ampache_users’
unexpected table ‘oc_news_feeds’
unexpected table ‘oc_music_albums’
unexpected table ‘oc_ex_translation_q’
unexpected table ‘oc_ex_speech_to_text_q’
unexpected table ‘oc_audioplayer_stats’
unexpected table ‘oc_music_cache’
unexpected table ‘oc_music_tracks’
unexpected table ‘oc_retention’
unexpected table ‘oc_ex_speech_to_text’
unexpected table ‘oc_calendar_appt_configs’
unexpected table ‘oc_news_items’
unexpected table ‘oc_ex_text_processing_q’
unexpected table ‘oc_music_playlists’
unexpected table ‘oc_music_ampache_sessions’
unexpected table ‘oc_audioplayer_tracks’
unexpected table ‘oc_audioplayer_genre’
unexpected table ‘oc_audioplayer_playlists’
unexpected table ‘oc_preferences_ex’
unexpected table ‘oc_audioplayer_albums’
unexpected table ‘oc_music_artists’
unexpected table ‘oc_appconfig_ex’
unexpected table ‘oc_news_folders’
unexpected table ‘oc_ex_event_handlers’
unexpected table ‘oc_audioplayer_streams’
unexpected table ‘oc_ex_text_processing’
unexpected table ‘oc_file_metadata’
unexpected table ‘oc_ex_translation’
unexpected table ‘oc_audioplayer_playlist_tracks’
unexpected table ‘oc_ocm_token_map’
unexpected table ‘oc_audioplayer_artists’
oc_groups: column ‘displayname’ differs in: default
oc_authtoken: column ‘name’ differs in: default
oc_accounts: column ‘data’ differs in: default
oc_calendarobjects: column ‘classification’ differs in: comment
oc_federated_reshares: column ‘remote_id’ differs in: comment
oc_trusted_servers: column ‘url’ differs in: comment
oc_trusted_servers: column ‘url_hash’ differs in: comment
oc_trusted_servers: column ‘token’ differs in: comment
oc_trusted_servers: column ‘shared_secret’ differs in: comment
oc_trusted_servers: column ‘status’ differs in: comment
oc_trusted_servers: column ‘sync_token’ differs in: comment
oc_share_external: column ‘id’ differs in: autoincrement
oc_share_external: column ‘remote’ differs in: comment
oc_share_external: column ‘password’ differs in: comment
oc_share_external: column ‘name’ differs in: comment
oc_share_external: column ‘owner’ differs in: comment
oc_share_external: column ‘user’ differs in: comment
oc_share_external: column ‘mountpoint’ differs in: comment
oc_share_external: column ‘mountpoint_hash’ differs in: comment
oc_talk_rooms: column ‘description’ differs in: default
oc_text_sessions: column ‘last_awareness_message’ differs in: default
oc_flow_checks: column ‘class’ differs in: default
oc_flow_checks: column ‘operator’ differs in: default
oc_flow_checks: column ‘hash’ differs in: default
oc_flow_operations: column ‘class’ differs in: default
oc_flow_operations: column ‘name’ differs in: default
oc_flow_operations: column ‘entity’ differs in: default
oc_flow_operations: column ‘events’ differs in: default
Disabled apps (not affecting exit code):
If the schema for a disabled app differs from what is expected, this might indicate the app was updated since it was disabled. Missing migrations will be applied once the app is enabled again.
app_api:

  • missing table ‘oc_ex_apps_talk_bots’
  • oc_ex_ui_files_actions: missing column ‘default_action’
    activity:
  • oc_activity: missing index ‘activity_filter’
  • oc_activity: missing index ‘activity_object_user’
  • oc_activity: unexpected index ‘activity_filter_app’
  • oc_activity: unexpected index ‘activity_time’
  • oc_activity_mq: missing column ‘object_type’
  • oc_activity_mq: missing column ‘object_id’
  • oc_activity_mq: column ‘amq_appid’ differs in: length
  • oc_activity_mq: column ‘amq_subjectparams’ differs in: type, length, nullable
  • oc_activity_mq: missing index ‘amp_user_send’
  • oc_activity_mq: unexpected index ‘amp_user’
    user_status:
  • oc_user_status: missing column ‘is_backup’
  • oc_user_status: missing column ‘status_message_timestamp’
  • oc_user_status: missing index ‘user_status_mtstmp_ix’

This is exactly what I came looking for. Earlier, I saw Nextcloud 35 was listed as an upgrade for Arch, and I added an ignore line in pacman.conf until this issue is sorted out. I’ve got years of data in the MariaDB (MySQL) database, and this looks significant enough to hold the update until it is resolved.

Thankfully, there are no reports of data loss/corruption for the most part. I’ve updated to every version since Nextcloud 25, and there have been no database issues in any prior upgrade, so it appears the database update part of the NC 35 install needs to be revisited.

The problem is well known in the bug tracker and worked on. Please follow up there. You can give it a thumbs up on the original post. Only contribute if you have additional information to help to solve the problem.

Here is the bug report: [Bug]: User-key server-side encryption fails on /remote.php/dav/files/ WebDAV endpoint in NC 35 (works on legacy /webdav/) · Issue #64601 · nextcloud/server · GitHub

Understood.

Rather than wait, I deleted my prior (failed) installation and redeployed with v35. What’s interesting is that docker shows new updated containers available, but the web admin panel shows no updates. Would you say it’s safe to proceed?