HTTP Status 400 – Bad Request

Hi all,

I want to fill a tracker program, but metadata load is failing, so I can not have access to org units and tracker program.

In chrome I opened developer tools and in Network I get:

HTTP Status 400 – Bad Request


Type Exception Report
Message Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Exception
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/8.5.39 (Ubuntu)

Thanks

Thanks @fernandoshake! The log you posted above refers us to the Catalina.out log so would you please post the Catalina.out log (without including the sensitive information - password…etc) Additionally, please check the request from the Network tab (the error you copied is from the console tab) - it would help to know what is the request that is causing the issue.

I’d suggest trying a different clean browser and Data Administration app → Maintenance → Clear application cache & Reload apps. – See if it works, but if it doesn’t work, we need the Catalina.out.

Thank you for your patience! :+1:

Hi @fernandoshake,

You need to add ‘relaxedQueryChars’ element to the HTTP connector. Open the following file: /tomcat-dir/conf/server.xml and add relaxedQueryChars=“[]” to the HTTP connector element:

Source: DHIS2 Web Portal – In Bangladesh

Thanks
Julhas

2 Likes

Hi @fernandoshake,

Were you able to solve this issue? Please see the proposed solution by @julhas, thanks Julhas for the help! :+1: