Failed restore of Mastodon

What app is this about, and its version: Mastodon 4.4x
What YunoHost version are you running: 12.1.39
What type of hardware are you using: VPS bought online

Describe your issue

Attempted an upgrade to the latest version of Mastodon. During the process it failed with an error. “ERROR - Provisioning, deprovisioning, or updating resources for mastodon failed: libyaml-dev is required to install Ruby”

The currently installed version of Mastodon will now not work.

I have attempted to restore from three different backups via the web. All eventually fail with an Error in the restore script. I then try using the command line. It gets well into the process; as far as “Building app” and fails with a “An error occured inside the app restore script”.

Log file attached

What else can I do/check?

Share relevant logs or error messages

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

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 62D54FD4003F6525
2026-03-12 20:39:55,628: WARNING - W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 62D54FD4003F6525

Consider updating the public key

rm /etc/apt/sources.list.d/yarn.list
rm /etc/apt/trusted.gpg.d/yarn.gpg
yunohost tools regen-conf apt -f

Or this command:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/yarn.gpg > /dev/null

Then do a Mastodon restore :

yunohost backup restore mastodon-pre-upgrade1

You should be able to update without problem:

yunohost app upgrade mastodon

Thanks. I really appreciate you taking time to reply.

I think the public key issue is fixed, but still the same problem (I think) when I do a restore

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

Try with this:

sudo yunohost app shell mastodon

And:

gem install bundler -v '~> 2.6'
yunohost backup restore mastodon-pre-upgrade1
yunohost app upgrade mastodon

Sometimes forcing an update can help.

yunohost app upgrade --force mastodon

Or

yunohost app upgrade -F mastodon

Optional, Cleaning the gems in conflict, may prove useful

bundle clean --force

:warning: IMPORTANT :

Pre-manipulation backup: Make sure you have a backup of your database and Mastodon configuration files before making any profound changes.

Thanks, I will give those a try. Fingers crossed

I don’t have a live Mastodon to take copies. It uninstalled everything. I only have several backups to work with.

Fingers crossed​:crossed_fingers:

1 Like

Sadly it fails at the first hurdle: sudo yunohost app shell mastodon

“Error: There doesn’t seem to be any manifest file in /etc/yunohost/apps/mastodon … It looks like an app was not correctly installed/removed.”

There is no mastodon installed so that makes sense.

Should I complete wipe the server, and start with a fresh Yunohost and try using the backup to restore? (backups are copied to another server!)

Ok, Try it with this

cd /var/www/mastodon/live

Do I understand Mastodon’s not anymore?

Yes, there is nothing left of Mastodon. In order for me to try and restore from a backup YunoHost Admin told me I had to remove the current Mastodon App (which was not working). So there is no App on the server now.

There’s no /var/www/mastodon/live

You’re not Yunohost’s admin, okay!

Do you have a most recent backup that is functional? If so, use it to do a restoration, then make an update of Mastodon.

I am the Yunohost admin!

To recap:

  • I tried an upgrade of Mastodon in the Yunohost Web admin and the Yunohost script failed.
  • The current Mastodon version then stopped working.
  • I tried to recover from two different backups (which means I need to remove the old broken Mastodon as part of the restore).
  • The restore script fails with the gem error.
  • I now have no mastodon installed.

:confused:

Do you have a backup of the Mastodon database and configuration files?

I have the tar files generated by a Yunost backup. Everything will be in there

I created a brand new install of Yunohost on a new server and then restored the backup. It failed with the same error about “gem”. There must be a fault with the script that does the restore.

DEBUG - Could not find 'bundler' (~> 2.6) - did find: [bundler-4.0.8,bundler-4.0.8]
DEBUG - Checked in 'GEM_PATH=/var/www/mastodon/.local/share/gem/ruby/3.4.0:/opt/rbenv/versions/3.4.5/lib/ruby/gems/3.4.0' , execute `gem env` for more information
DEBUG - 
DEBUG - To install the version of bundler this project requires, run `gem install bundler -v '~> 2.6'`

There seems to be a problem with “Activating bundler”
Try this:

sudo yunohost app shell mastodon
gem install bundler -v '~> 2.6'

There is not a current mastodon app installed, it’s gone.

So I can’t sudo yunohost app shell mastodon

and there is no /var/www/mastodon

When the restore from backup fails with the gem error, the script then rolls back everything it has installed and removes it all

And by carrying out a clean reinstallation?

I setup a new server, installed the Yunohost app, restored from the mastodon backup. Exactly the same error.

In the end I gave up on trying to get the Yunohost Restore to work. I created a new VPS server without Yunohost and manually installed Mastodon. I then used the data from the backup to restore it into the new Mastodon server and it is now running without Yunohost.

There seems to be a problem with the restore script which hopefully can be fixed before someone else has the problem.

Thanks for trying