Messed up DB after upgrading to v35.0.1.1

I converted from mariadb to mysql in v34 and everything was working just fine, so I updated to v35 and now suddenly I get an internal server error on the UI and the schema check is full of errors:

missing table 'oc_federated_invites'
unexpected table 'oc_ex_event_handlers'
unexpected table 'oc_ex_speech_to_text'
unexpected table 'oc_ex_speech_to_text_q'
unexpected table 'oc_ex_text_processing'
unexpected table 'oc_ex_text_processing_q'
unexpected table 'oc_ex_translation'
unexpected table 'oc_ex_translation_q'
unexpected table 'oc_file_metadata'
unexpected table 'oc_maps_address_geo'
unexpected table 'oc_maps_apikeys'
unexpected table 'oc_maps_device_points'
unexpected table 'oc_maps_device_shares'
unexpected table 'oc_maps_devices'
unexpected table 'oc_maps_favorite_shares'
unexpected table 'oc_maps_favorites'
unexpected table 'oc_maps_photos'
unexpected table 'oc_maps_tracks'
unexpected table 'oc_richdocuments_assets'
unexpected table 'oc_richdocuments_direct'
unexpected table 'oc_richdocuments_template'
unexpected table 'oc_richdocuments_wopi'
oc_activity: missing index 'activity_object'
oc_bookmarks: column 'url' differs in: type, default
oc_bookmarks: column 'title' differs in: type, default
oc_bookmarks: column 'description' differs in: type, default
oc_bookmarks_folders: column 'title' differs in: type, default
oc_bookmarks_folders_public: column 'description' differs in: type, default
oc_share_external: column 'id' differs in: autoincrement
oc_group_folders: unexpected index 'gf_folders_folder_id'
oc_mail_accounts: column 'signature' differs in: default
oc_mail_accounts: unexpected index 'mail_acc_prov_idx'
oc_mail_coll_addresses: missing index 'mail_coll_addr_userid_index'
oc_mail_coll_addresses: missing index 'mail_coll_addr_email_index'
oc_mail_coll_addresses: unexpected index 'mail_coll_idx'
oc_mail_aliases: column 'signature' differs in: default
oc_mail_aliases: unexpected index 'mail_alias_accid_idx'
oc_mail_messages: missing index 'mail_messages_mb_id_uid'
oc_mail_messages: unexpected index 'mail_messages_mb_id_uid_uidx'
oc_mail_messages: unexpected index 'mail_messages_strucanalyz_idx'
oc_mail_trusted_senders: missing index 'mail_trusted_senders_type'
oc_mail_trusted_senders: unexpected index 'mail_trusted_senders_idx'
oc_mail_smime_certificates: missing index 'mail_smime_certs_uid_idx'
oc_mail_smime_certificates: unexpected index 'mail_smime_certs_uid_email_idx'
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.
  news:
    - missing table 'oc_news_filters'
    - oc_news_feeds: missing column 'next_update_time'
    - oc_news_feeds: column 'title' differs in: nullable
    - oc_news_feeds: missing index 'news_feeds_deleted_at_index'
    - oc_news_items: missing column 'filtered'

How would I go about fixing that?
I also saw this so is this a v35 problem or a me problem? DropFederatedInvitesTable repair step in cloud_federation_api removes federated_invites table now owned by contacts · Issue #64487 · nextcloud/server · GitHub

There is already a bug report, please follow up there (they link the fix, and you can see which release will contain the fix, or you can apply it manually):

Thanks, had not stumbled on that one when looking.

I assume you mean “they will link the fix” or did I miss something and there’s already a fix?
The only people who I see fixed it seems to have had different errors.

Having the same problem I went through https://github.com/nextcloud/server/issues/64505

It explains almost all issues (including the missing index that does not get created with add-missing-indices!), it fails to explain a missing table:

$ php occ db:add-missing-indices && php occ db:schema:check | grep missing
missing table 'oc_federated_invites'
oc_activity: missing index 'activity_object'

So according to the Bug-report above both are due to disabled apps that the checker still checks for.

So I ask which apps are using those two tables?

$ php occ app:list --disabled
Disabled:
  - admin_audit: 2.0.0-dev.0
  - encryption: 3.0.0-dev.0
  - files_external: 2.0.0-dev.0 (installed 2.0.0-dev.0)
  - suspicious_login: 13.0.0
  - twofactor_nextcloud_notification: 9.0.0
  - user_ldap: 2.0.0-dev.0

None of these apps appear to be related to either, and if, how can I see which one is?

In particular, all “federation” apps are enabled:

$ php occ app:list --enabled | grep fed
  - cloud_federation_api: 2.0.0-dev.0
  - federatedfilesharing: 2.0.0-dev.1
  - federation: 2.0.0-dev.0

so why is the table 'oc_federated_invites' missing, and what breaks without that table?

This is quite frustrating. In the meantime the server appears to be running w/o further errors (no additional errors in the logs), but that kind of thing is the opposite of quality.

In the meantime the GUI complains about a missing index that is not even mentioned by the occ command:

Tables scanning sequentially

Notice ·pg.tables_without_index_use

Failing

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

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

  • oc_mimetypes

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

so why is the table 'oc_federated_invites' missing, and what breaks without that table?

Some things were fixed with the next point release 35.0.2 which is available as release candidate (RCs of 35.0.2, 34.0.5, 33.0.10) and will be available in 3 days. I’d either test the release candidate or wait another 3 days.