jasmins little space

Mastodon on Debian 12: libssl.so.1.1: cannot open shared object file

Recently, I’ve migrated our Mastodon instance from Debian 11 to Debian 12. Although it wasn’t necessary, because Debian 11 still gets a lot of security updates, I wanted to do it. New software always good.

And everything worked like a charm. I just followed the Debian upgrade guide, restarted the server and got happy that Mastodon was still working like a charm.

Well, libretranslate, which we’ve installed via pip, was no longer working due to PEP-668, but that was mentioned in the release notes, so I was prepared.

The Debian provided python3 interpreter packages (python3.11 and pypy3) are now marked as being externally-managed, following PEP-668. The version of python3-pip provided in Debian follows this, and will refuse to manually install packages on Debian’s python interpreters, unless the –break-system-packages option is specified.

So, everything went smoothly? Nope.

Meet dynamic linking, my beloved.

On Saturday, I got alerted by the monitoring system. The weekly scheduled task to clean up the Mastodon media usage was failing with the following message:

libssl.so.1.1: cannot open shared object file

The funny thing: the file existed. So, I guess, something something kernel update or so. Tried several solutions, including bundle install --redownload. Which presented me with even funnier error messages.

Bundler::GemNotFound: Could not find rake-13.0.6.gem for installation

# ... (omitted for brevity)

An error occurred while installing rake (13.0.6), and Bundler cannot continue.

In Gemfile:
devise-two-factor was resolved to 4.0.2, which depends on
    devise was resolved to 4.8.1, which depends on
        responders was resolved to 3.0.1, which depends on
            railties was resolved to, which depends on

At this point I was just like: “yeah, love you too. deletes your vendor folder” And that actually was the solution:

$ sudo su - mastodon    # switch to Mastodon user
$ cd live               # go inside the installation folder
$ rm -rf vendor         # delete the installed packages
$ bundle install        # install all packages again

So, yeah, if you are experiencing the above errors as well, just reinstall your dependencies.