The Basics
- Nextcloud Server version (e.g., 29.x.x):
35.0.1.1
- Operating system and version (e.g., Ubuntu 24.04):
FreeBSD 15.1
- Web server and version (e.g, Apache 2.4.25):
apache 2.4.x
- Reverse proxy and version _(e.g. nginx 1.27.2)
n/a
- PHP version (e.g, 8.3):
8.3
- Is this the first time you’ve seen this error? (Yes / No):
yes
- When did this problem seem to first start?
when upgrading from NC34 to NC35
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
bare metal
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Summary of the issue you are facing:
php updater/updater.phar worked fine, but occ upgrade reported database errors.
according to issue 64505 some are due to apps being disabled before upgrade (still: App removal SHOULD remove those as well!)
But there there are serious errors not related to disabled apps:
missing table 'oc_federated_invites'
oc_activity: missing index 'activity_object'
oc_share_external: column 'id' differs in: autoincrement
These indicate missing/incorrect upgrade scripts withing the NC35 release.
What do I need to do to fix these?
Steps to replicate it (hint: details matter!):
-
Use NC prior to version 35, deploy apps, disable and uninstall apps etc.
-
Update NC to version 35
Log entries
The update part:
$ php updater/updater.phar
Nextcloud Updater - version: v34.0.0rc2-5-g713ccce
Current version is 34.0.4.
Update to Nextcloud 35.0.1 available. (channel: "stable")
Following file will be downloaded automatically: https://github.com/nextcloud-releases/server/releases/download/v35.0.1/nextcloud-35.0.1.zip
Open changelog ↗
Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done
Start update? [y/N] y
Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done
Update of code successful.
Should the "occ upgrade" command be executed? [Y/n]
The occ upgrade part:
Setting log level to debug
Repair step: Repair MySQL collation
Repair info: Not a mysql database -> nothing to do
Repair step: Copy data from accounts table when migrating from ownCloud
Repair step: Drop account terms table when migrating from ownCloud
Updating database schema
Updated database
Updating <federation> ...
Updated <federation> to 2.0.0-dev.0
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 2.0.0-dev.0
Updating <oauth2> ...
Repair step: Update OAuth token expiration times
Updated <oauth2> to 2.0.0-dev.0
Updating <password_policy> ...
Updated <password_policy> to 7.0.0
Updating <photos> ...
Repair step: init metadata
Updated <photos> to 8.0.0
Updating <activity> ...
Updated <activity> to 8.0.0
Updating <circles> ...
Repair step: Upgrading Circles App
Repair step: Sync groups with their circles
Updated <circles> to 35.0.0
Updating <cloud_federation_api> ...
Repair step: Conditionally drop the federated_invites table
federated_invites does not existUpdated <cloud_federation_api> to 2.0.0-dev.0
Updating <dav> ...
Repair step: Fix component of birthday calendars
Repair info: 3 birthday calendars updated.
Repair step: Regenerating birthday calendars to use new icons and fix old birthday events without year
Repair info: Repair step already executed
Repair step: Fix broken values of calendar objects
Fix broken values of calendar objects
Starting ...
0/0 [>---------------------------] 0%
Repair step: Registering building of calendar search index as background job
Repair info: Repair step already executed
Repair step: Register building of social profile search index as background job
Repair info: Repair step already executed
Repair step: Disable system address book
Repair info: Skipping repair step system address book has less than the threshold 5000 of contacts no need to disable
Repair step: Registering background jobs to update cache for webcal calendars
Repair info: Added 0 background jobs to update webcal calendars
Repair step: Registering building of calendar reminder index as background job
Repair info: Repair step already executed
Repair step: Register a background job to update rooms and resources
Repair step: Queue jobs to clean up orphan event and contact data
Repair step: Remove activity entries of private events
Repair step: Clean up old calendar subscriptions from deleted users that were not cleaned-up
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Starting ...
0/0 [->--------------------------] 0%
Repair info: 0 calendar subscriptions without an user have been cleaned up
Updated <dav> to 2.0.0-dev.1
Updating <files> ...
Updated <files> to 3.0.0-dev.0
Updating <files_lock> ...
Updated <files_lock> to 35.0.0
Updating <files_sharing> ...
Repair step: Fix the share type of guest shares when migrating from ownCloud
Repair step: Copy the share password into the dedicated column
Repair step: Set existing shares as accepted
Updated <files_sharing> to 2.0.0-dev.1
Updating <files_trashbin> ...
Updated <files_trashbin> to 2.0.0-dev.0
Updating <files_versions> ...
Updated <files_versions> to 2.0.0-dev.0
Updating <sharebymail> ...
Updated <sharebymail> to 2.0.0-dev.0
Updating <webhook_listeners> ...
Updated <webhook_listeners> to 2.0.0-dev.0
Updating <workflowengine> ...
Repair step: Populating added database structures for workflows
Updated <workflowengine> to 3.0.0-dev.0
Updating <comments> ...
Updated <comments> to 2.0.0-dev.0
Updating <logreader> ...
Updated <logreader> to 8.0.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 7.0.0
Updating <notifications> ...
Updated <notifications> to 8.0.0
Updating <systemtags> ...
Updated <systemtags> to 2.0.0-dev.0
Updating <theming> ...
Repair step: Initialize migration of background images from dashboard to theming app
Updated <theming> to 3.0.0-dev.0
Updating <app_api> ...
Repair step: AppAPI Daemons configuration GPU params update
Repair info: Daemons configuration GPU params updated: 0
Updated <app_api> to 35.0.0
Updating <appstore> ...
Updated <appstore> to 2.0.0-dev.0
Updating <bruteforcesettings> ...
Updated <bruteforcesettings> to 8.0.0
Updating <contactsinteraction> ...
Updated <contactsinteraction> to 2.0.0-dev.0
Updating <dashboard> ...
Updated <dashboard> to 8.0.0-dev.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 2.0.0-dev.1
Updating <files_downloadlimit> ...
Updated <files_downloadlimit> to 5.3.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 8.0.0
Updating <files_reminders> ...
Updated <files_reminders> to 2.0.0-dev.0
Updating <firstrunwizard> ...
Updated <firstrunwizard> to 8.0.0
Updating <office> ...
Updated <office> to 1.1.0
Updating <privacy> ...
Updated <privacy> to 7.0.0
Updating <profile> ...
Updated <profile> to 2.0.0-dev.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 2.0.0-dev.0
Updating <recommendations> ...
Updated <recommendations> to 8.0.0
Updating <related_resources> ...
Updated <related_resources> to 6.0.0
Updating <serverinfo> ...
Updated <serverinfo> to 7.0.0
Updating <settings> ...
Updated <settings> to 2.0.0-dev.0
Updating <support> ...
Repair step: Switches from default updater server to the customer one if a valid subscription is available
Repair info: Repair step already executed
Repair step: Migrate some config values to lazy loading
Updated <support> to 7.0.0
Updating <survey_client> ...
Repair step: Send an admin notification if monthly report is disabled
Updated <survey_client> to 7.0.0
Updating <text> ...
Repair step: Force-reset all Text document sessions
Updated <text> to 9.0.0
Updating <twofactor_backupcodes> ...
Repair step: Add background job to check for backup codes
Updated <twofactor_backupcodes> to 2.0.0-dev.0
Updating <twofactor_totp> ...
Updated <twofactor_totp> to 17.1.0
Updating <updatenotification> ...
Updated <updatenotification> to 2.0.0-dev.0
Updating <user_status> ...
Updated <user_status> to 2.0.0-dev.0
Updating <viewer> ...
Updated <viewer> to 8.0.0
Updating <weather_status> ...
Updated <weather_status> to 2.0.0-dev.0
Repair step: Repair MySQL collation
Repair info: Not a mysql database -> nothing to do
Repair step: Clean tags and favorites
Repair info: 0 tags of deleted users have been removed.
Repair info: 0 tags for delete files have been removed.
Repair info: 0 tag entries for deleted tags have been removed.
Repair info: 0 tags with no entries have been removed.
Repair step: Repair invalid shares
Repair step: Move .step file of updater to backup location
Repair info: .step file exists
Repair info: .step-previous-update removed
Repair info: .step file moved to .step-previous-update
Repair step: Add move avatar background job
Repair info: Repair step already executed
Repair step: Add preview cleanup background jobs
Repair step: Migrate oc_properties table to nextcloud schema
Repair info: oc_properties table does not exist.
Repair step: Migrate oauth2_clients table to nextcloud schema
Repair info: Update the oauth2_access_tokens table schema.
Repair info: Update the oauth2_clients table schema.
Repair info: Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
Repair step: Repair language codes
Repair step: Add log rotate job
Repair step: Clear frontend caches
Repair info: Image cache cleared
Repair info: JS cache cleared
Repair step: Clear every generated avatar
Repair step: Add preview background cleanup job
Repair step: Queue a one-time job to cleanup old backups of the updater
Repair step: Cleanup invalid photocache files for carddav
Repair step: Add background job to cleanup login flow v2 tokens
Repair step: Remove potentially over exposing share links
Repair info: No need to remove link shares.
Repair step: Clear access cache of projects
Repair step: Reset generated avatar flag
Repair step: Keep legacy encryption enabled
Repair step: Check encryption key format
Repair step: Remove old dashboard app config data
Repair step: Add job to cleanup the bruteforce entries
Repair step: Queue a one-time job to check for user uploaded certificates
Repair step: Repair DAV shares
Repair step: Add background job to set the lookup server share state for users
Repair step: Add token cleanup job
Repair step: Clean up abandoned apps
Repair step: Add possibly missing system config
Repair step: Add AI tasks cleanup jobs
Repair step: Queue a job to generate metadata
Repair step: Cache logo dimension to fix size in emails on Outlook
Repair info: Theming is not used to provide a logo
Repair step: Remove legacy ".ocdata" file
Repair step: Add cleanup-deleted-users background job
Repair step: Add cleanup login tokens background job
Repair step: Validate account properties and store phone numbers in a known format for search
Repair info: Queued background to validate account properties.
Repair step: Queue a job to move the preview
Repair step: Migrate config keys
Repair step: Cleanup completed background jobs
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Resetting log level
The database schema does not match what is expected for the installed version:
- missing table 'oc_federated_invites'
- unexpected table 'oc_ex_speech_to_text_q'
- unexpected table 'oc_ex_speech_to_text'
- unexpected table 'oc_ex_translation_q'
- unexpected table 'oc_ex_translation'
- unexpected table 'oc_ex_text_processing_q'
- unexpected table 'oc_ex_text_processing'
- unexpected table 'oc_cloud_py_api_settings'
- unexpected table 'oc_ex_event_handlers'
- oc_filecache: unexpected index 'fs_storage_path_prefix'
- oc_filecache: unexpected index 'memories_parent_mimetype'
- oc_systemtag_object_mapping: unexpected index 'memories_type_tagid'
- 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'
- oc_facerecog_persons: column 'name' differs in: nullable
- oc_facerecog_images: column 'id' differs in: type
- oc_facerecog_images: column 'file' differs in: type
- oc_facerecog_faces: column 'image' differs in: type
Run "occ db:schema:check -v" for details.
"occ upgrade" finished
Keep maintenance mode active? [y/N] y
Please execute "./occ maintenance:mode --off" manually to finish the upgrade.
According to another bugreport (https://help.nextcloud.com/t/nextcloud-35-update-breaks-aio/250673 ) this is partly due to apps that are no longer active but still installed.
So I removed those apps:
php occ app:remove facerecognition
php occ app:remove mediadc
php occ app:remove cloud_py_api
But the problem only got worse:
$ php occ db:schema:check -vvv
missing table 'oc_federated_invites'
unexpected table 'oc_ex_speech_to_text_q'
unexpected table 'oc_ex_speech_to_text'
unexpected table 'oc_ex_translation_q'
unexpected table 'oc_ex_translation'
unexpected table 'oc_facerecog_images'
unexpected table 'oc_ex_text_processing_q'
unexpected table 'oc_mediadc_videos'
unexpected table 'oc_mediadc_tasks_details'
unexpected table 'oc_mediadc_tasks'
unexpected table 'oc_ex_text_processing'
unexpected table 'oc_mediadc_settings'
unexpected table 'oc_cloud_py_api_settings'
unexpected table 'oc_mediadc_photos'
unexpected table 'oc_facerecog_faces'
unexpected table 'oc_ex_event_handlers'
unexpected table 'oc_facerecog_persons'
unexpected table 'oc_facerecog_models'
oc_filecache: unexpected index 'fs_storage_path_prefix'
oc_filecache: unexpected index 'memories_parent_mimetype'
oc_systemtag_object_mapping: unexpected index 'memories_type_tagid'
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'
Settings
$ php occ config:list system
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"cloud.jors.net"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "pgsql",
"version": "35.0.1.1",
"overwrite.cli.url": "https:\/\/cloud.jors.net",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"memories.db.triggers.fcu": true,
"memories.exiftool_no_local": true,
"memories.vod.path": "\/usr\/local\/www\/apache24\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
"memories.vod.ffmpeg": "\/usr\/local\/bin\/ffmpeg",
"memories.vod.ffprobe": "\/usr\/local\/bin\/ffprobe",
"maintenance": false,
"default_phone_region": "DE",
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"theme": "",
"loglevel": 2,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtptimeout": 30,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"mail_smtpstreamoptions": {
"ssl": {
"allow_self_signed": true,
"verify_peer": false,
"verify_peer_name": false
}
},
"enabledPreviewProviders": [
"OC\\Preview\\Image",
"OC\\Preview\\HEIC",
"OC\\Preview\\TIFF"
],
"preview_max_x": 2048,
"preview_max_y": 2048,
"preview_max_memory": 1024,
"log_rotate_size": 10485760,
"serverid": 0
}
}
Apps
The output of occ app:list (if possible).
$ php occ app:list
Enabled:
- activity: 8.0.0
- app_api: 35.0.0
- appstore: 2.0.0-dev.0
- bruteforcesettings: 8.0.0
- calendar: 6.6.2
- circles: 35.0.0
- cloud_federation_api: 2.0.0-dev.0
- comments: 2.0.0-dev.0
- contacts: 8.9.1
- contactsinteraction: 2.0.0-dev.0
- cookbook: 0.11.11
- dashboard: 8.0.0-dev.0
- dav: 2.0.0-dev.1
- federatedfilesharing: 2.0.0-dev.1
- federation: 2.0.0-dev.0
- files: 3.0.0-dev.0
- files_downloadlimit: 5.3.0
- files_lock: 35.0.0
- files_pdfviewer: 8.0.0
- files_reminders: 2.0.0-dev.0
- files_sharing: 2.0.0-dev.1
- files_trashbin: 2.0.0-dev.0
- files_versions: 2.0.0-dev.0
- firstrunwizard: 8.0.0
- logreader: 8.0.0
- lookup_server_connector: 2.0.0-dev.0
- memories: 9.0.1
- music: 3.2.1
- nextcloud_announcements: 7.0.0
- notifications: 8.0.0
- oauth2: 2.0.0-dev.0
- office: 1.1.0
- password_policy: 7.0.0
- photos: 8.0.0
- previewgenerator: 5.15.0
- privacy: 7.0.0
- profile: 2.0.0-dev.0
- provisioning_api: 2.0.0-dev.0
- recommendations: 8.0.0
- related_resources: 6.0.0
- serverinfo: 7.0.0
- settings: 2.0.0-dev.0
- sharebymail: 2.0.0-dev.0
- sharing: 1.0.4
- support: 7.0.0
- survey_client: 7.0.0
- systemtags: 2.0.0-dev.0
- text: 9.0.0
- theming: 3.0.0-dev.0
- twofactor_backupcodes: 2.0.0-dev.0
- twofactor_totp: 17.1.0
- updatenotification: 2.0.0-dev.0
- user_status: 2.0.0-dev.0
- viewer: 8.0.0
- weather_status: 2.0.0-dev.0
- webhook_listeners: 2.0.0-dev.0
- workflowengine: 3.0.0-dev.0
Disabled:
- admin_audit: 2.0.0-dev.0
- encryption: 3.0.0-dev.0
- files_external: 2.0.0-dev.0
- suspicious_login: 13.0.0
- twofactor_nextcloud_notification: 9.0.0
- user_ldap: 2.0.0-dev.0