zabbix server / jammy upgrade / missing font

zabbix server / jammy upgrade / missing font

  • Written by
    Walter Doekes
  • Published on

The other day, we upgraded the host OS for our Zabbix Server from Ubuntu/Focal to Ubuntu/Jammy. This caused all text to go missing from the rendered graphs.

The php (uwsgi) logs had the following to say:

PHP Warning:  imagettfbbox():
  Could not find/open font in
  /usr/share/zabbix/include/graphs.inc.php
  on line 600

At least that's a pretty clear message.

Through a quick php live hack we learned that it tried to open /usr/share/zabbix/assets/fonts/graphfont.ttf. This file was a symlink to /etc/alternatives/zabbix-frontend-font and that was a symlink to /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf. But that symlink target did not exist.

# update-alternatives --config zabbix-frontend-font
update-alternatives: warning:
  /etc/alternatives/zabbix-frontend-font is dangling;
  it will be updated with best choice
There is only one alternative in link group
  zabbix-frontend-font (providing
  /usr/share/zabbix/assets/fonts/graphfont.ttf):
  /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
Nothing to configure.

That didn't fix anything.

Apparently the fonts-dejavu-core package has moved the fonts from /usr/share/fonts/truetype/ttf-dejavu to /usr/share/fonts/truetype/dejavu. There we could find our trusted old DejaVuSans.ttf.

The fix:

# ln -sf /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf \
    /etc/alternatives/zabbix-frontend-font

Back to overview Newer post: ansible / ipv6 addresses / without link local Older post: postfix / no system resources / proxy protocol