Restic issue after migration 0037

I have searched the forum for similar issues

on

This category is for issues regarding specific apps, NOT general issues with YunoHost.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What app is this about, and its version

restic 0.19.1~ynh1

What YunoHost version are you running

12.1.41.2

What type of hardware are you using

VPS bought online

Describe your issue

Yesterday I ran migration 0037 as described here. Today I received this email from restic@mydomain

Backup completed with warnings:
WARNING could not change directory to "/home/yunohost.backup/tmp/auto_gotosocial/apps/gotosocial/backup": Permission denied
WARNING could not change directory to "/home/yunohost.backup/tmp/auto_umap/apps/umap/backup": Permission denied

All other installed apps show normal behaviour and were backed up correctly. Actually the full logs (see below) show that even gotosocial and umap were backed up correctly, just with this warning related to the tmp directory.

Share relevant logs or error messages

COuld you run this to check user and permissions ?

namei -l /home/yunohost.backup/tmp/auto_gotosocial/apps/gotosocial/backup
f: /home/yunohost.backup/tmp/auto_gotosocial/apps/gotosocial/backup
drwxr-xr-x root root   /
drwxr-xr-x root root   home
drwxrwx--- root admins yunohost.backup
drwxr-x--- root root   tmp
                       auto_gotosocial - No such file or directory

Hello, I have the same problem myself, with the app onlyoffice. Here is what I have in the mail logs :

INFO Collecte des fichiers devant être sauvegardés pour onlyoffice…
INFO Declaring files to be backed up...
INFO Backing up the PostgreSQL database...
WARNING could not change directory to "/home/yunohost.backup/tmp/auto_onlyoffice/apps/onlyoffice/backup": Permission non accordée
INFO Backup script completed for onlyoffice. (YunoHost will then actually copy those files to the archive).
INFO Création d'une archive de sauvegarde à partir des fichiers collectés…
INFO L'archive contiendra environ 3.0GB de données.
SUCCESS Sauvegarde créée : auto_onlyoffice
name: auto_onlyoffice
results: 
  apps: 
    onlyoffice: Success
  system: 
size: 3197341335

I have the same permissions as @steko and I tested a manual backup it worked fine (+ restic tells me it also worked) so it’s just the warning and I don’t know what it means

Similar warning is puzzling me during install/remove of apps.
I’ve tried to trigger what the script does manually, and it seems to be yunohost scripts already being in the directory.

To reproduce:

~# source /usr/share/yunohost/helpers
~# ynh_psql_database_exists nonexistingbogus
/usr/bin/psql
could not change directory to "/root": Permission denied
~# cd /
/# ynh_psql_database_exists nonexistingbogus
/usr/bin/psql
/#

@ljf I allow myself to tag you to ask if you’ve any idea how to resolve this issue (I got the same as OuraN2O)

I have the same problem a few days ago with Joplin

WARNING could not change directory to "/home/yunohost.backup/tmp/joplin-pre-upgrade1/apps/joplin/backup": Permission non accordée

And now it’s with Mastodon

WARNING could not change directory to "/home/yunohost.backup/tmp/mastodon-pre-upgrade1/apps/mastodon/backup": Permission non accordée

When I do backups manually, I don’t have that warning.

This answer suggesting various fixes for psql v15 and below (i.e. Bookworm, as it apparently does not occur anymore from psql v16 onwards) may help but I have not yet checked what this migration might have changed on that aspect: https://askubuntu.com/questions/1477238/installing-postgresql-last-line-says-could-not-change-directory-to-home-user