# Mastodon upgrade failed & restore from backup failed

**URL:** https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860
**Category:** Support apps
**Tags:** mastodon, english
**Created:** [September 1, 2025, 1:24pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860 "2025-09-01T13:24:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 1, 2025, 1:24pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/1 "2025-09-01T13:24:57Z")

</div>

**What type of hardware are you using** : Old laptop or computer  
**What YunoHost version are you running** : 12.1.17.1  
**What app is this about** : Mastodon

### Describe your issue

Hi, and thanks to all for being here around this awesome system!!!

There was an upgrade for Mastodon, and I tried to run it.

Apparently, this upgrade failed, and the system subsequently removed the Mastodon installation.

There was a pre-upgrade backup saved, but whenever I try to run it:

```auto
yunohost backup restore mastodon-pre-upgrade1 --apps mastodon

```

I get this result

```auto
Info: WARNING - Unfortunately, an unexpected error occurred, and Bundler cannot continue.
Info: DEBUG -
Info: WARNING - First, try this link to see if there are any existing issue reports for this error:
Info: WARNING - https://github.com/rubygems/rubygems/search?q=Permission+denied+%40+dir_s_mkdir+-+%2Fopt%2Frbenv%2Fversions%2F3.3.5%2Flib%2Fruby%2Fgems%2F3.3.0%2Fcache%2Fbundler&type=Issues
Info: DEBUG -
Info: WARNING - If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md. Make sure to copy and paste the full output of this command under the "What happened instead?" section.
Info: DEBUG - + ynh_exit_properly
Info: Removing mastodon…
Info: [++++................] > Removing system configurations related to mastodon...
Info: '/etc/nginx/conf.d/mastodon.modspil.dk.d/mastodon.conf' wasn't deleted because it doesn't exist.
Info: '/etc/cron.d/mastodon' wasn't deleted because it doesn't exist.
Info: Removing Ruby-3.3.5
Info: Removing rbenv
Info: [####################] > Removal of mastodon completed
Info: Deprovisioning database...
Info: Deprovisioning apt...
Info: Deprovisioning ports...
Info: Deprovisioning permissions...
Info: Deprovisioning install_dir...
Info: Deprovisioning system_user...
Info: Deprovisioning sources...
Success! mastodon uninstalled

```

I’d like some tips about how to get onwards from here. I’d love to get my Mastodon instance back.

Maybe the way to go would be to make a fresh, empty install and load it with the database from the backup, but I don’t know if that’s even feasible.

Any help would be appreciated.

### Share relevant logs or error messages

[https://paste.yunohost.org/raw/nixepazuki](https://paste.yunohost.org/raw/nixepazuki)

---

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 1, 2025, 1:43pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/2 "2025-09-01T13:43:46Z")

</div>

So apparently, the error is:

```auto
Permission denied @ dir_s_mkdir - /opt/rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/cache/bundler

```

and I’m currently trying to get around this by doing `mkdir -p /opt/rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/cache/bundler`, but not setting my hopes too high. It should, at all rates not be necessary. Might be a wrong path somewhere in the restore script.

---

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 1, 2025, 2:16pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/3 "2025-09-01T14:16:07Z")

</div>

Hmmm, this gave me a new error message:

```auto
WARNING - There was an error while trying to write to `/opt/rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/cache/bundler/git`. It is likely that you need to grant write

```

New `mkdir -p`, then. A bit hacky, but if it works …

---

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 2, 2025, 8:07am UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/4 "2025-09-02T08:07:44Z")

</div>

Okay, this is a far as I got:

```auto
Info: WARNING - In Gemfile:
Info: WARNING - devise-two-factor was resolved to 6.1.0, which depends on
Info: WARNING - devise was resolved to 4.9.4, which depends on
Info: WARNING - responders was resolved to 3.1.1, which depends on
Info: WARNING - railties was resolved to 8.0.2, which depends on
Info: WARNING - rake
Info: DEBUG - + ynh_exit_properly

```

A Ruby version conflict. Does anyone know how to go from here?

The full log of my last attempt is here: [https://paste.yunohost.org/raw/emokemodib](https://paste.yunohost.org/raw/emokemodib)

---

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 3, 2025, 3:33pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/5 "2025-09-03T15:33:34Z")

</div>

I’m now trying to get my Mastodon instance back (the main thing is my followers and people I follow) by restoring an earlier backup. Unfortunately, the earliest one I have appears to be from March, which is bad practise - I need to improve that.

---

<div class="post-metadata">

### Author: ![agger-magenta](https://forum.yunohost.org/user_avatar/forum.yunohost.org/agger-magenta/32/7425_2.png) [@agger-magenta](https://forum.yunohost.org/u/agger-magenta)
#### Post date: [September 3, 2025, 4:06pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/6 "2025-09-03T16:06:01Z")

</div>

Wow, restoring an old backup actually succeeded!

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [September 18, 2025, 4:06pm UTC](https://forum.yunohost.org/t/mastodon-upgrade-failed-restore-from-backup-failed/39860/7 "2025-09-18T16:06:14Z")

</div>

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