Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Metabase
  3. Alerts/subscriptions fail since 3.26.2 (base 6.0.0): "Error registering fonts" / "Could not initialize class sun.awt.X11FontManager". Fix: add libharfbuzz0b

Alerts/subscriptions fail since 3.26.2 (base 6.0.0): "Error registering fonts" / "Could not initialize class sun.awt.X11FontManager". Fix: add libharfbuzz0b

Scheduled Pinned Locked Moved Solved Metabase
3 Posts 2 Posters 73 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    sparkwise
    wrote last edited by
    #1

    Since 3.26.2, Metabase stopped rendering chart and table images, so alerts and dashboard subscriptions fail for both Slack and email. Depending on where you look, it shows up as one of these:

    Error registering fonts: Metabase will not be able to send Pulses. This is a known issue with certain JVMs.
    

    or

    Could not initialize class sun.awt.X11FontManager
    

    These are both the same failure. The first is what Metabase logs the first time Java's font system fails in a running process; the second is what Java reports on later attempts. It's also been reported for email pulses in 16050.

    Timeline: Our Slack alerts worked correctly on 3.26.1 and failed every day after the auto-update to 3.26.2. (I've reproduced it on 3.27.1 on a staging server.)

    Root cause: The package moved to cloudron/base:6.0.0 in 3.26.2 (commit 7f36d6a5). Running a font call directly against the 3.27.1 image (in a throwaway container, outside Cloudron) shows the underlying error, which Metabase's log message hides:

    Please install the openjdk-*-jre package or recommended packages for openjdk-*-jre-headless.
    UnsatisfiedLinkError: /usr/lib/jvm/java-21-openjdk-amd64/lib/libfontmanager.so: libharfbuzz.so.0: cannot open shared object file: No such file or directory
    

    On Ubuntu, libharfbuzz0b is only a recommended package for openjdk-21-jre-headless, and it isn't in the new image. Presumably the old base image supplied it.

    Verified fix: installing libharfbuzz0b in the same throwaway container makes Java's font system initialize normally (it finds 8 font families, where before it threw the error above). Installing fontconfig alone didn't help, and neither would /tmp permission or fc-cache changes, since it's a missing library rather than a font cache issue. Suggested Dockerfile change:

    apt-get install -y openjdk-21-jre-headless libharfbuzz0b
    

    The test I used:

    IMG=$(sudo docker ps --format '{{.Image}}' | grep -i metabase | head -1)
    sudo docker run --rm --entrypoint bash "$IMG" -c '
      cd /app/code
      T="(println :font-families (count (.getAvailableFontFamilyNames (java.awt.GraphicsEnvironment/getLocalGraphicsEnvironment))))"
      java -Djava.awt.headless=true -cp metabase.jar clojure.main -e "$T" 2>&1 | tail -n 8
      apt-get update -qq && apt-get install -y -qq libharfbuzz0b >/dev/null 2>&1
      java -Djava.awt.headless=true -cp metabase.jar clojure.main -e "$T" 2>&1 | tail -n 8'
    

    @girish It may also be worth checking other Java-based apps on base 6.0.0 that use the headless JRE for image or PDF rendering, since they could hit the same thing.

    Thank you!

    1 Reply Last reply
    0
    • nebulonN
      nebulonN
      nebulon
      Staff
      wrote last edited by
      #2

      The latest package release now has harfbuzz installed. Thanks for the detailed report and sorry this slipped through on our end.

      1 Reply Last reply
      0
      • nebulonN nebulon marked this topic as a question
      • nebulonN nebulon has marked this topic as solved
      • S
        S
        sparkwise
        wrote last edited by
        #3

        @nebulon I confirmed that fixed the broken images issue in Slack! Thank you!

        1 Reply Last reply
        1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search