(nicht geleöst aber erledigt) Update zu NC 24 verliert die Datenbank

"Hi, seit ein par Wochen scheint NC 24 verfügbar zu sein. Leider schiest sich meine Installation jedes mal ab wenn ich von 23.0.4 auf 24.0.0 updaten will.

Screenshot 2022-05-21 175723

"Die genaue Fehlerursache liegt wahrscheinlich irgendwo in diesem LOG, ich verstehe es bloß nicht:
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":0,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from 23.0.4.1 to 24.0.0.12","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair MySQL collation","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::info: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: All tables already have the correct collation -> nothing to do","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair SQLite autoincrement","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:52+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Copy data from accounts table when migrating from ownCloud","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:53+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:53+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Drop account terms table when migrating from ownCloud","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:53+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::dbUpgradeBefore: Updating database schema","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":3,"time":"2022-05-21T17:22:54+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Database error when running migration 24000Date20211222112246 for app core\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","userAgent":"--","version":"23.0.4.1","exception":{"Exception":"Exception","Message":"Database error when running migration 24000Date20211222112246 for app core\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Updater.php","line":315,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":254,"function":"doCoreUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":235,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":99,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/MigrationService.php","Line":429,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\ConnectionLost","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1067,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1809,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":175,"function":"query","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":76,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":582,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":540,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":425,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":315,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":254,"function":"doCoreUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":235,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":99,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":101,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":87,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1062,"function":"query","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1809,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":175,"function":"query","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":76,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":582,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":540,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":425,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":315,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":254,"function":"doCoreUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":235,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":99,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":"HY000","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":82,"function":"query","class":"PDO","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1062,"function":"query","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1809,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":175,"function":"query","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":76,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":582,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":540,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":425,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":315,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":254,"function":"doCoreUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":133,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":235,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":99,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","Line":82}}},"CustomMessage":"Database error when running migration 24000Date20211222112246 for app core\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away"}}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":3,"time":"2022-05-21T17:22:54+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: Exception: Database error when running migration 24000Date20211222112246 for app core\nAn exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":3,"time":"2022-05-21T17:22:54+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:54+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"23.0.4.1"}
{"reqId":"zF1QJtBv2NasS6ksqZlY","level":1,"time":"2022-05-21T17:22:54+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"23.0.4.1"}

Die Datei my.cnf enthält bereits max_allowed_packet= 1024M & wait_timeout = 28800

Meine NC läuft als VM auf einem NAS, ich habe nach der Anleitung von Decatec installiert und das ganze ist über eine Subdomain eines DynDNS Service zu erreichen.

Die wichtigsten Pakete müssten sein:
  • Ubuntu: 20.04 LTS
  • PHP: 7.4
  • MariaDB: 15.1
  • NGINX: 1.18.0
  • der Rest: was was halt gerade Aktuell ist. die Paketversionen ändern sich ja mit der Zeit.
Ich habe das Problem mit dem größtmöglich Aufwand umgangen

Das Thema hat sich für mich erledigt da ich den Server komplett neu augesetzt habe udn dabei auf PostgroSQL umgestiegen bin nach dieser Anleitung.

Hallo,
vor diesem Problem stand ich gerade auch. Ich weiß nicht genau warum, aber meine DB-Tabelle oc_comments schien kaputt zu sein.

Schau mal in /var/log/mysql/error.log, da müsste ein ziemlich langer Stack Trace drin sein, der dir an irgend einer Stelle auch verrät, welcher SQL Query das Problem war, bei mir zum Beispiel so:

Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f2008011940): ALTER TABLE oc_comments ADDreactionsVARCHAR(200) NULL DEFAULT NULL AFTERreference_id
Ich habe dann einfach mal testweise die ganze Tabelle oc_comments exportiert, gelöscht und wieder importiert, das Update lief danach durch.

das sieht bei mir ganz ähnlich aus

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f5be400b400): ALTER TABLE oc_comments ADD reactions VARCHAR(4000) DEFAULT NULL

könntest du das bitte etwas genauer beschreiben? ich blick da schlicht nicht durch

1 Like

sonst vorher vielleicht einfach über occ versuchen die datenbank zu reparieren?

einfach in der cli “occ” angeben (ist vermutlich im pfad, ansonsten befindet sich diese meist im hauptverzeichnis der “www” dateien.
Da hast du dann eine kleine Hilfe und unter database: wirst du ein paar befehle sehen die selbsterklärend sind.

good luck, ich warte mit dem upgrade lieber noch :stuck_out_tongue:

Das habe ich versucht, die Reparatur lief ohne Fehler durch, das Problem ist aber geblieben. Ich habe daher gedacht, es sei eher ein MariaDB-Problem, aber wenn reihner_zu_fall das Problem mit derselben Tabelle hat, ist das wohl eher kein Zufall…

Klar! Nur vorab: Ich bin jetzt auch kein Vollprofi in Sachen MariaDB/Nextcloud - vorher auf jeden Fall ein Backup der gesamten DB machen. Folgeprobleme habe ich aber bisher nicht feststellen können, seit dem Update läuft Nextcloud normal :wink:

Falls du phpmyadmin installiert hast:

  • Tabelle oc_comments im linken Baum anklicken
  • Oben Reiter “exportieren” auswählen
  • Standardeinstellungen belassen, “Ok” → Eine oc_comments.sql wird heruntergeladen, die wird gleich für den Import wieder benötigt
  • Oben Reiter “Operationen” und ganz unten “Tabelle löschen (DROP)” auswählen. Etwaige Meldungen bestätigen. Die Tabelle oc_comments sollte danach weg sein.
  • Reiter “Importieren” oben. Im oberen Bereich auf “Durchsuchen”, die oc_comments.sql auswählen. Alle Einstellungen belassen und auf “Ok”

(Meine Screenshots konnte ich leider aus einem mir unbekannten Grund nicht hier hochladen).
Danach lief das Upgrade bei mir normal durch.
Falls du kein phpmyadmin hast, kann ich dir auch gern die Befehle direkt auf der SQL-Konsole nennen.

Ich bin mir nicht sicher, ob ich dadurch nur ein Symptom bekämpft und das ursprüngliche Problem nicht geblickt habe, bei mir hat es aber geholfen.

Wenn du dir aber unsicher bist, teile ich die Meinung von nextcloud-cli, das Löschen von Tabellen kann natürlich auch zur Zerstörung führen, wenn man nicht genau weiß, an welcher Stelle man gerade löscht:

Ich hatte ebenfalls den crashenden Mariadb 10.3 server im Upgrade von Nextcloud 23.0.6 zu 24.0.2 mit

Exception: Database error when running migration 24000Date20211222112246 for app core
An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Update failed

im Terminal bzw. mit

2022-06-27 10:28:51 0x7f7d45830700  InnoDB: Assertion failure in file /build/mariadb-10.3-AwHSs6/mariadb-10.3-10.3.34/storage/innobase/dict/dict0mem.cc line 143
InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
...
Query (0x7f7cec00f8d0): ALTER TABLE oc_comments ADD reactions VARCHAR(4000) DEFAULT NULL

Auf den Hinweis oben habe ich meine oc_comments mit mysqldump gesichert, die Tabelle gelöscht und den dump wieder importiert (Achtung: ihr macht das natürlich auf eigene Gefahr). Datenbankname bei mir nextcloud - müsst ihr gegebenenfalls anpassen!

# in einer normalen shell
mysqldump nextcloud oc_comments --result-file=/tmp/oc_comments.sql

# in einer mysql/mariadb shell
use nextcloud;
drop table oc_comments;
source /tmp/oc_comments.sql

Darauf hin hatte ich Probleme mit

ALTER TABLE oc_mounts ADD mount_provider_class VARCHAR(128) DEFAULT NULL

also habe ich das gleiche Prozedere mit der Tabelle gemacht:

# normale shell
mysqldump nextcloud oc_mounts --result-file=/tmp/oc_mounts.sql

# mysql/mariadb shell
use nextcloud;
drop table oc_mounts;
source /tmp/oc_mounts.sql;

Danach lief occ upgrade bei mir durch.