When opening the DHIS 2 Tracker capture app, the AP request for the me resource leads to a 400 client side error. When looking in the Tomcat logs I see:

Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

I am running Tomcat 8.5. What is the reason for this?

2 Answers 2


This happens because DHIS 2 uses brackets in some of their URLs, and because Tomcat version 8.5 later has prohibited the use of brackets in URLs.

The DHIS 2 team is working on a change in the API syntax to avoid the use of brackets, and to encode all API request URLs.

A short-term fix is to configure Tomcat to allow for brackets through the relaxedQueryChars connector attribute. Open the following file:


and add relaxedQueryChars="[]" to the HTTP connector element:

<Connector protocol="HTTP/1.1"
  relaxedQueryChars="[]" />

This will allow brackets in URLs and DHIS 2 will function as before.


This has since been resolved by DHIS2-5081. Going forward, this should not be a problem with DHIS2 2.29 and newer.

For older versions, it is still required to change the Tomcat configuration as outlined by Lars.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.