'yunohost backup restore' of Mastodon app fails because files under /opt/rbenv/ get recreated with the wrong permissions

What I’m trying to do

I’m trying to migrate my whole YunoHost instance from a VPS hosted by DigitalOcean to a physical machine (an old laptop) at home. System configs, user accounts, and other apps have successfully been restored, but the separate backup of the Mastodon app fails to restore with file permission errors (described below).

The origin YunoHost server

Hardware: DigitalOcean Basic “Droplet”, based on Intel CPU, with 4 vCPU cores, 8 GB of RAM, solid-state based storage.
YunoHost version:
Started with a plain Debian 10 image; installed YunoHost with the Bash script recommended for remote serverscurl https://install.yunohost.org | bash
Later, upgraded in place to Debian 11, using the web admin UI. Current versions:

yunohost: 
  repo: stable
  version: 11.1.20
yunohost-admin: 
  repo: stable
  version: 11.1.9.4
moulinette: 
  repo: stable
  version: 11.1.4
ssowat: 
  repo: stable
  version: 11.1.4

I have access to my server : Through SSH, through the web admin, and DigitalOcean’s web browser-based server console.
Are you in a special context, or did you perform some particular tweaking on your YunoHost instance ? : Since I started with a base Debian system, I have an extra user account only configured for shell access, not associated with YunoHost accounts, but which I added to the admins and ssh* groups. Also, I installed some extra CLI packages like Emacs, TMUX, and Fish, using Apt commands. That’s all I can think of.

The target YunoHost server

Hardware: MSI GE70 2QE laptop, with Intel Core i7-4720HQ CPU @ 2.60GHz, GeForce GTX 960M GPU, 16 GB of RAM.

  • /boot/efi, /, and swap mounted on primary solid state drive
  • /media/backups mounted on secondary hard disk drive, with data pulled from origin server using Rsync. Original YunoHost built-in backups currently bind-mounted from /media/backups/... to /home/yunohost.backup/ to recreate the normal file tree.

YunoHost version:
Clean installation of Debian 11 ISO containing nonfree firmware and GPU driver support, from debian.org. Installed YunoHost with the same shell script and command line as the origin server.

yunohost: 
  repo: stable
  version: 11.1.20
yunohost-admin: 
  repo: stable
  version: 11.1.9.4
moulinette: 
  repo: stable
  version: 11.1.4
ssowat: 
  repo: stable
  version: 11.1.4

I have access to my server : Through SSH, through the web admin, and direct access to the machine with physical keyboard and display.
Are you in a special context, or did you perform some particular tweaking on your YunoHost instance ? : Since I started with a base Debian system, I have an extra user account only configured for shell access, not associated with YunoHost accounts, but which I added to the admins and ssh* groups. This server boots in text mode by default, but did come with a standard GNOME 3.38 desktop. Also, I installed some extra packages like Emacs, TMUX, and Fish, using Apt commands. That’s all I can think of.

Description of my issue

Restoring the Mastodon backups fails with file permission errors. For searchability, from what I can tell, the most relevant-looking error message appears while building required Ruby Gem packages:

There was an error while trying to write to/opt/rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/cache/bundler/git
It is likely that you need to grant write permissions for that path.

…But the full log is on YunoPaste here: https://paste.yunohost.org/raw/mocohefafu

/opt/rbenv/ only seems to exist during the attempted backup restore. When the restoration fails, YunoHost automatically removes the Mastodon app and configs, so then /opt/ is empty. I can’t manually fix file permissions if the directory is created and destroyed by the restore scripts.

Backstory

I’m working with two different YunoHost-generated backup tarballs.

The first, is a “preupgrade backup”, created just before I attempted to update Mastodon from 4.x (I forget the exact version number) to 4.1.2~ynh1 on the origin server.

That Mastodon upgrade had other errors, something got corrupted, and the Mastodon app was automatically uninstalled. I was already planning on migrating to my home server anyway, so I clicked to create a full back up of the system, other apps, data, and users. This second backup restored successfully, but the preupgrade Mastodon backup fails to restore.

I still have the original backups, and access to the original server, and have not really started trying to use the new home server for anything yet.

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