Error with importing gml for Indonesia DHIS 2.33


I am wondering if anyone has successfully imported the admin0 level gml for Indonesia (country level).

I downloaded the shape file from OCHA, converted it to gml and tried to import it in DHIS 2.33.

Even during downloading from OCHA, Indonesia, because of its structure, took unusual time than other countries which is makes sense but at the time of import in DHIS it says "Failed to load resource: the server responded with a status of 413 (Request entity too large)".

How do I fix this, or if some one can share Indonesia’s admin0 gml, that will be great.

Thank you

I once encountered somehow a similar issue regarding the file size uploaded to dhis, I was using Nginx server between me and the dhis instance, and By default, Nginx has a limit of 1MB on file uploads. I needed to increase this limit in the Nginx configuration, using the client_max_body_size directive, This directive can be set in the http , server or location context.

If you have access to the Nginx configuration you can do one of the following:
Set in http block which affects all server blocks ( virtual hosts ).

http {

client_max_body_size 100M ;

Or set in location block , which affects a particular directory (dhis) under a site/app.

location /dhis{

client_max_body_size 100M;

Save the file and restart Nginx webserver to apply the recent changes using the following command.

systemctl restart nginx
service nginx restart

Once you have saved the changes and restarted the HTTP server, the 413 (Request Entity Too Large) error will be returned only if the size in a request exceeds the New configured value of 100MB.

Also if you are not using Nginx but only Tomcat. In server.xml file you can add maxHttpHeaderSize="65536" to the Tomcat Connector such as:

<Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" maxHttpHeaderSize="65536" />

which increases the size limit same as in Nginx case. anyhow, in summary your problem is related to some size limit that needs to be tweaked in the server.

1 Like