Failed to upgrade mastodon: An error occurred inside the app upgrade script

What app is this about, and its version: Mastodon from 4.2.13~ynh1 to 4.5.2~ynh1
What YunoHost version are you running: 12.1.36
What type of hardware are you using: VPS bought online

Describe your issue

Tried to upgrade mastodon using:
$ sudo yunohost app upgrade mastodon --force
The upgrade fails and I’m not sure where too look to solve it.

Share relevant logs or error messages

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

I’m more than happy to investigate this myself but it would be nice with some hints as where to look :slight_smile:

Hi
And have you tried to update with this command:

upgrade an existing install :

sudo yunohost app upgrade mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh/tree/testing

no - ehm this would upgrade to a testing branch? why would I do that?

as I understand it I am upgrading an existing install already - just not the testing branch

This allowed me to resolve a problem like that with Cryptpad and I was able to update normally afterwards.

It’s not an obligation, but it helps solve some updates that don’t work or have trouble getting done.

Cleaning can also help.

sudo apt autoclean -y && sudo apt autoremove -y
sudo yunohost tools basic-space-cleanup

ok I see - well it made me think that maybe I should try a gradual update - going through a couple of minor versions instead of jumping directly from 4.2 to 4.5

thanks for the input - I’ll try a bit of this and that :slight_smile:

Indeed, it is preferable to do the updates gradually.

yep - i just coundnt figure out how - with the yunohost command you can specify a repository url but they didn’t seem to have done any branches or tags .. but also I’m not sure if that really matters because what I need to specify is a mastodon tag not a mastodon_ynh tag … there’s probably a way but I didn’t figure it out yet

so I guess the way to do it is to hit a mastodon_ynh commit specifying the right mastodon version - found this in the upgrade script:

if ynh_app_upgrading_from_version_before 4.2.8~ynh2; then
ynh_die “Your installation is to old to update to this version.
\nPlease first manually update with 4.4.3~ynh1 with the following command:
\n’s\0u\0d\0o yunohost app upgrade $app -u https://github.com/YunoHost-Apps/mastodon_ynh/commit/8fb1c6c7818430e8ac49f3ae589c6575614f5e4b’
\nOnce done you can upgrade to the latest version.”
fi

I’m on 4.2.13 but it does sound like a path still

but when i try that command with that url it sais it’s not a valid url .. so I guess I’ll have to checkout the mastodon_ynh myself, change the url for the mastodon repo, which seems to be in manifest.toml …

I have carried out the Mastodon updates correctly, and therefore I do not know the procedure, but indeed, I think that we need to look at this file and modify the URL and certainly other information.

I found this

well - i was looking through the changes made to manifest.toml and there was a lot of other changes i coundnt immidiately figure out what did ..

but after some fiddling around on github i found out how to correct the url mentioned so i went with that approach instead

the correct command looks like this (replacing commit with tree):

yunohost app upgrade mastodon -u GitHub - YunoHost-Apps/mastodon_ynh at 8fb1c6c7818430e8ac49f3ae589c6575614f5e4b

so now we know how do upgrade to what is not the newest version - check

but that upgrade failed as well: https://paste.yunohost.org/raw/uxajulovek - so now I will investigate to see if that can be solved and if not I will try to upgrade to an even earlier version … to be continued …

Tried to upgrade to the highest version 4.3 I could find. Failed with what looks like the same error: https://paste.yunohost.org/raw/dakiyedopu

sudo yunohost app upgrade mastodon -u GitHub - YunoHost-Apps/mastodon_ynh at 5bcecf75ba756b26027b740a0ae897326f8a5b50

And make a complete backup of Mastodon, then reinstall Mastodo cleanly and use these backups to restore the database and multimedia files.

  1. PostgreSQL database

  2. Application secrets from the .env.production file or equivalent

  3. User-uploaded files

  4. Redis database

right - i was beginning to think about that

i tried reinstalling the same version i’m running already (upgrade using the –force flag) - which went well - but still upgrade to the next version failed again

so are you thinking reinstalling the latest version? but will the backups work then? if there are changes to the database schema or anything like that i guess it wouldnt work

When I created my own Mastodon instance I had some issues and then with one of the updates I ended up with this same problem as you.
So I looked for solutions on the Internet and found one on a site (which no longer exists). By following the advice found on this site, I was able to resolve my problem.

It worked for me.

right - well no harm in trying - I have a full server backup I can roll back in if things go wrong

thanks again

You’re welcome.
Good luck :crossed_fingers:

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