Java - Error registering fonts

Hi there,
We are running Metabase on:

  • Metabase version: 0.48.8
  • java_version: jdk-11.0.22+7

We are experiencing a problem when trying to setup email subscription for a specific dashboard.

Error Message:

 [{:type clojure.lang.ExceptionInfo,
   :message
   "Error registering fonts: Metabase will not be able to send Pulses. This is a known issue with certain JVMs. See https://github.com/metabase/metabase/issues/7986 and for more details.",
   :data {},
   :at [metabase.pulse.render.style$register_fonts_BANG_ invokeStatic "style.clj" 117]}
  {:type java.io.IOException, :message "Problem reading font data.", :at [java.awt.Font createFont0 "Font.java" 1183]}],
 :trace
 [[java.awt.Font createFont0 "Font.java" 1183]
  [java.awt.Font createFont "Font.java" 1052]
  [metabase.pulse.render.style$register_font_BANG_ invokeStatic "style.clj" 105]
  [metabase.pulse.render.style$register_font_BANG_ invoke "style.clj" 102]
  [metabase.pulse.render.style$register_fonts_BANG_ invokeStatic "style.clj" 110]
  [metabase.pulse.render.style$register_fonts_BANG_ invoke "style.clj" 107]
  [metabase.pulse.render.style$fn__50440$fn__50441 invoke "style.clj" 121]
  [clojure.lang.Delay deref "Delay.java" 42]
  [clojure.core$deref invokeStatic "core.clj" 2337]
  [clojure.core$deref invoke "core.clj" 2323]
  [metabase.pulse.render.style$fn__50440$fn__50443 invoke "style.clj" 122]
  [metabase.pulse.render.png$render_to_png invokeStatic "png.clj" 49]
  [metabase.pulse.render.png$render_to_png invoke "png.clj" 47]
  [metabase.pulse.render.png$fn__70628$render_html_to_png__70633$fn__70637 invoke "png.clj" 88]
  [metabase.pulse.render.png$fn__70628$render_html_to_png__70633 invoke "png.clj" 77]
  [metabase.pulse.render$fn__73934$png_from_render_info__73939$fn__73940 invoke "render.clj" 213]
  [metabase.pulse.render$fn__73934$png_from_render_info__73939 invoke "render.clj" 210]
  [metabase.pulse$create_and_upload_slack_attachments_BANG_$fn__99332 invoke "pulse.clj" 341]
  [clojure.core.protocols$fn__8249 invokeStatic "protocols.clj" 168]
  [clojure.core.protocols$fn__8249 invoke "protocols.clj" 124]
  [clojure.core.protocols$fn__8204$G__8199__8213 invoke "protocols.clj" 19]
  [clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 31]
  [clojure.core.protocols$fn__8236 invokeStatic "protocols.clj" 75]
  [clojure.core.protocols$fn__8236 invoke "protocols.clj" 75]
  [clojure.core.protocols$fn__8178$G__8173__8191 invoke "protocols.clj" 13]
  [clojure.core$reduce invokeStatic "core.clj" 6886]
  [clojure.core$reduce invoke "core.clj" 6868]
  [metabase.pulse$create_and_upload_slack_attachments_BANG_ invokeStatic "pulse.clj" 335]
  [metabase.pulse$create_and_upload_slack_attachments_BANG_ invoke "pulse.clj" 326]
  [metabase.pulse$create_and_upload_slack_attachments_BANG_ invokeStatic "pulse.clj" 332]
  [metabase.pulse$create_and_upload_slack_attachments_BANG_ invoke "pulse.clj" 326]
  [metabase.pulse$fn__99491 invokeStatic "pulse.clj" 532]
  [metabase.pulse$fn__99491 invoke "pulse.clj" 530]
  [clojure.lang.MultiFn invoke "MultiFn.java" 229]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 662]
  [metabase.util.retry$decorate$fn$reify__67627 call "retry.clj" 77]
  [io.github.resilience4j.retry.Retry lambda$decorateCallable$5 "Retry.java" 306]
  [metabase.util.retry$decorate$fn__67626 doInvoke "retry.clj" 78]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 662]
  [metabase.pulse$send_notification_retrying_BANG_ invokeStatic "pulse.clj" 552]
  [metabase.pulse$send_notification_retrying_BANG_ doInvoke "pulse.clj" 549]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [metabase.pulse$send_notifications_BANG_$fn__99509 invoke "pulse.clj" 559]
  [metabase.pulse$send_notifications_BANG_ invokeStatic "pulse.clj" 558]
  [metabase.pulse$send_notifications_BANG_ invoke "pulse.clj" 554]
  [metabase.pulse$send_pulse_BANG_ invokeStatic "pulse.clj" 582]
  [metabase.pulse$send_pulse_BANG_ doInvoke "pulse.clj" 563]
  [clojure.lang.RestFn invoke "RestFn.java" 439]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675$fn__101678$fn__101698$fn__101699
   invoke
   "send_pulses.clj"
   61]
  [metabase.models.task_history$do_with_task_history invokeStatic "task_history.clj" 96]
  [metabase.models.task_history$do_with_task_history invoke "task_history.clj" 91]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675$fn__101678$fn__101698 invoke "send_pulses.clj" 57]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675$fn__101678 invoke "send_pulses.clj" 56]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675 invoke "send_pulses.clj" 43]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675$fn__101676 invoke "send_pulses.clj" 50]
  [metabase.task.send_pulses$fn__101666$send_pulses_BANG___101675 invoke "send_pulses.clj" 43]
  [metabase.task.send_pulses.SendPulses$fn__101777 invoke "send_pulses.clj" 114]
  [metabase.models.task_history$do_with_task_history invokeStatic "task_history.clj" 96]
  [metabase.models.task_history$do_with_task_history invoke "task_history.clj" 91]
  [metabase.task.send_pulses.SendPulses execute "send_pulses.clj" 100]
  [org.quartz.core.JobRunShell run "JobRunShell.java" 202]
  [org.quartz.simpl.SimpleThreadPool$WorkerThread run "SimpleThreadPool.java" 573]],
 :cause "Problem reading font data.",
 :message
 "Error registering fonts: Metabase will not be able to send Pulses. This is a known issue with certain JVMs. See https://github.com/metabase/metabase/issues/7986 and for more details."}

Any suggestions on how to fix? Have followed the thread on Github but no luck

Can you share Admin -> Troubleshooting -> Diagnostic Info

Certainly, here is the diagnostic info

{
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.22+7",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.22",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.22+7",
    "os.name": "Linux",
    "os.version": "5.10.209-198.858.amzn2.aarch64",
    "user.language": "en",
    "user.timezone": "UTC"
  },
  "metabase-info": {
    "databases": [
      "redshift",
      "bigquery-cloud-sdk"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "15.5"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.6.0"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2024-03-04",
      "tag": "v0.48.8",
      "hash": "a900c85"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Can you update to 49.6 and see if it changes anything?

Have just upgraded and still the same error message

Try to change Java version to LTS. I faced same issue. Problem was solved after changing Java to LTS from redhat repo.
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.22+7-LTS",
"java.vendor": "Red Hat, Inc.",
"java.vendor.url": "https://www.redhat.com/",
"java.version": "11.0.22",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.22+7-LTS",
"os.name": "Linux",
"os.version": "3.10.0-1160.53.1.el7.x86_64",
"user.language": "en",
"user.timezone": "Asia/Kuwait"
},

1 Like

For anyone else coming to this page, upgrading it a LTS version did not work for me, but it was not a redhat version, it was an amazon corretto version. What did solve it for me was installing fontconfig and dejavu-sans-fonts. These seem to be missing from most java version, unless you have access to a redhat distro