Nextcloud upgrade to 34.0.2 failed and removed 34.0.1

What app is this about, and its version: Nextcloud 34.0.2-ynh1
What YunoHost version are you running: 12.1.40.1
What type of hardware are you using: VPS bought online

Describe your issue

Hi all,
I tried to update Nextcloud to the lastest version 34.0.2 from 34.0.1 and the upgrade failed. But the main issue is that the existing version is no more running and I can’t restore the backup file (error 500 in both cases).
Thanks a lot for your help !

Share relevant logs or error messages

I can’t use paste.yunohost yet so here is only an extract of the restore logs (because I really need to get an operationnal Nextcloud)

ended_at: 2026-07-24 06:22:19.165796
env:
BASH_XTRACEFD: ‘7’
YNH_APP_ACTION: restore
YNH_APP_BACKUP_DIR: /home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup
YNH_APP_BASEDIR: /home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/settings
YNH_APP_ID: nextcloud
YNH_APP_INSTANCE_NAME: nextcloud
YNH_APP_INSTANCE_NUMBER: ‘1’
YNH_APP_MANIFEST_VERSION: 34.0.1~ynh1
YNH_APP_PACKAGING_FORMAT: ‘2.0’
YNH_ARCH: amd64
YNH_BACKUP_CSV: /home/yunohost.backup/tmp/nextcloud-pre-upgrade2/backup.csv
YNH_BACKUP_DIR: /home/yunohost.backup/tmp/nextcloud-pre-upgrade2
YNH_CWD: /home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup
YNH_DEBIAN_VERSION: bookworm
YNH_DEFAULT_PHP_VERSION: ‘8.2’
YNH_HELPERS_VERSION: ‘2.1’
YNH_INTERFACE: api
YNH_STDRETURN: /tmp/tmp8hd_1yat/stdreturn
error: An error occured inside the app restore script
interface: api
operation: backup_restore_app
parent: null
related_to:

    • app
    • nextcloud
      started_at: 2026-07-24 06:21:25.483195
      started_by: ******
      success: false
      yunohost_version: 12.1.40.1

============

2026-07-24 06:21:26,528: INFO - Restoring nextcloud…
2026-07-24 06:21:26,552: DEBUG - Loading migration 0032_firewall_config…
2026-07-24 06:21:26,552: DEBUG - Loading migration 0031_terms_of_services…
2026-07-24 06:21:26,552: DEBUG - Loading migration 0028_delete_legacy_xmpp_permission…
2026-07-24 06:21:26,553: DEBUG - Loading migration 0033_rework_permission_infos…
2026-07-24 06:21:26,553: DEBUG - Loading migration 0030_rebuild_python_venv_in_bookworm…
2026-07-24 06:21:26,553: DEBUG - Loading migration 0027_migrate_to_bookworm…
2026-07-24 06:21:26,553: DEBUG - Loading migration 0034_fix_missing_admins_aliases…
2026-07-24 06:21:26,553: DEBUG - Loading migration 0035_fix_apps_nodejs_version…
2026-07-24 06:21:26,554: DEBUG - Loading migration 0029_postgresql_13_to_15…
2026-07-24 06:21:26,673: DEBUG - Restoring the app ‘nextcloud’…
2026-07-24 06:21:26,763: INFO - Provisioning sources…
2026-07-24 06:21:26,764: INFO - Provisioning system_user…
2026-07-24 06:21:27,730: INFO - Provisioning install_dir…
2026-07-24 06:21:27,762: INFO - Provisioning data_dir…
2026-07-24 06:21:27,784: INFO - Provisioning permissions…
2026-07-24 06:21:27,798: DEBUG - Permission ‘nextcloud.main’ updated
2026-07-24 06:21:27,805: DEBUG - Permission ‘nextcloud.main’ updated
2026-07-24 06:21:27,825: DEBUG - Permission ‘nextcloud.api’ updated
2026-07-24 06:21:27,847: DEBUG - Permission ‘nextcloud.api’ updated
2026-07-24 06:21:27,929: DEBUG - Creating LDAP perm nextcloud.api
2026-07-24 06:21:27,935: DEBUG - Creating LDAP perm nextcloud.main
2026-07-24 06:21:27,961: DEBUG - Permissions were resynchronized to LDAP
2026-07-24 06:21:28,022: DEBUG - Formating result in ‘export’ mode
2026-07-24 06:21:28,027: DEBUG - SSO and portal configurations regenerated
2026-07-24 06:21:28,027: INFO - Provisioning ports…
2026-07-24 06:21:28,038: INFO - Provisioning apt…
2026-07-24 06:21:28,058: DEBUG - Executing command ‘[‘sh’, ‘-c’, ‘/bin/bash -x “./provision_or_update_apt” 7>&1’]’
(…)
2026-07-24 06:22:14,116: DEBUG - + default_character_set=()
2026-07-24 06:22:14,117: DEBUG - + [[ -n nextcloud ]]
2026-07-24 06:22:14,117: DEBUG - + default_character_set=(–default-character-set “$(mysql -B “$database” <<< ‘show variables like “character_set_database”;’ | tail -n1 | cut -f2)”)
2026-07-24 06:22:14,118: DEBUG - ++ cut -f2
2026-07-24 06:22:14,118: DEBUG - ++ mysql -B nextcloud
2026-07-24 06:22:14,119: DEBUG - ++ tail -n1
2026-07-24 06:22:14,131: DEBUG - + mysql --default-character-set utf8mb4 -B nextcloud
2026-07-24 06:22:18,539: WARNING - --------------
2026-07-24 06:22:18,540: WARNING - INSERT INTO oc_reactions VALUES
2026-07-24 06:22:18,542: WARNING - (1,150,151,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,543: WARNING - (2,150,152,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,543: WARNING - (3,219,220,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,546: WARNING - (4,219,221,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,548: DEBUG - + ynh_exit_properly
2026-07-24 06:22:18,548: WARNING - (5,289,290,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,550: WARNING - (6,289,291,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,551: DEBUG - + [[ restore =~ ^install$|^upgrade$|^restore$ ]]
2026-07-24 06:22:18,551: WARNING - (7,308,309,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,552: WARNING - (8,308,310,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,553: WARNING - (9,323,324,‘guests’,‘sample’,‘?’),
2026-07-24 06:22:18,554: WARNING - (10,323,325,‘guests’,‘sample’,‘?’)
2026-07-24 06:22:18,556: WARNING - --------------
2026-07-24 06:22:18,557: DEBUG -
2026-07-24 06:22:18,558: WARNING - ERROR 1180 (HY000) at line 189461: Got error 1 “Operation not permitted” during COMMIT
2026-07-24 06:22:19,164: ERROR - Could not restore nextcloud: An error occured inside the app restore script

If there is something wrong in the database, perhaps you need repair it before, but it’s hard to try, perhaps deleting or recreating the table `oc_reactions`… not easy

Thanks for your help @rodinux .

What sound strange to me is that I tried to restore a previous backup of Nextcloud (not a pre-upgrade one) but I have the same issue although the backup was successfull. How could it be possible ?

To your point of view, the only way is a fresh reinstall of Nextcloud ? :scream:

Have you tried this?

yunohost app shell nextcloud 
php occ maintenance:repair

Thanks @otm33 : yes, I tried this (I saw this trick in another post) but this does not work as nextcloud has been removed by the upgrade process failed.

#yunohost app shell nextcloud
Error: There doesn't seem to be any manifest file in /etc/yunohost/apps/nextcloud ... It looks like an app was not correctly installed/removed.

I would try restoring the pre-upgrade archive or the full backup with

yunohost backup restore nextcloud_archive_name --no-remove-on-failure
# and 
yunohost app shell nextcloud 
php occ maintenance:repair

I didn’t know this feature : thanks @otm33 . I will try this but I’ll have to start from a new instance of Yunohost : I really had to restart Nextcloud and thanks to the exports I did from calendar and contact, I managed to install a fresh Nextcloud with only theses two services restored. But I will clearly check your idea as I need to find back somes files and accounts I couldn’t recover.

J’ai eu le même soucis, j’ai restauré la sauvegarde pre-upgrade et j’ai retrouvé mon instance Nextcloud, ouf !

Pourquoi l’upgrade a planté ? je ne sais pas…

———————————-

I had the same problem; I restored the pre-upgrade backup and got my Nextcloud instance back—phew!

Why did the upgrade fail? I don’t know…

Hi there ! At least I managed to reinstall Yunohost on an old PC to test the recommandation of @otm33 . But I still have one question : how could I import the preupgrade backup on this new instance to be able to run the “yunohost backup restore” command line ? I don’t see any “import” link on the web admin interface.

Thanks !

Ooops, shame on me : answer is in the wiki :

By default, backups are to be placed in /home/yunohost.backup/archives/.

Just need to put it in this place

OK, test done … but on issue to go further : the Nextcloud restore process check the domain name, and of course my test domain is not my production one :

Error : Failed to read info for nextcloud : Domaine ‘xxxxx.nohost.me’ unknown

I checked this time but I don’t see any option “–do-not-check_domain”.

Anyone know how could I force a new domain for the archive restoration ?

Just add it to the webadmin > restore > change url

I’m sorry, I don’t kown where is the “change url” on the restore web page (I only have “Restore” button on the bottom of the web page when I select a local backup archive).

But the fact is I need to run the restore process on cli to set the following parameters :

yunohost backup restore nextcloud_archive_name --no-remove-on-failure
# and 
yunohost app shell nextcloud 
php occ maintenance:repair

Maybe the “change url” is possible this way ?

Change url is available in the webadmin >applications> your application > scroll down. Some apps don’t support it

Try restoring usingyunohost backup restore XXXX with --no-remove-on-failure flag and, once done, changing the url from the app web page.

I tried again but the app can’t be reinstalled as the restore process failed (sorry, french logs) :

sudo yunohost backup restore nextcloud-pre-upgrade2.tar --no-remove-on-failure
[sudo] Mot de passe de admin : 
Info : Préparation de l'archive pour restauration…
Info : Restauration de nextcloud…
Erreur : Failed to read info for nextcloud : Domaine 'xxxxxx.nohost.me' inconnu
Info : Provisioning sources...
Info : Provisioning system_user...
Info : Provisioning install_dir...
Info : Provisioning data_dir...
Info : Provisioning permissions...
Attention : Failed to provision permissions : Domaine 'xxxxxx.nohost.me' inconnu
Info : Deprovisioning sources...
Info : Deprovisioning system_user...
Info : Deprovisioning install_dir...
Info : Deprovisioning data_dir...
Info : Deprovisioning permissions...
Erreur : L'allocation automatique des ressources (provisioning), la suppression d'accès à ces ressources (déprovisioning) ou la mise à jour des ressources pour nextcloud a échoué : Domaine 'xxxxx.nohost.me' inconnu
Info : L'opération 'Restaurer 'nextcloud' depuis une sauvegarde' a échoué ! Pour obtenir de l'aide, merci de partager le journal de l'opération en utilisant la commande 'yunohost log share 20260811-161119-backup_restore_app-nextcloud'
Erreur : The following critical error happened during restoration: L'opération 'Restaurer 'nextcloud' depuis une sauvegarde' a échoué ! Pour obtenir de l'aide, merci de partager le journal de l'opération en utilisant la commande 'yunohost log share 20260811-161119-backup_restore_app-nextcloud'

After this failure, I still don’t have any Nextcloud in the Apps menu :

You have to add the domain on which you installed nextcloud before restoring it, even if you will not use it. You will be able to restore the app.
After your app is restored, you can move it to another domain / location

Thanks for this idea @jarod5001 . But as my prod domain is a nohost.me, when I tried I could’t add another nohost.me site on my Yunohost test env (and I can’t even remove the test domain to replace it by the prod one on this env).

@Cys

Could you try this :

  1. Change the url in the archive settings.yml file
  • cd /home/yunohost.backup/archives/
    locate your 2026_nextcloud_archive

  • vim 2026_nextcloud_archive

  • modify the nextcloud url in
    apps/nextcloud/settings/settings.yml : select with arrow keys and press enter >
    select the domain line with arrow keys, press i key to edit > change the url from your_old_domain to your_new_domain > press escape key > type :wqa! to write the change.

  1. Restore the archive

yunohost backup restore 2026_nextcloud_archive --no-remove-on-failure

The log will throw an error but nextcloud app will be partially restored

  1. Upgrade the nextcloud app

yunohost app upgrade nextcloud --force -b

Check /var/www/nextcloud/config/config.php to make sure that trusted_domains contains your_new_domain -if needed add it and systemctl restart php8.4-fpm-

You also may need to run
sudo yunohost app shell nextcloud
php occ upgrade
php occ maintenance:repair