Jira server startup fails with Tomcat misconfigured error
After upgrading Apache Tomcat to version 8.5.32 (see
JRASERVER-68058
-
Getting issue details...
STATUS
), we’ve added new properties to the server.xml
file that allow Tomcat to accept requests with special characters. Depending on the version you’re upgrading from, you might need to add these properties to your server.xml
file.
Symptoms
You can recognize that your server.xml
file is missing these configuration properties by the following problems:
- The advanced search panel (JQL) is not displaying
- Accessing some pages in Jira fail (404 error)
- When starting up Jira, an error is displayed blocking the startup
- An error about Tomcat misconfiguration is written in the log file
Affected versions
- If you’re installing Jira from scratch, regardless of the version, you’re good to go, as the new
server.xml
file will contain the right properties. - If you’re upgrading from Jira 7.12.1 or earlier to any later version, make sure you don’t just copy the old
server.xml
file into the new version, but add the required properties (as described below)
Problem in detail
The Apache Tomcat server, which is a web server used by Jira, is filtering out requests that contain special characters. That’s because Tomcat is using a different encoding and URI standard than most browsers. The problem is most visible when searching with JQL as you’d use a number of special characters when doing it (e.g. []<>), but it can also affect other pages in Jira.
See also Apache Tomcat 8.5 http docs for more details:
relaxedPathChars:
The HTTP/1.1 specification requires that certain characters are %nn encoded when used in URI paths. Unfortunately, many user agents including all the major browsers are not compliant with this specification and use these characters in unencoded form. To prevent Tomcat rejecting such requests, this attribute may be used to specify the additional characters to allow. If not specified, no additional characters will be allowed. The value may be any combination of the following characters:
" < > [ \ ] ^ ` { | }
. Any other characters present in the value will be ignored.
Solution
- Go to
<Jira-installation-directory>/conf
, and edit theserver.xml
file. - 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).
Add
relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`"<>"
to all HTTP\S connectors with properties inserver.xml
.
For example:<Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`"<>" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" bindOnInit="false"/>
The above example assumes that the application is using port 8080. Depending on the configuration, the changes may need to apply to different connectors.
- Restart Jira.
- (Data Center) Repeat these steps for each node.