Nexctcloud upgrade failed (at restore step) - I can speak english/french

:us: Message template (english)

My YunoHost server

Hardware: Old laptop or computer.
YunoHost version: 11.2.3 (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: my Nextcloud data is installed in an external storage disk
If your request is related to an app, specify its name and version: upgrade from 26.0.2~ynh1 to 27.0.1~ynh1

Description of my issue

Hello I have Nextcloud installed on Yunohost, but I followed the official tutorial to put my data on an external drive (because I need larger capacity to store my files).

Nextcloud was working fine until the update. Apparently, it encountered an error at the restore stage. Now, if I go to my applications, Nextcloud has disappeared, as if it had never been installed. I’m linking you to the yunopaste, could you please help me :

https://paste.yunohost.org/raw/yafijufifi

Many thanks!


:fr: Modèle de message (français)

Mon serveur YunoHost

Matériel: Vieil ordinateur
Version de YunoHost: 11.2.3 (stable)
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : oui
Si oui, expliquer: mes fichiers Nextcloud ont été déportés sur un autre disque que celui de Yunohost
Si votre requête est liée à une applicatio, précisez son nom et sa version: upgrade de la version 26.0.2~ynh1 à la version 27.0.1~ynh1

Description du problème

Hello j’ai Nextcloud installé sur Yunohost, mais j’ai suivi le tutoriel officiel pour mettre mes données sur un disque externe (car de plus grande capacité pour stoquer mes fichiers).

Nextcloud fonctionnait très bien jusqu’à la mise à jour. Apparemment, il a rencontré une erreur à l’étape de restauration. Actuellement, si je vais sur mes applications, Nextcloud a disparu, comme s’il n’a jamais été installé. Je vous mets en lien le yunopaste, pourriez-vous m’aider svp :

https://paste.yunohost.org/raw/yafijufifi

Un grand merci !

Can you elaborate how you did that exactly ? The root cause of the issue is tied to the fact that /home/yunohost.app/nextcloud/ doesn’t exists / is empty

1 Like

Thank you very much for your kind help !

Following the tutorial to move Nextcloud data into a bigger partition (because I need several TB to save my files while Yunohost is installed in a 128GB SSD), I have migrated yunohost.app content in my HDD.

It means that :

  • /home/yunohost.app/nextcloud/ content has been migrated into
  • /hdd/nextcloud_data/nextcloud/

Do you think we can solve this issue ? thanks again

Hmf that tutorial doesn’t seem to create any symlink for the initial /home/yunohost.app/nextcloud directory to the new place … I’m skeptical that this is the real “proper” way to do things (assuming there is one)

There is also this tutorial : Adding an external storage to your server | Yunohost Documentation though it seems to be about moving all /home/yunohost.app/, not just nextcloud’s data dir … But that sounds more robust idk

Anyway, naively I would try to run : mount --bind /hdd/nextcloud_data/nextcloud /home/yunohost.app/nextcloud

And then try to restore the backup … Though even if that works that should not be the end of the story, you may want to add some rule to /etc/fstab to automatically mount the folder on boot/reboot

Thank you, I have run mount --bind /hdd/nextcloud_data/nextcloud /home/yunohost.app/nextcloud successfully,

However, when I tried to update again, there was no Nextcloud in the list of updates, so I looked in my list of applications (hoping that Yunohost had updated Nextcloud in hidden), but Nextcloud is no longer there. It means Nextcloud is no more considered as installed in my Yunohost.

For your information, the HDD is already listed in /etc/fstab to automatically mount the folder on reboot.

Should I reinstall Nextcloud and then repeating the previous command (mount --bind /hdd/nextcloud_data/nextcloud /home/yunohost.app/nextcloud) ?

thank you

Yes, but YunoHost performs an automatic backup before upgrades

You should look in Backups > (Local) > Some backup called “nextcloud-pre-upgrade” (1 or 2, use the most recent one)

1 Like

Thank you, following your advice, I was able to restore the application! I put this post as the solution just to keep track in case it happens again, but all credits to your help !

Then I had to :

  1. stop the server : systemctl stop nginx
  2. change groups : chown -R nextcloud /hdd/nextcloud_data
  3. change permissions otherwise no possibility to access from nautilus sftp : chmod 775 -R /hdd/nextcloud_data
  4. check that the nano file /var/www/nextcloud/config/config.php contains the changes indicated in the tutorial (this was the case for me)
  5. restart the server : systemctl start nginx
  6. add a space to make a new file in nano /hdd/nextcloud_data/nextcloud/data/.ocdata
  7. restart a scan cd /var/www/nextcloud && sudo -u nextcloud php8.1 --define apc.enable_cli=1 /var/www/nextcloud/occ files:scan --all
  8. CAUSE OF MY PROBLEM I forgot to do at the time, update the Yunohost settings so that future upgrades know where to make and retrieve backups: yunohost app setting nextcloud datadir -v /hdd/nextcloud_data/nextcloud/data/
  9. change groups again (because previous command reset it) : chown -R nextcloud /hdd/nextcloud_data
  10. change permissions again (because previous command reset it) : chmod 775 -R /hdd/nextcloud_data
  11. upgrade the Nextcloud application because it knows where to find the files in the right places
  12. change groups again (because upgrade reset it) : chown -R nextcloud /hdd/nextcloud_data
  13. change permissions again (because upgrade reset it) : chmod 775 -R /hdd/nextcloud_data

It looks like really long but if you follow the above list, you can see that many times the permission & groups commands are repeated due to many steps resetting them.

Woah it was a tough one, it works now !

Thank you so much for your help!!!

EDIT :

I identified a new issue. I said above that I had many times to reset permissions and groups : actually, every X minutes, permissions and groups are reset and I can’t access from File browser (nautilus with SFTP) anymore. Workaround is to reset permissions every X minutes, which I fear could cause conflicts and issues. I really need to find a long term solution.

Do you know what would cause this ? and if necessary which log can I share ?

Thank you very much

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