1

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?

1

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:

/tomcat-dir/conf/server.xml

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

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

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

| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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