Nextcloud 32.0.6~ynh2 upgrade failed and yunohost removed it

What app is this about, and its version: Nextcloud 32.0.6~ynh2
What YunoHost version are you running: 12.1.39
What type of hardware are you using: VPS bought online

Describe your issue

Hi,

I received the Nextcloud 32.0.6~ynh2 update and wanted to upgrade my instance. The upgrade process failed and Yunohost decided to remove my instance completely.

Then I tried to restore it from the *-pre-upgrade backup, it failed too.
I also tried to restore it from an older full backup, it failed too.

Now I’ve lost my latest file changes I made since the last sunday. The problems that caused the upgrade to fail are:

  • Database migrations
  • Database constraint errors

These errors are from some Nextcloud apps like the LibreSign and Tables. Is there a way to disable all apps in the archive files before the next restore attempt? Any help appreciated.

Regards

Share relevant logs or error messages

First upgrade logs:
https://paste.yunohost.org/raw/ozusoluses

Restore from “*pre-upgrade archive” logs:
https://paste.yunohost.org/raw/apahajudaf

Restore from a “full backup archive” logs:
https://paste.yunohost.org/raw/tekowolewi

Hi, the restore script is blocked on line 23 here:

This script is in your server, probably in

/etc/yunohost/apps/nextcloud/scripts

The problems seems to be due to an error in an entry of the nextcloud database.

You can find the restored archive in:

/home/yunohost.backup/tmp/nextcloud_backup/apps/nextcloud/backup

Here is my suggestion:

  • activate the logging parameters in Mysql: see https://dev.mysql.com/doc/refman/8.4/en/server-logs.html
  • Try again a restore script of nextcloud
  • analyse the mysql log file to understand the constraints of the `oc_tables_columns.custom_settings` table
  • Then analyse the error of line number 81869 , in the log file
    • decompress the archive
    • Then modify the databse located in your archive
  • you can find example of mysql constraints here: MySQL Constraints
  • then re-try the restore process