NextCloud upgrade failed & deleted itself (`20.0.7~ynh1 -> 22.2~ynh1`)

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 12.0.11 (issue at time of upgrade from 11.3.0.2)
What app is this about: NextCloud

Describe your issue

Per log heading summaries:

  • upgrade nextcloud – failed (my intended action)
  • remove nextcloud – failed
  • delete permission nextcloud – succeeded
  • restore nextcloud from archive – failed
  • remove nextcloud – succeeded

I’m not sure how to re-install or restore the last working version to re-attempt the upgrade pathway appropriately.

Share relevant logs or error messages

I’m not sure how to recover.

I’ve found the commit for that version 20.0.7 (.1 – manifest.json not updated with .1 sub-patch version).

I can install this version – I’m worried about it overwriting configs and confusing future recovery attempts. I’ll work to recover it directly.

Ouch, that is ancient, by NC standards…

Have you tried to manually restore the backup?

You may have read the last lines in the log,

2025-01-25 18:00:40,562: DEBUG - + ynh_die '
Upgrading from Nextcloud < 22.2 is not supported anymore. 
You should first upgrade to 22.2 using: 
yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/41f5f902e7c7cd3c30a6793020562ba98b9bf3e9'

Would it be an option to

  • restore the backup on a temporary installation of Yunohost 11,
  • then upgrade to NC22.2 using the specific commit,
  • and then upgrade to NC29
  • create backup
  • restore on your actual server running Yunohost 12
  • and then upgrade to NC30

I suppose you have quite a bit of history in Nexctloud, after all this time. If it is mostly personal files, few users and low number/not too important fileshares, it may be worth considering installing a new Nextcloud 30 and occ files:scan on your data directory to import the files.

Thank you, excellent reply –

With consideration

  • occ files:scan – tempting, very tempting. This would include data from extensions? I’m not recalling the architecture and data model of NC.
  • I could consider a YNH11 recovery flow, perhaps spin up a docker container for it. I’m not quite sure it’s worthwhile for me.

Extension of my process & thoughts

Yes, I tried to recover in the mean time. I’m seeing failures in the recovery script.

I have a not yet justified fear that they depended on ynh 11, but perhaps the warning from argument parsing is unrelated, whereas I’ve since completed an upgrade.

https://paste.yunohost.org/raw/hamidusoqi
From cli, with tail snippet of full logs:

CLI output, including tail snippet of full logs
Info: Preparing archive for restoration…
Info: Restoring nextcloud…
Info: [....................] > Loading settings...
Info: [+...................] > Validating restoration parameters...
Info: [#...................] > Restoring the app main directory...
Info: [#++.................] > Restoring the MySQL database...
Info: [###.................] > Recreating the dedicated system user...
Info: [###+++..............] > Reinstalling dependencies...
Info: [######++++++++++....] > Reconfiguring PHP-FPM...
Warning: Invalid argument: --
Error: Could not restore nextcloud: An error occured inside the app restore script
Info: The operation 'Restore 'nextcloud' from a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20250126-220904-backup_restore_app-nextcloud' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - + local psql_installed2=yes
Info: DEBUG - + [[ yes != \y\e\s ]]
Info: INFO - [######++++++++++....] > Reconfiguring PHP-FPM...
Info: DEBUG - + ynh_restore_file --origin_path=/etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + origin_path=/etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + dest_path=/etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + not_mandatory=0
Info: DEBUG - + local archive_path=/home/yunohost.backup/tmp/nextcloud-pre-upgrade1/apps/nextcloud/backup/etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + '[' '!' -d /home/yunohost.backup/tmp/nextcloud-pre-upgrade1/apps/nextcloud/backup/etc/php/7.4/fpm/pool.d/nextcloud.conf ']'
Info: DEBUG - + '[' '!' -f /home/yunohost.backup/tmp/nextcloud-pre-upgrade1/apps/nextcloud/backup/etc/php/7.4/fpm/pool.d/nextcloud.conf ']'
Info: DEBUG - + [[ -e /etc/php/7.4/fpm/pool.d/nextcloud.conf ]]
Info: DEBUG - ++ dirname /etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + mkdir --parents /etc/php/7.4/fpm/pool.d
Info: DEBUG - + mountpoint --quiet /home/yunohost.backup/tmp/nextcloud-pre-upgrade1
Info: DEBUG - + mv /home/yunohost.backup/tmp/nextcloud-pre-upgrade1/apps/nextcloud/backup/etc/php/7.4/fpm/pool.d/nextcloud.conf /etc/php/7.4/fpm/pool.d/nextcloud.conf
Info: DEBUG - + [[ /etc/php/7.4/fpm/pool.d/nextcloud.conf == \/\e\t\c\/\n\g\i\n\x\/\c\o\n\f\.\d\/* ]]
Info: DEBUG - + ynh_add_fpm_config --usage=medium --footprint=high --phpversion=7.4 '--package=php7.4-bz2 php7.4-imap php7.4-smbclient php7.4-gmp php7.4-gd php7.4-json php7.4-intl php7.4-curl php7.4-apcu php7.4-redis php7.4-ldap php7.4-imagick php7.4-zip php7.4-mbstring php7.4-xml php7.4-mysql php7.4-igbinary php7.4-bcmath'
Info: DEBUG - + local _globalphpversion=7.4
Info: WARNING - Invalid argument: --
Info: ERROR - Could not restore nextcloud: An error occured inside the app restore script
Info: Removing nextcloud…

I’m curious about a route forward of:

  • installing a current version
  • and importing data.
    Or installing this targeted version and upgrading.

I’m now concerned I might’ve used some workaround for a previous issue with nextcloud. I uninstalled nextcloud manually from php7.3 but this restore is putting it into php7.4.

I’ll assess the size and complexity of my data – I don’t rely on NextCloud much, but a costly failure to migrate will only lessen that.

Next steps

I would like to install the current version and scan in files. The directory /home/yunohost.app/nextcloud/data still has data in it, I assume it’s all my files. The size matches the archive

Of 200 MB: 100MB is nextcloud.log.1, 50MB is nextcloud.log.

Yeah I’ll just move the directory, install current, and scan in files.

I would not have come up with this on my own, thank you.

1 Like

Thanks for your friendly words, but it’s not a solution as much as a plan of attack :wink:

With Yunohost, users’ files are indeed stored in /home/yunohos.app/nextcloud/data/.

Do you mean the pre-upgrade backup by ‘the archive’? Without changes to the default though, Nextcloud is one of the apps for which BACKUP_CORE_ONLY is set, meaning that the data files are not included in the backup.

1 Like

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