Jira Server 7.13 or later fails with FontConfiguration error when installing on Linux operating systems

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible


Problem

When installing Jira Server or Data Center 7.13 or later with AdoptOpenJDK on Linux, users can get the following error. We noticed it while viewing Project reports however users can get it on other pages too.

2019-01-03 15:36:11,699 http-nio-8898-exec-4 ERROR      [o.a.c.c.C.[.[localhost].[/sd4_obr_eap08].[action]] Servlet.service() for servlet [action] in context with path [/sd4_obr_eap08] threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
	at sun.font.SunFontManager$2.run(SunFontManager.java:431)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.SunFontManager.<init>(SunFontManager.java:376)
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
	... 3 filtered
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at java.awt.Font.getFont2D(Font.java:491)
	at java.awt.Font.defaultLineMetrics(Font.java:2176)
	at java.awt.Font.getLineMetrics(Font.java:2246)
	at org.jfree.chart.axis.NumberAxis.estimateMaximumTickLabelHeight(NumberAxis.java:966)
	at org.jfree.chart.axis.NumberAxis.selectVerticalAutoTickUnit(NumberAxis.java:1095)
	at org.jfree.chart.axis.NumberAxis.selectAutoTickUnit(NumberAxis.java:1040)
	at org.jfree.chart.axis.NumberAxis.refreshTicksVertical(NumberAxis.java:1261)
	at org.jfree.chart.axis.NumberAxis.refreshTicks(NumberAxis.java:1140)
	at org.jfree.chart.axis.ValueAxis.reserveSpace(ValueAxis.java:807)
	at org.jfree.chart.plot.XYPlot.calculateRangeAxisSpace(XYPlot.java:3117)
	at org.jfree.chart.plot.XYPlot.calculateAxisSpace(XYPlot.java:3026)
	at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3156)
	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1235)
	at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1409)
	at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1389)
	at com.atlassian.jira.charts.jfreechart.ChartHelper.createChartImageInline(ChartHelper.java:126)
	at com.atlassian.jira.charts.jfreechart.ChartHelper.generateInline(ChartHelper.java:85)
	at com.atlassian.jira.charts.AverageAgeChart.generateChartInternal(AverageAgeChart.java:91)
	at com.atlassian.jira.charts.AverageAgeChart.generateInlineChart(AverageAgeChart.java:64)
	at com.atlassian.jira.charts.DefaultChartFactory.generateAverageAgeChart(DefaultChartFactory.java:98)
	... 2 filtered
	at java.lang.reflect.Method.invoke(Method.java:498)

Cause

AdoptOpenJDK does not include a font configuration package, which Jira relies on. If your Linux distribution does not include a suitable font configuration package, you will need to install one. 

Resolution

To solve this problem, install fontconfig (or an equivalent), and then install Jira. 

Use our script to install 

Available for Jira 8.2 or later

If you're using Ubuntu, CentOS, RedHat Enterprise (RHEL), Debian, or Fedora, we've created a script to install the required package for you. 

To install the font package:

  1. Change to the /bin directory of your Jira installation
  2. Run the install_fontconfig.sh script. 

    $ sudo ./install_fontconfig.sh

  3. Run the Jira installer again.  

Install it yourself

Here are the commands to install font dependency in a number of common Linux distributions and package managers. 

Ubuntu 

To install the fontconfig package on Ubuntu 18:

sudo apt install -y fontconfig

CentOS 7

CentOS 7 does not work with fontconfig. You can install dejavu-sans-fonts as an alternative:

sudo yum install -y dejavu-sans-fonts

CentOS 6

sudo yum install -y fontconfig dejavu-sans-fonts

RHEL 

To install fontconfig on RedHat Enterprise Linux 7.5:

sudo yum install fontconfig

Debian 

To install the fontconfig package on Debian 9.5:

apt-get update && apt-get install -y fontconfig

Fedora

To install the fontconfig package on Fedora 28:

dnf install -y fontconfig



Last modified on Nov 23, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.