[Geoserver-users] GeoServer Print/Mapfish(?) Sending too large get requests

Hi all,

I’m not sure if this is a problem with the GeoServer print module, or mapfish or just the way I use it. I’m also not sure if this is the right forum to ask for help with the print module, but I hope you can point me in the right direction :slight_smile:

So, I’m running a web application based on OpenLayers, and I have just added GeoExt to it and the print module on the GeoServer I use so that I can download the map in pdf. My layers consists of quite complex wms-queries (huge filters), and can be quite long, I therefore mostly have to use post requests and not get requests for the layers.

The problem is that when I try to fetch the pdf, the print module attempts to fetch all the layers with a get request, which leads to a few errors because of too long requests.

short paste of what I would guess is “important” in the log:

260311155 [btpool0-126] WARN org.mortbay.log - handle failed
java.io.IOException: FULL head
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:276)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

09 jan 11:52:00 WARN [print.PDFUtils] - Server returned an error for http://10.47.10.39:8090/geoserver/greensad/wms?<and then a 40000+ characters long request>

the long request also messes up the output of the logs, which leads to parts of the stacktrace to come in between in the 40k-char-request. If a better stacktrace or log could be of use, please say so.

I should first note that I’m testing on a jetty server, but I expect it to be no different on tomcat (which is in use in production) due to the enormous get-request it makes. Also, the wms it reuqests to is the same as mapfish is hosted on (10.47.10.39 is localhost) if that could make the issue easier to solve (like it should not request the wms-layer through http if its hosted on the same geoserver).

The pdf gets returned with the layers that are short enough, so the base layer and a few other simple layers.

Many thanks,
Aleksander Vines

Hi Aleksander,
I think this happens because MapFish print is merging all the layers request to WMS into a single get request, and since you have a very long list of layers this creates a URL that is not accepted by jetty, that has a default buffer size for the whole request header (4k I think).
The buffer size can be increased configuring Jetty and/or Tomcat. Try to look here: http://serverfault.com/questions/136249/how-do-we-increase-the-maximum-allowed-http-get-query-length-in-jetty

In the long term maybe a check inside the mapfish-print library should be introduced to split such long requests into smaller ones (maybe introducing a configurable maxMergeableLayers property or something like that).

Regards,
Mauro Bartolomeoli

···

2014/1/9 Aleksander Vines <aleksander.vines@anonymised.com>

Hi all,

I’m not sure if this is a problem with the GeoServer print module, or mapfish or just the way I use it. I’m also not sure if this is the right forum to ask for help with the print module, but I hope you can point me in the right direction :slight_smile:

So, I’m running a web application based on OpenLayers, and I have just added GeoExt to it and the print module on the GeoServer I use so that I can download the map in pdf. My layers consists of quite complex wms-queries (huge filters), and can be quite long, I therefore mostly have to use post requests and not get requests for the layers.

The problem is that when I try to fetch the pdf, the print module attempts to fetch all the layers with a get request, which leads to a few errors because of too long requests.

short paste of what I would guess is “important” in the log:

260311155 [btpool0-126] WARN org.mortbay.log - handle failed
java.io.IOException: FULL head
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:276)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

09 jan 11:52:00 WARN [print.PDFUtils] - Server returned an error for http://10.47.10.39:8090/geoserver/greensad/wms?<and then a 40000+ characters long request>

the long request also messes up the output of the logs, which leads to parts of the stacktrace to come in between in the 40k-char-request. If a better stacktrace or log could be of use, please say so.

I should first note that I’m testing on a jetty server, but I expect it to be no different on tomcat (which is in use in production) due to the enormous get-request it makes. Also, the wms it reuqests to is the same as mapfish is hosted on (10.47.10.39 is localhost) if that could make the issue easier to solve (like it should not request the wms-layer through http if its hosted on the same geoserver).

The pdf gets returned with the layers that are short enough, so the base layer and a few other simple layers.

Many thanks,
Aleksander Vines


CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users