Font health check fails after upgrade to 8.3.1
Asked by Jimmy B?ckstr?m:

Hello,

After upgrading to Confluence 8.3.1 the font health-check is failing:
>
> ##### What does this check do? {#toc-hId--1538868655}
>
> Check if system fonts are available. Adopt Open JDK does not include font configuration packages, which Confluence relies on.
>
> ##### Result {#toc-hId-948644178}
>
> System fonts are not available. Please make sure correct font packages are installed.

OS: RHEL 8

In the logs I see a lot of the below errors:

```
2023-06-29 10:12:03,492 WARN [HealthCheck:thread-4] [troubleshooting.healthcheck.concurrent.SupportHealthCheckProcess] lambda$getCompletedStatuses$0 Health check 'Fonts' failed with severity 'warning': 'System fonts are not available. Please make sure correct font packages are installed.'
2023-06-29 10:12:03,755 WARN [http-nio-8090-exec-3] [troubleshooting.healthcheck.concurrent.SupportHealthCheckProcess] lambda$getCompletedStatuses$0 Health check 'Fonts' failed with severity 'warning': 'System fonts are not available. Please make sure correct font packages are installed.'
```

I've checked that the OS font-packages are installed as per <https://confluence.atlassian.com/confkb/confluence-server-6-13-or-later-fails-with-fontconfiguration-error-when-installing-on-linux-operating-systems-960167204.html> and another link that I can't find at the moment:

```
rpm -qa | egrep "freetype|fontconfig|dejavu"
dejavu-sans-mono-fonts-2.35-7.el8.noarch
dejavu-serif-fonts-2.35-7.el8.noarch
fontconfig-2.13.1-4.el8.x86_64
freetype-2.9.1-9.el8.x86_64
dejavu-sans-fonts-2.35-7.el8.noarch
dejavu-fonts-common-2.35-7.el8.noarch
```

My guess is that it have something to do with with the bundled JRE being updated to Java 17 but I am not certain.
>
> ### Java Runtime Environment {#toc-hId--1559874863}
>
> Operating System: Linux 4.18.0-477.13.1.el8_8.x86_64  
> OS Architecture: amd64  
> Application Server: Apache Tomcat/9.0.73  
> Servlet Version: 4.0  
> Java Version: 17.0.6  
> Java Vendor: Eclipse Adoptium  
> JVM Version: 17  
> JVM Vendor: Oracle Corporation  
> JVM Implementation Version: 17.0.6+10  
> Java Runtime: OpenJDK Runtime Environment  
> Java VM: OpenJDK 64-Bit Server VM  
> Java Runtime Arguments--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Djava.util.logging.config.file=/opt/atlassian/confluence/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Datlassian.plugins.startup.options= -Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 -Dconfluence.context.path=/docs -Djava.locale.providers=JRE,SPI,CLDR -Dsynchrony.enable.xhr.fallback=true -Datlassian.plugins.enable.wait=300 -Djava.awt.headless=true -Xloggc:/opt/atlassian/confluence/logs/gc-2023-06-21_07-32-17.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -Xlog:gc+age=debug:file=/opt/atlassian/confluence/logs/gc-2023-06-21_07-32-17.log::filecount=5,filesize=2M -XX:G1ReservePercent=20 -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDateStamps -XX:+IgnoreUnrecognizedVMOptions -XX:ReservedCodeCacheSize=256m -Xms4096m -Xmx4096m -Dignore.endorsed.dirs= -Dcatalina.base=/opt/atlassian/confluence -Dcatalina.home=/opt/atlassian/confluence -Djava.io.tmpdir=/opt/atlassian/confluence/temp

Have anyone seen this before or know what to look for?


Answers:
author: Jimmy B?ckstr?m
body: This issue was solved. As I suspected the update to Java 17 was the culprit, or rather some missing new config-directives in confluence/bin/setenv.sh that I didn't check for. Specifically this part:

```
# Add various JPMS arguments to allow Confluence to work on Java 17
CATALINA_OPTS="@$CATALINA_HOME/confluence/WEB-INF/jpms-args.txt ${CATALINA_OPTS}"
```

In jpms-args.txt referenced above one of the directives concern fonts.

comments: author: Matt Baillargeon
body: I don't understand, what did you do to fix this? I am preparing to upgrade sometime this week and our staging instance has this exact error.

Thanks


author: Jimmy B?ckstr?m
body: Hi,

Sorry for the late reply (vacation-time). To clarify, typically when updating Confluence I will just backup the file confluence/bin/setenv.sh beforehand and copy it back, overwriting the file that ships with the update, before starting Confluence again. Version 8.3.1 ships with an extra option in the new setenv.sh file that is required with Java 17 that comes bundled.

So the solution for me was:

* Back up setenv.sh before updating (plus other files that we've modified)
* Run the updater, don't start Confluence when done
* Back up the new setenv.sh that ships with the update
* Include the directive for jpms-args.txt from the new file into the old and then copy it back. Start Confluence.

I hope that made it clearer.


author: Jannik Meibom
body: Hi,  
We had the same experience after upgrading Confluence from 7.13.7 to 8.5.2.

We started getting the *Font Health Check* failure and the solution was found here:  
[Fonts health check failed in Confluence 8 with Java 17](https://confluence.atlassian.com/confkb/fonts-health-check-failed-in-confluence-8-with-java-17-1272381463.html)

We had to configure the Windows Service with this command:

    tomcat9w //ES//<SERVICENAME>

as described in this article:  
[Configuring System Properties](https://confluence.atlassian.com/doc/configuring-system-properties-168002854.html#ConfiguringSystemProperties-Windowsservice)

We added all the mentioned entries in the Java 9 Options section under the Java tab:

![Conflluence-tomcat9w.png](https://community.atlassian.com/t5/image/serverpage/image-id/288775iCB161FD34388B513/image-size/large?v=v2&px=999 "Conflluence-tomcat9w.png")

Hope it helps...

comments: author: Lou-Guardia
body: why would this fix it? nowhere does that refer to fonts?


author: Johan Kummeneje
body: .


author: Arkadiy
body: Got the same issue on Debian 10


Tags: confluence-server

server