Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fullWMS requests causing java.awt.image.RasterFormatException #497

Open
emilzse opened this issue Mar 8, 2017 · 2 comments
Open

fullWMS requests causing java.awt.image.RasterFormatException #497

emilzse opened this issue Mar 8, 2017 · 2 comments

Comments

@emilzse
Copy link
Contributor

emilzse commented Mar 8, 2017

I have discovered issue in WMSTileFuser that will result in RasterFormatException from:

tileImg = tileImg.getSubimage(tilex, tiley, tileWidth, tileHeight);`

The issue seems to be related to the request bounds not intersecting the gridsubset when requesting for a tile in a scale/resolution that is not supported by the gwc-layer.

Gridset:

<gridSet>
            <name>EPSG:3857</name>
            <srs>
                <number>3857</number>
            </srs>
            <extent>
                <coords>
                    <double>-2.003750834E7</double>
                    <double>-2.003750834E7</double>
                    <double>2.003750834E7</double>
                    <double>2.003750834E7</double>
                </coords>
            </extent>
            <alignTopLeft>false</alignTopLeft>
            <resolutions>
                <double>78271.516953125</double>
                <double>39135.7584765625</double>
                <double>19567.87923828125</double>
                <double>9783.939619140625</double>
                <double>4891.9698095703125</double>
                <double>2445.9849047851562</double>
                <double>1222.9924523925781</double>
                <double>611.4962261962891</double>
                <double>305.74811309814453</double>
                <double>152.87405654907226</double>
                <double>76.43702827453613</double>
                <double>38.218514137268066</double>
                <double>19.109257068634033</double>
                <double>9.554628534317017</double>
                <double>4.777314267158508</double>
                <double>2.388657133579254</double>
                <double>1.194328566789627</double>
                <double>0.5971642833948135</double>
                <double>0.29858214169740677</double>
                <double>0.14929107084870338</double>
                <double>0.07464553542435169</double>
                <double>0.037322767712175846</double>
            </resolutions>
            <metersPerUnit>1.0</metersPerUnit>
            <pixelSize>0.28</pixelSize>
            <tileHeight>256</tileHeight>
            <tileWidth>256</tileWidth>
            <yCoordinateFirst>false</yCoordinateFirst>
        </gridSet>

Layers subgridset:

{"gridSetName":"EPSG:3857","extent":{"coords":[1180028.085241,8371297.480924,1192994.191536,8381178.256421]}}

Example request:
http://demo/geowebcache/service/wms?FORMAT=image/png&STYLES=&WIDTH=256&HEIGHT=256&EXCEPTIONS=application/vnd.ogc.se_inimage&REQUEST=GetMap&SRS=EPSG:3857&BBOX=1233946.9389106,8346452.171921,1255967.0789508,8368472.3119613&VERSION=1.1.1&SERVICE=WMS&TRANSPARENT=TRUE&LAYERS=layer_xxx

stack trace

2017-03-08 07:17:15,809 ERROR (ajp-0.0.0.0-8009-22)[STDERR] java.awt.image.RasterFormatException: (x + width) is outside of Raster
2017-03-08 07:17:15,810 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at sun.awt.image.ByteInterleavedRaster.createWritableChild(ByteInterleavedRaster.java:1245)
2017-03-08 07:17:15,811 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202)
2017-03-08 07:17:15,812 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at org.geowebcache.service.wms.WMSTileFuser.renderCanvas(WMSTileFuser.java:705)
2017-03-08 07:17:15,812 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at org.geowebcache.service.wms.WMSTileFuser.writeResponse(WMSTileFuser.java:859)
2017-03-08 07:17:15,813 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at org.geowebcache.service.wms.WMSService.handleRequest(WMSService.java:296)
2017-03-08 07:17:15,814 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at org.geowebcache.GeoWebCacheDispatcher.handleServiceRequest(GeoWebCacheDispatcher.java:357)
2017-03-08 07:17:15,815 ERROR (ajp-0.0.0.0-8009-22)[STDERR] at org.geowebcache.GeoWebCacheDispatcher.handleRequestInternal(GeoWebCacheDispatcher.java:267)

emilzse added a commit to emilzse/geowebcache that referenced this issue Mar 8, 2017
* Will handle fullWMS request from different scale, than supported once, and where request is not intersecting with source bounds by responding with empty tile
@emilzse
Copy link
Contributor Author

emilzse commented Mar 8, 2017

Found this old thread, not sure if it is the same case

https://sourceforge.net/p/geowebcache/mailman/message/30624923/

emilzse added a commit to emilzse/geowebcache that referenced this issue Mar 8, 2017
* Will handle fullWMS request from different scale, than supported once, and where request is not intersecting with source bounds by responding with empty tile
@onack
Copy link

onack commented Apr 9, 2019

This is the second time in a year I have experienced this bug, so it is not very common. Here is some data to shed some light on the issue.

Request:
http:///geoserver/gwc/service/wms?service=WMS&version=1.3.0&request=GetMap&layers=fkb&width=800&height=910&srs=EPSG%3A32633&bbox=237888.22528090543%2C7086006.260683611%2C249433.85877858126%2C7092612.445754076&format=image%2Fpng

Verbose log from geowebcache:

april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSService] - Recombinining tiles to respond to WMS request
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - x res: 14.557041872094779 y res: 7.259544033478372 tmpResolution: 7.259544033478372
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - z: 9 , resolution: 5.6 (7.259544033478372)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - intersection rectangle: [1362, 631, 1371, 635, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - intersection bounds: 236529.19999999995,7085521.6,250865.19999999995,7092689.6 (237788.22528090543,7086006.260683611,249433.85877858126,7092612.445754076)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - Bound offsets: [-1259.02528090548, -484.6606836114079, -1431.3412214186974, -77.15424592327327]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - Canvas size: 2080, 1180
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - Canvas offsets: [-225, -87, -511, -13]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(225,0,31,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,0,1011,null) [1362, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,31,1011,null) [1363, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,287,1011,null) [1364, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,543,1011,null) [1365, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,799,1011,null) [1366, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,1055,1011,null) [1367, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,1311,1011,null) [1368, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,1567,1011,null) [1369, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,256,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - drawImage(subtile,1823,1011,null) [1370, 631, 9]
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSTileFuser] - tileImg.getSubimage(0,0,-255,169)
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [wms.WMSService] - java.awt.image.RasterFormatException: (x + width) is outside of Raster
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [geoserver.filters] - Not compressing output for mimetype: {0}
april 09 11:03:07 tvx-gis-04 startup.sh[5626]: 09 Apr 11:03:07 DEBUG [filter.GeoServerSecurityContextPersistenceFilter$1] - SecurityContextHolder now cleared, as request processing completed

Versions:
Running combined Geoserver with GWC, standalone with Jetty
Geoserver 2.13.2
GeoWebCache Version 1.13.2, build 1.13.x/78018a44f070339647f3c302b868adb5f1b08290

Gridset:

  <gridSet>
     <name>32633</name>
     <srs>
       <number>32633</number>
     </srs>
     <extent>
       <coords>
         <double>-1716034.0</double>
         <double>6180920.0</double>
         <double>2749458.0</double>
         <double>8303992.0</double>
       </coords>
     </extent>
     <alignTopLeft>false</alignTopLeft>
     <scaleDenominators>
       <double>1.024E7</double>
       <double>5120000.0</double>
       <double>2560000.0</double>
       <double>1280000.0</double>
       <double>640000.0</double>
       <double>320000.0</double>
       <double>160000.0</double>
       <double>80000.0</double>
       <double>40000.0</double>
       <double>20000.0</double>
       <double>10000.0</double>
       <double>5000.0</double>
       <double>3000.0</double>
       <double>2500.0</double>
       <double>2000.0</double>
       <double>1500.0</double>
       <double>1250.0</double>
       <double>1000.0</double>
       <double>750.0</double>
       <double>500.0</double>
       <double>250.0</double>
       <double>100.0</double>
       <double>50.0</double>
       <double>25.0</double>
     </scaleDenominators>
     <metersPerUnit>1.0</metersPerUnit>
     <pixelSize>2.8E-4</pixelSize>
     <scaleNames>
       <string>32633:0</string>
       <string>32633:1</string>
       <string>32633:2</string>
       <string>32633:3</string>
       <string>32633:4</string>
       <string>32633:5</string>
       <string>32633:6</string>
       <string>32633:7</string>
       <string>32633:8</string>
       <string>32633:9</string>
       <string>32633:10</string>
       <string>32633:11</string>
       <string>32633:12</string>
       <string>32633:13</string>
       <string>32633:14</string>
       <string>32633:15</string>
       <string>32633:16</string>
       <string>32633:17</string>
       <string>32633:18</string>
       <string>32633:19</string>
       <string>32633:20</string>
       <string>32633:21</string>
       <string>32633:22</string>
       <string>32633:23</string>
     </scaleNames>
     <tileHeight>256</tileHeight>
     <tileWidth>256</tileWidth>
     <yCoordinateFirst>false</yCoordinateFirst>
   </gridSet>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants