UrlHostnameMismatchException errors appear in Jira server logs

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

Symptoms

Proxy integration is not part of the Atlassian Support Offering. The instructions provided in this article are for informational purposes only.

The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2012-10-15 08:45:15,089 http-8080-16 ERROR anonymous 525x3869x1 1th4ub5 XX.XX.XX.XX,127.0.0.1 /plugins/servlet/gadgets/dashboard-diagnostics [dashboard.internal.diagnostics.DiagnosticsServlet] DIAGNOSTICS: FAILED com.atlassian.gadgets.dashboard.internal.diagnostics.UrlHostnameMismatchException: Detected URL hostname, 'jira.xyz.company.net', does not match expected hostname, 'localhostname.xyz.company.net' at com.atlassian.gadgets.dashboard.internal.diagnostics.Diagnostics.checkExpectedHostname(Diagnostics.java:71) at com.atlassian.gadgets.dashboard.internal.diagnostics.Diagnostics.check(Diagnostics.java:32) at com.atlassian.gadgets.dashboard.internal.diagnostics.DiagnosticsServlet.executeDiagnostics(DiagnosticsServlet.java:93) at com.atlassian.gadgets.dashboard.internal.diagnostics.DiagnosticsServlet.doPost(DiagnosticsServlet.java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:52)

Diagnosis

Examine your server.xml and Apache proxy server configurations:

Server.xml :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <Service name="Catalina"> <Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" scheme="https" proxyName="jira.xyz.company.net" proxyPort="443"/>

Apache Configurations:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 #FORCE HTTPS <VirtualHost *:80> ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost XX.XX.XX.XX:443> ServerName jira.xyz.company.net ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ SSLEngine On SSLCertificateFile /apps/JIRA/jira.cer SSLCertificateKeyFile /apps/JIRA/jira.key SSLCertificateChainFile /apps/chain.crt <Location /> Order allow,deny Allow from all </Location> </VirtualHost>

Cause

Apache Server does not recognize the ServerName. In example above, this is 'jira.xyz.company.net'. Another possible root cause could be an incorrect virtual host configuration in the apache reverse proxy, which receives all traffic that does not match to any VirtualHost in the apache configuration.

Solution

Resolution

  • There are two solutions:

    1. Change the ServerName to the IP address of the Apache Server

      1 2 3 <VirtualHost XX.XX.XX.XX:443> ServerName jira.xyz.company.net ProxyRequests Off
    2. Register "jira.xyz.company.net" to the hosts file

      • In Windows.

        • The hosts file is situated at C:\Windows\System32\drivers\etc

      • In Linux

        • The hosts file is situated /etc/hosts

      • Add the following line at the bottom of the file

        1 <Apache server IP address> <jira.xyz.company.net >

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.