YunoHost-Apps / mastodon_ynh

Free, open-source social network for YunoHost
https://joinmastodon.org/
GNU Affero General Public License v3.0
84 stars 33 forks source link

Upgrade takes forever #424

Open BishopGreer opened 6 months ago

BishopGreer commented 6 months ago

Describe the bug

Upgrade is on hour 20 and is still not done.

Context

Steps to reproduce

Click upgrade and wait until the end of time.

Expected behavior

Not to take 20 hours+ to upgrade

Logs

So we are still waiting for the upgrade to complete. My question of sorts is if there is a way to trim down the backup process. Mine is 112.3 GB and if you have more than that, God help you. Maybe just back up the basic user account information (username, password, bio info) and the server info. Not all the threads, media and such.

Thanks for all your hard work!

panomaki commented 6 months ago

Mastodon is disk space intensive. There are currently two bottlenecks you may run into:

For now, to keep down the time you could run clean up tasks and minimize the number of days your cache keeps. See https://codeberg.org/Fedimins/mastodon-maintenance-tasks for some inspiration.

Olm-e commented 5 months ago

why does the upgrade script reset file permissions ? it's why it takes all that time even without backup ...

OniriCorpe commented 4 months ago
  • The upgrade script resets file permissions on EVERY file in the /var/www/mastodon tree, twice at least.

Where did you see that?

if you’re talking about this, it’s not what you think:

# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi

# Create a permission if needed
if ! ynh_permission_exists —-permission="api"; then
ynh_permission_create —-permission="api" --url="/api" —-allowed="visitors" —-auth_header="false" —-show_tile="false" —-protected="true"
fi
Tagadda commented 4 months ago

https://github.com/YunoHost-Apps/mastodon_ynh/blob/36c4f111532a6e0fda494de4f6b0b15fca1730ec/scripts/upgrade#L194-L195 Not sure those lines are required.