Upgrade to NC28 not possible. How to fix this issue?

Hello,

i tried to upgrade my instance to NC28 via Web interface. I got the following message:

Exception: Database error when running migration 28000Date20230906104802 for app core Index name “rd_wopi_token_idx” for table “oc_officeonline_wopi” collides with the constraint on table “oc_richdocuments_wopi”.
Detaillierte Protokollmeldungen

Update vorbereiten

Log-Level auf “debug” gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation → nothing to do

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Exception: Database error when running migration 28000Date20230906104802 for app core Index name “rd_wopi_token_idx” for table “oc_officeonline_wopi” collides with the constraint on table “oc_richdocuments_wopi”.

Das Update ist fehlgeschlagen. Bitte melde dieses Problem an die Nextcloud Community.

What can I do to fix this?

Thank you,
Schultze

Es gibt ein Konflikt bei der Erstellung von Indizes da du sowohl Nextcloud Office (richdocuments) als auch Office Online (officeonline) installiert hast (oder hattest).

Da Office Online eh (noch) nicht unter Nextcloud 28 funktioniert, gehe ich mal davon aus, dass du Nextcloud Office behalten möchtest.

Du brauchst für folgende Schritte Konsolenzugang und Zugang zu deiner Datenbank-Konsole und du solltest natürlich ein Backup der Datenbank erstellt haben:

  1. Enferne officeonline komplett:
occ app:remove officeonline
  1. Entferne die officeonline Tabellen aus der Datenbank:
DROP TABLE IF EXISTS nextcloud.oc_officeonline%;
  1. Starte das Update neu

english:

There is a conflict when creating indexes because you have (or had) both Nextcloud Office (richdocuments) and Office Online (officeonline) installed.

Since Office Online doesn’t work under Nextcloud 28 (yet), I’m assuming that you want to keep Nextcloud Office.

You need console access and access to your database console for the following steps:

  1. remove officeonline:
occ app:remove officeonline
  1. drop the officeonline tables from database:
DROP TABLE IF EXISTS nextcloud.oc_officeonline%;
  1. restart the update

That should solve your issue


Viel Glück,
ernolf

Hello ernolf,
thank you, for your response.
Unfortunately it seems not to help. I got this result:

sudo -u www-data php --define apc.enable_cli=1 /var/www/html/nextcloud/occ app:remove officeonline

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
officeonline is not installed

Schultze

OK. That is no problem, since officeonline will be disabled by the update process annyhow, so you can simply

  1. open database console and drop tables:

    DROP TABLE IF EXISTS nextcloud.oc_officeonline%;
    
  2. sudo -u www-data php -d apc.enable_cli=1 -d memory_limit=512M /var/www/html/nextcloud/updater/updater.phar
    
  3. sudo -u www-data php -d apc.enable_cli=1 /var/www/html/nextcloud/occ  app:remove officeonline
    
  4. sudo -u www-data php -d apc.enable_cli=1 /var/www/html/nextcloud/occ   db:add-missing-columns
    sudo -u www-data php -d apc.enable_cli=1 /var/www/html/nextcloud/occ   db:add-missing-indices
    

The occ upgrade step will be invoked by the updater.phar (you wil be asked)

Much luck,
ernolf

Hello again,
still problems at the first step:

MariaDB [(none)]> DROP TABLE IF EXISTS nextcloud.oc_officeonline%;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘%’ at line 1

What else can I try?
Schultze

Try

DROP TABLE IF EXISTS nextcloud.oc_officeonline_wopi;

that should work :wink:

Much luck,
ernolf

Okay thanks,
I thought, I tried this already, but now it worked.

This give me the following error:

Update of code successful.

Should the “occ upgrade” command be executed? [Y/n]
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

This can be related to PHP-upgrade from 7.4 to 8.2, what I did some weeks ago. I’m not shure, what can I do?

Thank you,
Schultze

apt-get install php8.2-apcu

If you give me the output of

dpkg -l | awk '/^ii.*php/ {print $2}'

I can see, if something else is wrong.
Advise: next time use my php-updater script, to prevent such issues.

Much luck,
ernolf

dpkg -l | awk ‘/^ii.*php/ {print $2}’

libapache2-mod-php8.2
libphp-simplepie
php
php-apcu
php-bcmath
php-cgi
php-cli
php-common
php-curl
php-fpm
php-gd
php-geshi
php-gmp
php-imagick
php-intl
php-mbstring
php-mysql
php-nrk-predis
php-pclzip
php-phpseclib
php-predis
php-random-compat
php-sqlite3
php-xml
php-zip
php8.2
php8.2-apcu
php8.2-bcmath
php8.2-cgi
php8.2-cli
php8.2-common
php8.2-curl
php8.2-fpm
php8.2-gd
php8.2-gmp
php8.2-igbinary
php8.2-imagick
php8.2-intl
php8.2-mbstring
php8.2-mysql
php8.2-opcache
php8.2-phpdbg
php8.2-readline
php8.2-redis
php8.2-sqlite3
php8.2-xml
php8.2-zip

Oh I really used php-updater

Thanks,
Schultze

These three:

are mutual exclusive. You can only use one of them but that is not a cause to any error.

At least these are meta packages and can be removed:

Some of your php modules I have never heard about. Do you need them all?
Do you need sqlite3 while your nextcloud uses mysql?


But now I understand, why you got this error message:

That is, because the task was invoked by updater.phar, without the “-d apc.enable_cli=1” part.

You can prevent that kind of errors in future, when you add the directive to your php.ini for php-cli:

echo "apc.enable_cli = 1" >> /etc/php/8.2/cli/php.ini

Then you can invoke any occ task without the apc.enable_cli=1 in the commandline:

sudo -u www-data php /var/www/html/nextcloud/occ upgrade

(etc.)

Great!

Much luck,
ernolf

are mutual exclusive. You can only use one of them but that is not a cause to any error.

Okay, I have deinstalled “libapache2-mod-php8.2” and “php8.2-cgi”.

If I try to remove “php” apt want to remove dokuwiki.

apt purge php

Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
libjs-jquery-cookie libjs-jquery-ui libphp-simplepie php-geshi php-intl php-random-compat php8.2-intl
Verwenden Sie »apt autoremove«, um sie zu entfernen.
Die folgenden Pakete werden ENTFERNT:
dokuwiki* php*

sudo -u www-data php /var/www/html/nextcloud/occ upgrade

Upgrade already worked via WebGUI.

Now I have the problem, that calendar ist not synchronizing, and no folders are shown, when I log in.

Schultze

If you need dokuwiki, then you can leave it as is. It is not a MUST to remove those packages, one should always test, if some other packages of importance depend on it.

If that got autoremoved, you will have to install it again:

sudo apt-get install php8.2-intl

That is a complete new issue. You should dig deeper to get log entries etc.
Without more Information it is verry hard to know why that occurs.

Much luck,
ernolf

Okay. Thank you ernolf.

I will start an other thread,
Schultze