Mastodon not starting after migration to Yunohost 12

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.6
What app is this about: Mastodon

Describe your issue

Mastodon will no longer start (i.e. mastodon-web and mastodon-sidekiq services are not starting) after migration to Yunohost 12. I have attempted to restart the services (via web portal, yunohost command, and Debian terminal) and no change. Check this github issue for more information: Mastodon is not starting after migration to Yunohost 12 · Issue #474 · YunoHost-Apps/mastodon_ynh · GitHub or this previous post from another user: Mastodon-web and mastodon-sidekiq fail to start. I am having the same trouble they are.

Share relevant logs or error messages

internal:/opt/rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb:37:in require': libicudata.so.67: cannot open shared object file: No such file or directory - /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/charlock_holmes-0.7.8/lib/charlock_holmes/charlock_holmes.so (LoadError) from <internal:/opt/rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in require’
from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/charlock_holmes-0.7.8/lib/charlock_holmes.rb:1:in ’
from internal:/opt/rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb:37:in require' from <internal:/opt/rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in require’
from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:60:in block (2 levels) in require’
from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:55:in each' from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:55:in block in require’
from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:44:in each' from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:44:in require’
from /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler.rb:187:in require' from /var/www/mastodon/live/config/application.rb:24:in ’
from /var/www/mastodon/live/config/environment.rb:4:in require_relative' from /var/www/mastodon/live/config/environment.rb:4:in ’
from /var/www/mastodon/live/lib/mastodon/cli/base.rb:4:in require_relative' from /var/www/mastodon/live/lib/mastodon/cli/base.rb:4:in ’
from /var/www/mastodon/live/lib/mastodon/cli/main.rb:3:in require_relative' from /var/www/mastodon/live/lib/mastodon/cli/main.rb:3:in ’
from bin/tootctl:5:in require_relative' from bin/tootctl:5:in ’

Can you log in a shell for the application ? yunohost app shell mastodon ?

I am really not sure if the corect binary to execute bundle is like this, but perhaps something like this ?

sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/bundle install charlock_holmes-0.7.8

I am not sure about that, it is a deduction…

I saw this here Releases · mastodon/mastodon · GitHub

Tip

The charlock_holmes gem may fail to build on some systems with recent versions of gcc.
If you run into such an issue, try BUNDLE_BUILD__CHARLOCK_HOLMES="--with-cxxflags=-std=c++17" bundle install.

  1. Install dependencies with bundle install and yarn install --immutable
  2. Precompile the assets: RAILS_ENV=production bundle exec rails assets:precompile
  3. Restart all Mastodon processes.

Thanks for this suggestion. I can shell into the application and run the “bundle install” and “yarn install --immutable” but when I get to the precompile step, I get the same error as before:

“LoadError: libicudata.so.67: cannot open shared object file: No such file or directory - /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/charlock_holmes-0.7.8/lib/charlock_holmes/charlock_holmes.so”

Not sure what I’m doing wrong, but it’s coming out with the same error, which is a bummer.

Have you try the suggestion BUNDLE_BUILD__CHARLOCK_HOLMES="--with-cxxflags=-std=c++17" bundle install ? Something like this ??

sudo cd /var/www/mastodon/live && sudo -u mastodon RAILS_ENV=production PATH=/opt/rbenv/versions/mastodon/bin BUNDLE_BUILD__CHARLOCK_HOLMES="--with-cxxflags=-std=c++17" bin/bundle install charlock_holmes-0.7.8

Is the folder library present ?

ls -lda /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/charlock_holmes-0.7.8/lib/charlock_holmes-0.7.8

and the binary ?

ls -ldd /var/www/mastodon/live/vendor/bundle/ruby/3.2.0/gems/charlock_holmes-0.7.8/lib/charlock_holmes-0.7.8//lib/charlock_holmes/charlock_holmes.so

Perhaps try a bin/bundle install --verbose to see more information about the issue

Did you see a Gemfile.lock in the project ? Check it, sometimes removing the conflicting package in this file and do a bundle install --verbose can resolve the dependencies…

Perhaps removing and reinstalling the gem ?? there a lot of issue with this gem…

What is the content of line 37 in file /opt/rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb ?

what returns

apt-cache policy icu*

apt-cache policy libicu*

are the packages libicu-dev and libicu67 installed ?

did you mean the other steps works but only the step precompile assets give you an issue ??

I am not sure, but perhaps you have to call the app node version before yarn install… I see this in the upgrade script…

pushd "$install_dir/live"
        ynh_use_ruby
        ynh_gem update --system
        ynh_gem install bundler --no-document
        ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config deployment 'true'
        ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config without 'development test'
        ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config set force_ruby_platform true --quiet
        ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
        ynh_use_nodejs
        ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile --production --network-timeout 600000
        ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean
        ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile
popd

don’t know really what commands you have try…

I am not a full developer, not maintaining this app and hope I don’t said you wrong things that can brake your app… I just have yet use to debug some ruby apps before, but sometimes also I can do mistakes, I am just trying help you, but just take precautions before with backups, etc…

Thanks for all the suggestions. I tried it all and none of it worked. So I ended up deleting my Mastodon installation, and restoring from backup. And now it’s working again. I think that probably went through and reinstalled the gems needed, etc… that got changed in the upgrade to Yunohost 12. I lost 72 hours of data but that’s better than losing it all.

Just adding my +1 since I’m also affected by this error.

Probably also just usig the restore way

Update: Restore worked

Trying these now, the update killed my mastodon and my borg backup.