One of my Nextcloud installs is missing after a system upgrade

My YunoHost server

Hardware: Dedicated old computer
YunoHost version: 4.2.7
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hi all, after a system upgrade on June 30th, one of my Nextcloud installations has disappeared. Up to then, I was running three parallel Nextcloud installs with great success. The application system numbered them nextcloud, nextcloud__2 and nextcloud__3.

Since that update, nextcloud__3 is no longer listed in the installed apps, and is inaccessible at its urls. The data is still all there when I search for it via SSH, and a backup exists, but when I try to restore the data, I get an error linked to a missing directory for a specific user. Log is here:

I then looked to see why the dir Multimedia was missing from this users directory to find that the entire /home/clare user dir is missing. Now, yunohost still thinks this user exists, when I sudo yunohost user list that user is active and visible, and the listing is the same via the web admin.

I’m not sure what the best procedure is here, shall I recreate a ‘home’ dir for that user manually (what folders should I recreate?) or should I try to restore an older system backup? If I did the former, should I then try to re-run the ‘nextcloud__3’ restore and hope for the best?

Thank you for any guidance,

All the best!

Bonjour à tous, je fais une traduction ici puis un autre post pour expliquer ce que j’ai essayé depuis.

Suite à une mise à jour système le 30 Juin, une de mes installations Nextcloud à simplement disparu. Sur mon instance ynh j’ai 3 Nextclouds installés, qui ont étés numérotées respectivement nextcloud, nextcloud__2 et nextcloud__3. Les deux premières installations continuent de marcher parfaitement mais nextcloud__3 à disparu.

J’ai donc essayé de restaurer nextcloud__3 via le backup, sauf que le restore me retourne des erreurs lisibles ici:

Un dossier utilisateur home manque completement (alors que l’utilisateur est listé actif via l’interface web et la commande yunohost user list) mais heureusement, le dossier nextcloud__3 est toujours listé dans le contenu du dossier /home

Je ne suis pas sur de quelle procédure suivre: recréer manuellement le dossier home pour l’utilisateur ‘manquant’ ou devrais-je restaurer un backup de tout le contenu des utilisateurs tel qu’il est possible via l’interface backup-restore de ynh. Ces deux pistes seraient dans le but de permettre la restauration du backup de mon nextcloud__3 de se faire correctement.

Merci pour votre aide,

Bien à vous tous

Ok here is what I tried:

  • Restored all User data from a system backup (the option to restore only some portions of the backup is suuper nice) that restore was successful
  • Listed the content of the home dirs via SSH: the missing users folder was not restored. Upon further inspection, that users home folder was not part of the backup, so it has been missing since early May. Meanwhile, this ynh user has been using various services while signed in, namely that Nextcloud instance, without any issues, not sure how useful that info is.
  • Manually created that users home folder, then ran the restore, the restoration got a few steps further before failing again on a chown issue I do not understand.
  • Full log of the latest failed restore:
  • Question: why would the nextcloud restore try to chown to a user that is not a unix user? My understanding is that ynh users are not created as unix users?

Thanks again for any help / ideas you can provide.

Ok voici ce que j’ai essayé:

  • J’ai essayé de restaurer le ‘User data’ via un backup du système (par ailleurs, l’option de pouvoir restaurer que certaines portions de l’archive est vraiment top!), cet opération a été complété correctement
  • J’ai listé le contenu de /home en m’attendant à voir le dossier du user manquant mais non, il se trouve que ce dossier manque depuis longtemps car il n’était pas présent dans l’archive que j’ai restauré. Cependant, cet utilisateur ynh à pu continuer d’utiliser plusieurs apps ynh en étant loggé et sans soucis. Pas certain si cette dernière info est utile ou pas.
  • J’ai recrée manuellement le dossier de cet utilisateur, puis relancé le restore de l’archive nextcloud__3. L’opération à pu aller quelques étapes plus loin mais finis par avoir une erreur sur une commande chown que je ne comprends pas.
  • Logs complets du dernier restore erroné:
  • Question: pourquoi est-ce que le script de restore essaye de chown sur un utilisateur Unix qui n’existe pas? J’avais cru comprendre que la création d’un utilisateur ynh ne crée pas un utilisateur UNIX?

Merci pour toute aide ou propositions,

Ok, not too sure how this related to the update, but after a long session with @Aleks here is what solved the issue:

The resolve

  • the restore operation was failing because of a chown command. It was impossible to give ownership to the LDAP user, the command returned chown: invalid user: 'user'
  • thanks to @Aleks and a slapcat | grep "dn: uid=user" -A25 command, it was worked out that this LDAP user had a uid of < 1000 which meant that the user was “ignored by nsswitch (which is the thing that binds the LDAP as a user DB for the system)” as documented in this issue [fix] If uid is less than 1000 nsswitch ignore it · YunoHost/yunohost@903d4d1 · GitHub

The fix:

  • as root, run yunohost tools shell → gives you a python console
  • run a ldap.update in that console like the following
    ldap.update('uid=userwithuidlowerthanonethousand,ou=users', {'uidNumber': ['12345']})
  • returns True and now chown operations were permitted again

I restored the Nextcloud as attempted before and all was back to normal.

Thanks again!

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