Error on loading tracker capture for HNQIS 2.0 checklists

I am getting this error when loading HNQIS 2.0 checklists in DHIS2 Tracker Capture on web. The same is working with DHIS2 Capture on the web. Am using DHIS2 ver 2.38.3.1 on google chrome 130.

Type Exception Report

Message Invalid character found in the request target [/api/me.json?fields=organisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]],teiSearchOrganisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]]&paging=false ]. 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 [/api/me.json?fields=organisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]],teiSearchOrganisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]]&paging=false ]. The valid characters are defined in RFC 7230 and RFC 3986 org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:494) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1735) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:840)

Note The full stack trace of the root cause is available in the server logs.

@luwizghie it looks like it is related with the relaxedQueryChars.

You can red more information in this documentation: Manual install on Ubuntu - DHIS2 Documentation

If the configuration in the documentation doesn’t work, you can try relaxedQueryChars="[,]"

Thanks Carlos,

I tried using the [,] with comma and without the comma and all did not work.

I followed the steps on the Manual install on Ubuntu - DHIS2 Documentation but did not work.

I previously configured the checklist using localhost and the use of worked fine. After importing the checklists using json to a live server this is when I started having this error.

We followed all the steps in the installation manual but did not work.

Hi
Welcome back to the community! :slight_smile:

So if I understand correctly, the issue doesn’t happen in the DHIS2 Capture app but happens in the Tracker Capture app?

@luwizghie just in case:

  • Are you using Tomcat as web server ?
  • Did you restart the web server after changing the relaxedQueryChars?
  • If you type /api/me.json?fields=organisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]],teiSearchOrganisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]]&paging=false in the browser, does it work?
  • If not, can you try /api/me.json?fields=organisationUnits%5Bname%5D (where the squere brackets are enconded)?

@ctejo apologies for late response.

We are using Tomcat 9 as web server and we restarted the webserver after updating/changing the relaxedQueryChars - and this did not work.

After typing this: /api/me.json?fields=organisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]],teiSearchOrganisationUnits[id,displayName,programs[id],level,path,children[id,displayName,programs[id],level,children[id]]]&paging=false

I have the same error:

This /api/me.json?fields=organisationUnits%5Bname%5D was able to show the parent Org Unit

And what is happening if you type /api/me.json?fields=organisationUnits[name] and /api/me.json?fields=organisationUnits[name,id] (so the characters are not encoded) in the browser ?

Am getting the same error for both:

and for the second one: