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!