Jira Server 7.13 or later fails with FontConfiguration error when installing on Linux operating systems
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)
It can also prevent Jira from starting:
2024-06-06 13:22:07,490+0000 main ERROR [c.a.jira.upgrade.PluginSystemLauncher] A fatal error occured during initialisation. JIRA has been locked.
com.atlassian.jira.InfrastructureException: Error occurred while starting Plugin Manager. Cannot invoke "org.apache.felix.framework.Felix.getBundleContext()" because "this.felix" is null
at com.atlassian.jira.component.pico.ComponentManager$PluginSystem.earlyStartup(ComponentManager.java:686)
at com.atlassian.jira.component.pico.ComponentManager.earlyStartPluginSystem(ComponentManager.java:245)
at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:48)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:153)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:305)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:202)
at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:144)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:109)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:107)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuffInBackground(LauncherContextListener.java:139)
at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:101)
... 5 filtered
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
... 5 filtered
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
... 8 filtered
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
... 2 filtered
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.felix.framework.Felix.getBundleContext()" because "this.felix" is null
at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.addBundleListener(FelixOsgiContainerManager.java:458)
at com.atlassian.plugin.osgi.factory.OsgiBundlePlugin.installInternal(OsgiBundlePlugin.java:224)
at com.atlassian.plugin.impl.AbstractPlugin.install(AbstractPlugin.java:378)
at com.atlassian.plugin.manager.DefaultPluginManager.lambda$addPlugins$22(DefaultPluginManager.java:1176)
at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
... 2 filtered
at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:1113)
at com.atlassian.jira.plugin.JiraPluginManager.addPlugins(JiraPluginManager.java:165)
at com.atlassian.plugin.manager.DefaultPluginManager.lambda$earlyStartup$5(DefaultPluginManager.java:592)
at com.atlassian.plugin.manager.PluginTransactionContext.wrap(PluginTransactionContext.java:63)
at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:527)
at com.atlassian.jira.plugin.JiraPluginManager.earlyStartup(JiraPluginManager.java:127)
at com.atlassian.jira.component.pico.ComponentManager$PluginSystem.earlyStartup(ComponentManager.java:679)
... 42 more
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:
- Change to the
/bin
directory of your Jira installation Run the
install_fontconfig.sh
script.$ sudo ./install_fontconfig.sh
- 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