mapfish-print
mapfish-print copied to clipboard
Mapfish print module of Geoserver some times fail to render WMS
I am working with Mapfish print module of Geoserver (2.8.2). Sometimes when the extent of the print contain many WMS layers it fails to render the wms into the pdf response. Do you have any idea how can I fix this problem?
Below you can see the geoserver log:
2016-10-26 08:31:38,047 ERROR [print.PDFUtils] - Server returned an error for http://localhost:8080/geoserver/wms?BBOX=1.391471915615139E7%2C697913.1945346206%2C1.3922832657455165E7%2C704004.3393717288&WIDTH=2808&HEIGHT=2108&elevation=0%2F999&format_options=dpi%3A300&map_resolution=300&FORMAT=image%2Fpng&STYLES=&LAYERS=[Some Layers]&REQUEST=GetMap&SRS=EPSG%3A3857&VERSION=1.1.1&styles=&SERVICE=WMS&time=1970-01-01%2F2016-10-26&DPI=300&TRANSPARENT=true: Read timed out
2016-10-26 08:31:38,047 ERROR [print.PDFCustomBlocks] - Error while adding a PDF elementjava.io.IOException: Read timed out
2016-10-26 08:31:43,173 WARN [print.MapPrinter] - [Overtime Print] {"midLat":"6.28418","extentRight":"125.07081","units":"meter","layout":"A4 landscape","mapTitle":"NO TITLE","pages":[{"mapTitle":"A sample map title","bbox":[1.3914732331303276E7,697921.8199531747,1.3922819482303277E7,703995.7139531748],"rotation":"0","comment":"some comments"}],"legends":[{"classes":[{"iconBeforeName":true,"name":"Field Boundary","icons":["/geo-data/data_dir/printing/legend/Field_Boundary-Field_Boundary.png"]}],"name":"Field Boundary"}],"srs":"EPSG:3857","extentLeft":"124.99816","extentTop":"6.31129","extentButtom":"6.25706","layers":[{"baseURL":"http://a.tile.openstreetmap.org","extension":"png","tileSize":[256,256],"resolutions":[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,0.5971642833948135],"type":"OSM","opacity":1,"maxExtent":[-2.00375083392E7,-2.00375083392E7,2.00375083392E7,2.00375083392E7]},{"baseURL":"http://localhost:8080/geoserver/wms","singleTile":false,"customParams":{"elevation":"0/999","styles":"","time":"1970-01-01/2016-10-26"},"layers":["dole_mak_test:new"],"format":"image/png","type":"WMS","opacity":1},{"baseURL":"http://localhost:8080/geoserver/wms","singleTile":false,"customParams":{"elevation":"0/999","styles":"FieldBoundary","time":"1970-01-01/2016-10-26"},"layers":["dole_phil:field"],"format":"image/png","type":"WMS","opacity":1}],"comment":"Orderd by Mahdi-Kianirad; ","dpi":300,"midLong":"125.03449"}
2016-10-26 08:32:12,307 ERROR [map.png] - Failed to encode the PNG
ar.com.hjg.pngj.PngjOutputException: org.geoserver.ows.ClientStreamAbortedException
at ar.com.hjg.pngj.PngHelperInternal.writeBytes(PngHelperInternal.java:196)
at ar.com.hjg.pngj.chunks.ChunkRaw.writeChunk(ChunkRaw.java:97)
at ar.com.hjg.pngj.PngIDatChunkOutputStream.flushBuffer(PngIDatChunkOutputStream.java:28)
at ar.com.hjg.pngj.ProgressiveOutputStream.checkFlushBuffer(ProgressiveOutputStream.java:65)
at ar.com.hjg.pngj.ProgressiveOutputStream.write(ProgressiveOutputStream.java:34)
at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253)
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211)
at ar.com.hjg.pngj.PngWriter.filterAndSend(PngWriter.java:245)
at ar.com.hjg.pngj.PngWriter.writeRow(PngWriter.java:572)
at ar.com.hjg.pngj.PngWriter.writeRow(PngWriter.java:548)
at it.geosolutions.imageio.plugins.png.PNGWriter.writePNG(PNGWriter.java:90)
at org.geoserver.wms.map.png.PNGJWriter.writePNG(PNGJWriter.java:51)
at org.geoserver.wms.map.PNGMapResponse.formatImageOutputStream(PNGMapResponse.java:104)
at org.geoserver.wms.map.RenderedImageMapResponse.write(RenderedImageMapResponse.java:123)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:996)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:279)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:135)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:87)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: org.geoserver.ows.ClientStreamAbortedException
at org.geoserver.ows.DispatcherOutputStream.write(DispatcherOutputStream.java:46)
at ar.com.hjg.pngj.PngHelperInternal.writeBytes(PngHelperInternal.java:194)
... 92 more
Caused by: org.mortbay.jetty.EofException
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(AbstractGenerator.java:548)
at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:569)
at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:910)
at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:646)
at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:577)
at org.geoserver.filters.FlushSafeResponse$FlushSafeServletOutputStream.write(FlushSafeResponse.java:58)
at org.vfny.geoserver.util.PartialBufferedOutputStream2.write(PartialBufferedOutputStream2.java:155)
at org.geoserver.ows.DispatcherOutputStream.write(DispatcherOutputStream.java:44)
... 93 more
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
at org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:166)
at org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:207)
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
... 101 more
I have exactly the same issue. Sometimes the Mapfish Print module give a "read timed out" error, and the map for the print report isn't generated. Any idea ?
Any feedback on this question?