My Attempts to Fix My Mastodon Instance

Written By: Jake Bauer | Posted: 2020-07-17 | Last Updated: 2020-07-17

Self-hosting Mastodon was going so well until about a month-and-a-half ago when, seemingly out of nowhere, I started getting HTTP error 422 in response to any action I took to update my profile or instance from the web UI. I could still update things like my profile description using the Tusky mobile app, yet it wouldn’t work in the web interface. I also couldn’t even log out, as clicking the log out button gave me the exact same error page and HTTP response:

A mastodon error page with the text 'Security verification failed. Are
    you blocking cookies?'.

I tried fiddling with the server, re-compiling the UI pages, updating it and its dependencies, all to no avail. Just today I spent about 4 hours (mostly just waiting for things to backup, copy, transfer, etc) standing up a new mastodon server and migrating the database over but, although the back-end seemed to work just fine, the front-end kept giving me webpack errors that I have no idea how to fix:

Jul 18 02:03:31 eris bundle[901]: [f0b3cdd5-a423-43ac-beba-9484b5100b10] method=GET path=/ format=html controller=HomeController action=index status=302 duration=22.14 view=0.00 db=17.60 location=https://social.paritybit.ca/@jbauer
Jul 18 02:03:31 eris bundle[902]: [7187785d-5345-413e-a08a-3854c43a0e94] method=GET path=/@jbauer format=html controller=AccountsController action=show status=500 error='ActionView::Template::Error: Webpacker can't find public.js in /home/mastodon/live/public/packs/manifest.json. Possible causes:
Jul 18 02:03:31 eris bundle[902]: 1. You want to set webpacker.yml value of compile to true for your environment
Jul 18 02:03:31 eris bundle[902]:    unless you are using the `webpack -w` or the webpack-dev-server.
Jul 18 02:03:31 eris bundle[902]: 2. webpack has not yet re-run to reflect updates.
Jul 18 02:03:31 eris bundle[902]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
Jul 18 02:03:31 eris bundle[902]: 4. Your webpack configuration is not creating a manifest.
Jul 18 02:03:31 eris bundle[902]: Your manifest contains:
Jul 18 02:03:31 eris bundle[902]: {
Jul 18 02:03:31 eris bundle[902]: }
Jul 18 02:03:31 eris bundle[902]: ' duration=233.72 view=0.00 db=9.78
Jul 18 02:03:31 eris bundle[902]: [7187785d-5345-413e-a08a-3854c43a0e94]

I’ve tried re-compiling the front-end assets, checking the content of the stated webpacker.yml and the manifest.json files (they looked fine to my untrained eye and contained the things Webpacker says it can’t find), and even things like what was suggested here on StackOverflow. Nothing worked.

I’m kind of getting fed up with the technologies used by Mastodon. Not only does my server eat RAM because of the use of things like Ruby and Node.js, it feels very duct-taped together and difficult to diagnose without being intimately familiar with either Mastodon’s workings or Ruby environments in general. I appreciate the efforts of the Mastodon developers in creating this software, but I don’t think the technologies used are particularly good.

For this reason, unless I can figure out how to solve the above problems, I will be standing up a Pleroma instance (it’s basically like Mastodon but doesn’t eat as much RAM and only externally requires a database, as opposed to a whole suite of web technologies, among other things). The migration won’t be quick and I’ll probably lose a few followers along the way, but I think it’ll be worth it in the end to move to a platform that won’t be as frustrating to diagnose or fix.

This is my seventy-fourth post for the #100DaysToOffload challenge. You can learn more about this challenge over at https://100daystooffload.com.