java.lang.IllegalArgumentException thrown when attempting to launch Event Visualizer

Hi Folks,

I have deployed DHIS2 v2.26 (but I am seeing this same issue seen on v2.29) on an AWS EC2 t2.medium instance running Ubuntu v16.04.

The build went fine and I can log into the system with the default account and was also able to restore an old psql dump I need work on (dump was taken on a v2.26 system).

I’m experiencing an issue with both the dashboard and when trying to launch the event visualizer.

The dashboard does not render anything and the EV looks as though it just hangs after launching.

The catalina.out log shows the following entry each time I attempt to switch between the dashboard and the EV:

09-Jul-2018 00:16:10.370 INFO [http-nio-8080-exec-6] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I searched online and it seems to indicate an issue with therequestTargetAllow

property in catalina.properties - see the following thread:

https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters/44005213#44005213

I’ve updated catalina.properties as described, stopped the tomcat service, reloaded the daemon and started again but I get the same issue.

I believe the psql dump file is good and the restore when ok, because the same archive and restore process on a DHIS2-LIVE local version (2.29) works as expected.

Has anyone experienced the same or a similar issue?

Any suggestions on how to proceed?

Many thanks,

Kevin

Hi Dan,

Thanks for getting back to me - not 100% sure if this is what you mean - but when trying to launch the EV it seems to stop here:

  1. Request URL:

http://ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080/api/optionSets.json?fields=id,name,version,options[code,name]&paging=false&_dc=1531169093448

  1. Request Method:

GET

  1. Status Code:

400

  1. Remote Address:

18.219.193.229:8080

  1. Referrer Policy:

no-referrer-when-downgrade

  1. Response Headersview source
  2. Connection:

close

  1. Date:

Mon, 09 Jul 2018 20:44:53 GMT

  1. Transfer-Encoding:

chunked

  1. Request Headersview source
  2. Accept:

/

  1. Accept-Encoding:

gzip, deflate

  1. Accept-Language:

en-US,en;q=0.9

  1. Connection:

keep-alive

  1. Cookie:

JSESSIONID=6733ECA3C8DC3409FEC2B05909C3EBA6

  1. Host:

ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080

  1. Referer:

http://ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080/dhis-web-event-visualizer/index.html

  1. User-Agent:

Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

  1. X-Requested-With:

XMLHttpRequest

  1. Query String Parametersview parsed
  2. fields=id,name,version,options[code,name]&paging=false&_dc=1531169093448

When the dashboard trys to load I get this:

  1. Request URL:

http://ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080/api/dashboards/IE9rGRCXp0D?fields=:all,dashboardItems[:all,reports[id,displayName],chart[id,displayName],map[id,displayName],reportTable[id,displayName],resources[id,displayName],users[id,displayName]]&_=1531169163096

  1. Request Method:

GET

  1. Status Code:

400

  1. Remote Address:

18.219.193.229:8080

  1. Referrer Policy:

no-referrer-when-downgrade

  1. Response Headersview source
  2. Connection:

close

  1. Date:

Mon, 09 Jul 2018 20:46:02 GMT

  1. Transfer-Encoding:

chunked

  1. Request Headersview source
  2. Accept:

application/json, text/javascript, /; q=0.01

  1. Accept-Encoding:

gzip, deflate

  1. Accept-Language:

en-US,en;q=0.9

  1. Connection:

keep-alive

  1. Cookie:

JSESSIONID=6733ECA3C8DC3409FEC2B05909C3EBA6

  1. Host:

ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080

  1. Referer:

http://ec2-18-219-193-229.us-east-2.compute.amazonaws.com:8080/dhis-web-dashboard-integration/index.html

  1. User-Agent:

Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

  1. X-Requested-With:

XMLHttpRequest

  1. Query String Parametersview sourceview URL encoded
  2. fields:

:all,dashboardItems[:all,reports[id,displayName],chart[id,displayName],map[id,displayName],reportTable[id,displayName],resources[id,displayName],users[id,displayName]]

  1. _:

1531169163096

If a newer version of 2.26 would address the issue, should I also expect that it would be resolved in 2.29 also?

Thanks,

Kevin

···

On Mon, Jul 9, 2018 at 4:18 PM Dan Cocos dcocos@gmail.com wrote:

Can you share what request is being made from your browser debugging console?

There were changes made to Tomcat to correct a CVE wherein disallowed characters were being accepted when they shouldn’t be, specifically the “|” character. You may have to upgrade to a more recent revision of 2.26 when DHIS 2 was updated to no longer expect disallowed characters.

The Tomcat commit can be found here https://bz.apache.org/bugzilla/show_bug.cgi?id=62273

Dan Cocos
Principal, BAO Systems
dcocos@baosystems.com | http://www.baosystems.com | 2900 K Street, Suite 406, Washington D.C. 20007

On Jul 9, 2018, at 3:50 PM, Kevin Bolger kevin.bolger@gmail.com wrote:

Hi Folks,

I have deployed DHIS2 v2.26 (but I am seeing this same issue seen on v2.29) on an AWS EC2 t2.medium instance running Ubuntu v16.04.

The build went fine and I can log into the system with the default account and was also able to restore an old psql dump I need work on (dump was taken on a v2.26 system).

I’m experiencing an issue with both the dashboard and when trying to launch the event visualizer.

The dashboard does not render anything and the EV looks as though it just hangs after launching.

The catalina.out log shows the following entry each time I attempt to switch between the dashboard and the EV:

09-Jul-2018 00:16:10.370 INFO [http-nio-8080-exec-6] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I searched online and it seems to indicate an issue with therequestTargetAllow

property in catalina.properties - see the following thread:

https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters/44005213#44005213

I’ve updated catalina.properties as described, stopped the tomcat service, reloaded the daemon and started again but I get the same issue.

I believe the psql dump file is good and the restore when ok, because the same archive and restore process on a DHIS2-LIVE local version (2.29) works as expected.

Has anyone experienced the same or a similar issue?

Any suggestions on how to proceed?

Many thanks,

Kevin


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

Dear Kevin,

I found myself in a similar position but there was something I did that seems to have caused this. I did not copy the “files” directory created by dhis2 while deploying the war to the new installation default “dhis2” directory. In fact I deleted it without checking contents in trying to clean up the system. The same dashboard items were stored as favourites and they exist as they were since these are stored in the db.

I also confirmed this when I revived the original 2.26 where the dashboards came out blank since the directory was cleaned.

So apparently you’ll have to render them in visualizer and pin them again to the dashboard. More experienced users could confirm.

···

On Tue, Jul 10, 2018 at 1:20 AM, Kevin Bolger kevin.bolger@gmail.com wrote:

Hi Folks,

I have deployed DHIS2 v2.26 (but I am seeing this same issue seen on v2.29) on an AWS EC2 t2.medium instance running Ubuntu v16.04.

The build went fine and I can log into the system with the default account and was also able to restore an old psql dump I need work on (dump was taken on a v2.26 system).

I’m experiencing an issue with both the dashboard and when trying to launch the event visualizer.

The dashboard does not render anything and the EV looks as though it just hangs after launching.

The catalina.out log shows the following entry each time I attempt to switch between the dashboard and the EV:

09-Jul-2018 00:16:10.370 INFO [http-nio-8080-exec-6] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I searched online and it seems to indicate an issue with therequestTargetAllow

property in catalina.properties - see the following thread:

https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters/44005213#44005213

I’ve updated catalina.properties as described, stopped the tomcat service, reloaded the daemon and started again but I get the same issue.

I believe the psql dump file is good and the restore when ok, because the same archive and restore process on a DHIS2-LIVE local version (2.29) works as expected.

Has anyone experienced the same or a similar issue?

Any suggestions on how to proceed?

Many thanks,

Kevin


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Warm regards,

Gautam Morey

Founder & CEO

Sofomo Embedded Solutions Pvt Ltd

www.lifeplot.in

Mobile : +91-9890118767