[fixed] Upgrade 28.0.0 stable ... is NOT stable - was broken index data from old "Social APP"

My Auto-Update Script has Updated my two NC Instances to 28.0.0 stable via OCC upgrade

on my VM where NC runs on PostgreSQL the update completes, but several APPs are disabled due to “unsupported” status - so far so … well … ok. but on Safari the Web UI is broken. No vertical scrolling is possible :frowning:

On my other NV Instance running on a webspace with mariaDB the upgrade breaks and failed.

Index name “nid” for table “oc_social_3_stream” collides with the constraint on table “oc_social_3_cache_actor”.
Update failed

no
occ db:add-missing-indices
occ maintenance:repair
occ app:update --all
or
occ upgrade

doesn’t fixes this issue

[/details]

Nextcloud version (eg, 20.0.5): 28.0.0 (upgrading from 27.1.4) stable
Operating system and version (eg, Ubuntu 20.04): Debian 12 // Redhat
Apache or nginx version (eg, Apache 2.4.25): NGINX // Apache
PHP version (eg, 7.4): php8.2

The issue you are facing:
upgrade stuck on mariaDB → stuck in maintenance / upgrade loop
upgrade done on PostgreSQL → stuck UI not scrolling Problem → unusable

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

Steps to replicate it:

  1. upgrade to 28.0.0
  2. use safari / desktop

The output of your Nextcloud log in Admin > Logging:

Can't access

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

 'dbtype' => 'mysql',
  'version' => '27.1.4.1',
  'overwrite.cli.url' => 'http://someurl',
  'dbname' => 'somenextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'somenextcloud',
  'dbpassword' => 'somepw',
  'installed' => true,
  'maintenance' => true,
  'theme' => '',
  'default_locale' => 'de',
  'default_phone_region' => 'DE',
  'allow_user_to_change_display_name' => true,
  'trashbin_retention_obligation' => 'auto, 1',
  'loglevel' => 2,
  'mail_smtpmode' => 'sendmail',
  'mail_smtpsecure' => 'ssl',
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'checksum',
    1 => 'apporder',
    2 => 'whiteboard',
    3 => 'flowupload',
    4 => 'news',
    5 => 'files_markdown',
    6 => 'tasks',
    7 => 'documentserver_community',
    8 => 'onlyoffice',
    9 => 'epubreader',
    10 => 'polls',
    11 => 'forms',
    12 => 'ransomware_protection',
    13 => 'gpxmotion',
  ),

1 Like

Not a good idea imho.

I’m confused. Are you still stuck in maintainance mode on that instance or not? Because earlier in your post you wrote the following:

occ db:add-missing-indices
occ maintenance:repair
occ app:update --all
or
occ upgrade

fixes this issue

Looks like you’re not the only one experiencing this issue:

https://help.nextcloud.com/t/version-28-0-0-11-safari-issues/176528

I guess someone should file a bug report on GitHub, if no one has already done so.

If you go to the admin menu, it shows you which of the apps are not compatible with the new major version. Many apps are from volunteers and each of them needs to update, we try to anticipate and motivate people to help out and test:

What you can do:
if you have automatized your backups as well, you can perhaps revert to the previous version easily and check out the apps you are using first.
If not, you can try to disable these apps, and check if they are working on a version for NC28 and once they are released you can activate them again.

nothing fixes the issue

the NO was several lines above … bad formating on my post - I updated it to make it way less irritating.

I’m stuck on the upgrade loop on the instance with mariaDB.
the web updater keeps trying to install the 28.0.0 and fails.
currently I activated the maintenance mode to prevent others to try to update it.

is there a possibility to unto the web update trigger?
if I disable the maintenance mode the web updater shows up again.

php82 occ db:add-missing-indices

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

occ maintenance:repair
runs - all green

  • Repair MySQL collation
    • All tables already have the correct collation → nothing to do

occ app:update --all

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

occ upgrade

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Exception: Database error when running migration 28000Date20230906104802 for app core
Index name “nid” for table “oc_social_3_stream” collides with the constraint on table “oc_social_3_cache_actor”.
Update failed
Maintenance mode is kept active
Resetting log level

The NC Instance (PostgreSQL) that updated to 28.0.0 but was unusable runs on a VM - I rolled back that VM and I’m back at 27.1.4 - with runs fine.

Try to disable the Social app and then start the upgrade again:

occ app:disable social

occ upgrade

the social app is currently not enabled

occ app:disable social

No such app enabled: social

occ app:list

Enabled:

  - calendar: 4.6.0
  - calendar_resource_management: 0.6.0
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.5.0
  - contactsinteraction: 1.8.0
  - cospend: 1.5.12
  - dav: 1.27.0
  - documentserver_community: 0.1.13
  - eidlogin: 1.0.15
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_markdown: 2.4.1
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - flowupload: 1.1.3
  - guests: 2.5.1
  - integration_mastodon: 2.0.3
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.9.0
  - oauth2: 1.15.1
  - onlyoffice: 8.2.4
  - password_policy: 1.17.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - workflowengine: 2.9.0

Disabled:

  - activity: 2.20.0 (installed 2.17.0)
  - admin_audit: 1.18.0
  - analytics: 4.12.0 (installed 4.12.0)
  - appointments: 1.15.4 (installed 1.15.4)
  - apporder: 0.15.0 (installed 0.15.0)
  - bruteforcesettings: 2.8.0 (installed 2.4.0)
  - checksum: 1.2.2 (installed 1.2.2)
  - dashboard: 7.8.0 (installed 7.1.0)
  - deck: 1.11.2 (installed 1.11.2)
  - encryption: 2.16.0
  - files_3d: 0.5.0 (installed 0.5.0)
  - files_external: 1.20.0
  - flow_notifications: 1.7.0 (installed 1.7.0)
  - forms: 3.4.3 (installed 3.4.3)
  - gpxmotion: 0.1.0 (installed 0.1.0)
  - gpxpod: 5.0.13 (installed 5.0.13)
  - groupfolders: 15.3.1 (installed 15.3.1)
  - integration_moodle: 1.0.2 (installed 1.0.2)
  - keeweb: 0.6.13 (installed 0.6.13)
  - maps: 1.2.0 (installed 1.2.0)
  - news: 24.0.0 (installed 24.0.0)
  - notifications: 2.16.0 (installed 2.13.1)
  - photos: 2.4.0 (installed 1.2.0)
  - polls: 5.4.2 (installed 5.4.2)
  - ransomware_protection: 1.14.0 (installed 1.14.0)
  - riotchat: 0.16.4 (installed 0.16.4)
  - shifts: 1.9.3 (installed 1.9.3)
  - social: 0.6.1 (installed 0.6.1)
  - spreed: 17.1.3 (installed 17.1.3)
  - survey_client: 1.16.0 (installed 1.14.0)
  - suspicious_login: 6.0.0
  - timemanager: 0.3.10 (installed 0.3.10)
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0
  - weather_status: 1.8.0 (installed 1.1.0)
  - whiteboard: 0.0.3 (installed 0.0.3)
  - workflow_ocr: 1.27.5 (installed 1.27.5)

Did you test the app at some point in time, and then uninstall it again?

I found this issue on GitHub where someone seem to have solved the issue by manually deleting all the associated tables in the database: https://github.com/nextcloud/server/issues/42173#issuecomment-1852004154

EDIT: Oh I see it’s installed but disabled. Maybe you can try to uninstall it first, and if that doesn’t help, try to remove the database tables…

Thanks for the hint.

I ended up with dropping the indexes of that tables the occ upgrade complains about and that lead to that failed update.

drop index from table

occ upgrade
Index name “in_reply_to_prim” for table “oc_social_stream” collides with the constraint on table “oc_social_3_stream”.
Update failed

drop the OTHER index from the OTHER table


one eternity later

one after another.

Update successful
Maintenance mode is kept active
Resetting log level

also ran
occ maintenance:repair

all green

occ db:add-missing-indices

nothing to do

occ app:update --all

some apps got updates

well that instance is on 28.0.0 for now and calendar and contacts seems to work for now
good enough for now

Thanks

1 Like

Glad it worked out. :slight_smile:

1 Like

Same Problem here :-/

Update of code successful.

Should the “occ upgrade” command be executed? [Y/n] Y
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Repair step: Repair MySQL collation
Repair info: All tables already have the correct collation → 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
Exception: Database error when running migration 28000Date20230906104802 for app core
Index name “nid” for table “oc_social_3_stream” collides with the constraint on table “oc_social_3_cache_actor”.
Update failed
Maintenance mode is kept active
Resetting log level

looks like my Problem - what wasn’t the Nextcloud Core but the old social APP.

If you don’t use the social app

delete it
try - deletes the social app

php occ app:remove social

try - deletes all config settings from that app

php occ config:app:delete social all

try the updater again

php occ upgrade

If you don’t use the social app

if the upgrade still fails

delete the database tables oc_social_3_* and oc_social_*

or do it step by step - index by index if you try to save the social app data - if any exist

Index name “nid” for table “oc_social_3_stream” collides with the constraint on table “oc_social_3_cache_actor”.

so drop the index “nid” for table “oc_social_3_stream”
re-run the updater - look at the next broken index
and drop the next index for that social plugin table
in my case there where ±20 broken indexes to drop until the updater runs flawless

what damage one beta app can do…

The “[…] collides with constraint on table […]” is being tracked here in case anyone is curious. No need to open a new bug report:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.