What app is this about, and its version: Mastodon v4.3.6 What YunoHost version are you running: 12.1.40.1 What type of hardware are you using: Other ARM board
Describe your issue
Upgrading Mastodon failed, so I tried to restore from a backup, but now I can’t get that to work
It says: To install the version of bundler this project requires, run gem install bundler -v '~> 2.6'
But gem is installed with Mastodon, and deleted when the backup restore fails, so I never have a chance to run that
Info: Preparing archive for restoration…
Info: Restoring mastodon…
Error: Failed to read info for mastodon : Invalid version: ‘0:’
Error: Failed to read info for mumbleserver : Invalid version: ‘0:’
Error: Could not restore mastodon: Something unexpected went wrong:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/backup.py”, line 1380, in _restore_app
_tools_migrations_run_before_app_restore(
File “/usr/lib/python3/dist-packages/yunohost/tools.py”, line 1079, in _tools_migrations_run_before_app_restore
current_version = version.parse(ynh_packages_version()[“yunohost”][“version”])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/packaging/version.py”, line 52, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/packaging/version.py”, line 197, in init
raise InvalidVersion(f"Invalid version: ‘{version}’")
packaging.version.InvalidVersion: Invalid version: ‘0:’
Info: The operation ‘Restore ‘mastodon’ from a backup archive’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 20260609-200950-backup_restore_app-mastodon’ to get help
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Error: Nothing was restored
root@mossy:/var/www/mastodon/live# yunohost log share 20260609-200950-backup_restore_app-mastodon
Error: Something wrong happened while trying to paste data on paste.yunohost.org: HTTPSConnectionPool(host=‘paste.yunohost.org’, port=443): Read timed out. (read timeout=30)
I ended up installing the latest version and unzipping the YunoHost backup to restore manually. Here’s what I did, for anyone’s future reference. Should let you update to any new mastodon version from the backup of any old one (if you also follow any version-specific upgrade instructions)
systemctl stop ‘mastodon-*.service’
cd /var/www/mastodon/live
mkdir backup
cd backup
tar -xvf /home/yunohost.backup/archives/mastodon-pre-upgrade1.tar
cd ..
chown -R mastodon backup/
sudo -u postgres psql
DROP DATABASE mastodon;
ALTER USER mastodon CREATEDB;
\q
cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/rails db:create
cd backup/apps/mastodon/backup/
(password for psql mastodon user is in live/.env.production)
sudo -u mastodon psql mastodon < “./db.sql”
su - mastodon
(copy keys from live/backup/apps/mastodon/backup/var/www/mastodon/live/.env.production to live/.env.production)