Setup: Tomcat is misconfigured

Ricardo Goncalves July 25, 2019

I'm getting this error when starting Jira that Tomcat is misconfigured and that the server.xml file is missing parameters needed by Jira to handle requests that contain special characters.

It pops us a message that includes the following URL on how to troubleshoot the issue: https://confluence.atlassian.com/jirakb/changing-server-xml-to-handle-requests-with-special-characters-958453799.html

 

I'm supposed to follow these steps to fix the issue:

Solution

  1. Go to <Jira-installation-directory>/conf, and edit the server.xml file.
  2. Find all connectors your application is using. Just search for Connector in the file, or look at the example below. You're interested only in connectors whose protocol is set to HTTP and HTTPS (not AJP).
  3. Add relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;" to the connector properties in server.xml. For example:

    <Connector port="8080" relaxedPathChars="[]|" rela

I used the config.bat to change the settings to use only https and this is how my connector looks like:

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" keyAlias="te-50a7704f-9b69-4627-b12a-0c2c87a6c70f" keystoreFile="C:\Program Files\Java\jre1.8.0_221\lib\security\cacerts" keystorePass="changeit" keystoreType="JKS" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;" useBodyEncodingForURI="true"/></Service>

 

What am I missing?

2 answers

1 accepted

3 votes
Answer accepted
Ricardo Goncalves July 29, 2019

We got it to work using the following connector:

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" keyAlias="te-50a7704f-9b69-4627-b12a-0c2c87a6c70f" keystoreFile="C:\Program Files\Java\jre1.8.0_221\lib\security\cacerts" keystorePass="changeit" keystoreType="JKS" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS" useBodyEncodingForURI="true" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"/>

Muhammad Ramzan(Atlassian Certified Master)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2020

Thank you , you saved my life :) 

Like # people like this
Chris Myers July 1, 2021

This helped, thank you.

Further, if you have configured SSL (with redirect), you'll need to locate both (or all) connector tags in config.xml and ensure that they have these attributes:

relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;" 

 I reiterate this because I found one of the two tucked waaay at the end of the file.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2019

I suspect it's the characters in the relaxedQueryChars string - try shortening it to just "|" to start with, then adding the others back in one or two at a time to work out which ones fail.  My Tomcat fails on the {} pair, as it's reading that as a non-existent variable (but I don't see this too often as I don't like punctuation in urls and usually actively disable it)

Suggest an answer

Log in or Sign up to answer