2

I created a Mastodon instance with DigitalOcean's preconfigured droplet which deploys version 5.3.5 of Mastodon on Ubuntu 20.04. I ran the setup wizard, then I immediately upgraded it to v4 of Mastodon with the official instructions.

After the restart, the web UI is down. The log /var/log/syslog contains:

ActionView::Template::Error (Webpacker can't find media/icons/favicon-16x16.png in /home/mastodon/live/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:

followed by a lengthy listing of manifest JSON.

Here are a couple of things that didn't fix the problem:

echo RAILS_SERVE_STATIC_FILES=true >> /home/mastodon/live/.env.production
RAILS_ENV=production bundle exec rails assets:precompile

Using find I located the file that the log says it cannot find. It's at ./app/javascript/icons/favicon-16x16.png

So the file appears to be in the wrong place? Or is this a permissions issue?

1 Answers1

0

To answer my own question, it appears the DigitalOcean droplet I was using simply didn't have enough memory to perform the upgrade. I had 2GB of RAM but 4GB are needed.

These instructions (which I here copy from masukomi on GitHub) worked for me:

  • turn off your droplet; this will, of course, prevent anyone from accessing your box for a bit
  • resize the droplet to 4GB RAM (do CPU + RAM only so that you can go back down)
  • turn the droplet back on
  • ssh back into the machine (the IP should not have changed)
su - mastodon
cd ~/live

# probably unnecessary but won't hurt...
git checkout yarn.lock

# clobber the precompiled assets because it probably thinks everything's fine with them
RAILS_ENV=production bundle exec rails assets:clobber
RAILS_ENV=production bundle exec rails assets:precompile

# switch back to the root user
exit

# restart all the mastodon services
systemctl restart mastodon-sidekiq
systemctl reload mastodon-web
# probably unnecessary but won't hurt...
systemctl restart mastodon-streaming

Finally, masukomi notes, you can switch your droplet back to the smaller RAM size you were previously using. Thanks to Jannik S. for pointing me to this answer.