Upgraded Nextcloud to 1.3.0, now stuck in maintenance mode

NethServer Version: 8.current
Module: Nextcloud

Logged into the cluster admin page today and saw seven updates available, including Core to 3.4.1 and Nextcloud 1.3.0. Ran all the updates, and now Nextcloud is stuck in maintenance mode. I can log into the shell and run runagent -m nextcloud1 occ maintenance:mode --off (as a side point, the punctuation for the occ command is completely nonsensical), and that disables maintenance mode, but instead shows this:

OK, run occ upgrade, right? That fails too:

[nextcloud][no app in context][3] {"reqId":"bglWku700DmYPSVuDao5","level":3,"time":"2025-01-15T14:42:47+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"{\"Exception\":\"InvalidArgumentException\",\"Message\":\"Index name \\\"nid\\\" for table \\\"oc_social_3_stream\\\" collides with the constraint on table \\\"oc_social_3_cache_actor\\\".\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/lib/private/DB/MigrationService.php\",\"line\":443,\"function\":\"ensureUniqueNamesConstraints\",\"class\":\"OC\\\\DB\\\\MigrationService\",\"type\":\"->\",\"args\":[{\"__class__\":\"Doctrine\\\\DBAL\\\\Schema\\\\Schema\"},true]},{\"file\":\"/var/www/html/lib/private/DB/MigrationService.php\",\"line\":401,\"function\":\"migrateSchemaOnly\",\"class\":\"OC\\\\DB\\\\MigrationService\",\"type\":\"->\",\"args\":[\"latest\"]},{\"file\":\"/var/www/html/lib/private/Installer.php\",\"line\":574,\"function\":\"migrate\",\"class\":\"OC\\\\DB\\\\MigrationService\",\"type\":\"->\",\"args\":[\"latest\",true]},{\"file\":\"/var/www/html/lib/private/Installer.php\",\"line\":532,\"function\":\"installShippedApp\",\"class\":\"OC\\\\Installer\",\"type\":\"::\",\"args\":[\"files_downloadlimit\",null]},{\"file\":\"/var/www/html/lib/private/Updater.php\",\"line\":282,\"function\":\"installShippedApps\",\"class\":\"OC\\\\Installer\",\"type\":\"::\",\"args\":[true]},{\"file\":\"/var/www/html/lib/private/Updater.php\",\"line\":133,\"function\":\"doUpgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[\"29.0.10.1\",\"28.0.14.1\"]},{\"file\":\"/var/www/html/core/Command/Upgrade.php\",\"line\":216,\"function\":\"upgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Command/Command.php\",\"line\":298,\"function\":\"execute\",\"class\":\"OC\\\\Core\\\\Command\\\\Upgrade\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":1040,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Command\\\\Command\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":301,\"function\":\"doRunCommand\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Command\\\\Upgrade\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/var/www/html/3rdparty/symfony/console/Application.php\",\"line\":171,\"function\":\"doRun\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/var/www/html/lib/private/Console/Application.php\",\"line\":213,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/var/www/html/console.php\",\"line\":102,\"function\":\"run\",\"class\":\"OC\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/occ\",\"line\":11,\"args\":[\"/var/www/html/console.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/html/lib/private/DB/MigrationService.php\",\"Line\":691,\"message\":\"Index name \\\"nid\\\" for table \\\"oc_social_3_stream\\\" collides with the constraint on table \\\"oc_social_3_cache_actor\\\".\",\"exception\":{},\"CustomMessage\":\"Index name \\\"nid\\\" for table \\\"oc_social_3_stream\\\" collides with the constraint on table \\\"oc_social_3_cache_actor\\\".\"}","userAgent":"--","version":"28.0.14.1"}
InvalidArgumentException: Index name "nid" for table "oc_social_3_stream" collides with the constraint on table "oc_social_3_cache_actor".
[nextcloud][updater][3] {"reqId":"bglWku700DmYPSVuDao5","level":3,"time":"2025-01-15T14:42:47+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: InvalidArgumentException: Index name \"nid\" for table \"oc_social_3_stream\" collides with the constraint on table \"oc_social_3_cache_actor\".","userAgent":"--","version":"28.0.14.1","data":{"app":"updater"}}
Update failed

Apparently some leftover database tables from the Social app, even though I didn’t have it installed. Per this post, dropping all the database tables beginning with oc_social_3 and oc_social allowed the upgrade to complete.

2 Likes