Request-URI Too Long, error

Hello everyone, please I have a few questions and observations related to this:

We are currently running DHIS2 ver 2.34.6.

Firstly, the maximum number of analytics records is set to unlimited. I am trying to download an event report that has 134 events with over a hundred data fields. When I try to download using Excel, I get this error:
image

The same error shows up when I try to use HTML or CSV.

When I use a plain data source, I only get the first 100 records in the event program. Is this by design or this is a bug?

When I try to use the data dump feature, I get no response but end up seeing the error message below in the browser console.

Uncaught TypeError: Cannot read property ‘concat’ of null
at t.Layout.B.toRows (app.js:7)
at g.A.openDataDump (app.js:10)
at m.handler (app.js:12)
at Object.callback (ext-all.js:15)
at m.onClick (ext-all.js:15)
at m.onClick (ext-all.js:15)
at HTMLDivElement.eval (eval at functionFactory (ext-all.js:15), :6:4)
at HTMLDivElement.c (ext-all.js:15)

Does anyone have an idea of what could be responsible for these issues?

Thank you.

Ifeanyi

@ifeanyiokoye the error you mention has nothing to do with the other issues per se, but rather is the result of a request being too long for the HTTP server to handle. You will need to break the URL up into smaller pieces (preferably so that the number of characters in the URL is less than 2000). If you are getting this error from an event report, I do not think there is any workaround for this at this point. The URL length must be shorter than a certain number of characters (which depends a bit on your reverse proxy setup). You would need to decrease the number of data fields in the report in order to make the URL length shorter. In practice this means you might need to break a single table up into multiple smaller tables.

A very similar issue is described here [DHIS2-1373] - Jira.

1 Like

Thank you @jason for the insight into this.
My understanding is that this is one of the issues the data dump using the option combined with the update button was supposed to help with.

1 Like

This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information. The HTTP 414 URI Too Long response status code indicates that the URI(Uniform Resource Identifier) requested by the client is longer than the server is willing to interpret.

To resolve this problem :

  • By POST request: Convert query string to json object and sent to API request with POST.

  • By GET request: Max length of request is depend on sever side as well as client side. Most webserver have limit 8k which is configurable. On the client side the different browser has different limit. The browser IE and Safari limit to 2k, Opera 4k and Firefox 8k. This means that the max length for the GET request is 8k and min request length is 2k.

If exceed the request max length then the request truncated outside the limit by web server or browser without any warning. Some server truncated request data but the some server reject it because of data lose and they will return with response code 414 Request-URI Too Long.

Under Apache, the limit is a configurable value, LimitRequestLine. If you want to increase URL limit to 5000 characters (bytes), add the following lines to your server configuration or virtual host file.

LimitRequestLine 5000

If you want to increase maximum header length supported by Apache to 3000 characters, then add the following line.

LimitRequestFieldSize 3000

2 Likes