<div dir="ltr">Dear GDAL colleagues,<div><br><div>Does GDAL has any http request failure detection, and mechanism for dealing with it different than raising CPL Error.</div><div>Look at the following GDAL log. (Problem explanation after the log)</div><div><font face="monospace">----------------------------------------------------------------------------------------------------<br></font></div><div><font face="monospace"><i>[Tue Sep  3 10:54:47 2024].7930, 1227.3430: HTTP: Requesting [1/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=1">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=1</a><br>[Tue Sep  3 10:54:47 2024].7930, 1227.3430: HTTP: Requesting [2/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=2">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=2</a><br>[Tue Sep  3 10:54:49 2024].3630, 1228.9130: HTTP: Requesting [3/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=3">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=3</a><br>[Tue Sep  3 10:54:50 2024].3630, 1229.9130: HTTP: Requesting [4/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=4">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=4</a><br>[Tue Sep  3 10:54:50 2024].9300, 1230.4800: HTTP: Requesting [5/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=5">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=5</a><br>[Tue Sep  3 10:54:52 2024].5640, 1232.1140: HTTP: Requesting [6/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=6">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=6</a><br>[Tue Sep  3 10:54:52 2024].7680, 1232.3180: HTTP: Requesting [7/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=7">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=7</a><br>[Tue Sep  3 10:54:53 2024].1190, 1232.6690: HTTP: Requesting [8/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=8">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=8</a><br>[Tue Sep  3 10:54:53 2024].6050, 1233.1550: HTTP: Requesting [9/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=9">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=9</a><br>[Tue Sep  3 10:54:53 2024].9630, 1233.5130: HTTP: Requesting [10/10] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=10">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=10</a><br><b>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [0] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=1">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=1</a> : status = 0, type = (null), error = (null)</b><br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [1] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=2">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=2</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [2] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=3">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=3</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [3] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=4">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=4</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [4] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=5">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=5</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [5] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=6">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=6</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [6] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=7">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=7</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [7] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=8">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=8</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [8] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=9">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=9</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3000, 1233.8500: HTTP: Request [9] <a href="https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=10">https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?service=WMTS&request=GetTile&version=1.0.0&layer=ORTOFOTOMAPA&style=default&format=image/jpeg&TileMatrixSet=EPSG:4326&TileMatrix=EPSG:4326:5&TileRow=4&TileCol=10</a> : status = 200, type = image/jpeg, error = (null)<br>[Tue Sep  3 10:54:54 2024].3030, 1233.8530: WMS: ReadBlockFromCache<br>[Tue Sep  3 10:54:54 2024].3040, 1233.8540: CPLError: C:\Users\Michal\.cache\gdalwmscache\d03651177815877cffe0faf894690352/0/6/069e88521499910bd8763ede3e0cc2c4: No such file or directory<br>ERROR 4: C:\Users\Michal\.cache\gdalwmscache\d03651177815877cffe0faf894690352/0/6/069e88521499910bd8763ede3e0cc2c4: No such file or directory<br><b>[Tue Sep  3 10:54:54 2024].3040, 1233.8540: CPLError: GDALWMS: Unable to open downloaded block.</b><br>ERROR 1: GDALWMS: Unable to open downloaded block.<br>[Tue Sep  3 10:54:54 2024].3040, 1233.8540: WMS: After ReadBlockFromCache<br>[Tue Sep  3 10:54:54 2024].3040, 1233.8540: CPLError: GDALWMS: Unable to download block 1, 4.<br>URL: <br>  HTTP status code: 0, error: (null).<br>Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see <a href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a>).<br>ERROR 1: GDALWMS: Unable to download block 1, 4.<br>URL: <br>  HTTP status code: 0, error: (null).<br>Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see <a href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a>).<br>[Tue Sep  3 10:54:54 2024].3050, 1233.8550: CPLError: GDAL_WMS>, band 3: IReadBlock failed at X offset 1, Y offset 4: GDALWMS: Unable to download block 1, 4.<br>URL: <br>  HTTP status code: 0, error: (null).<br>Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see <a href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a>).<br>ERROR 1: GDAL_WMS>, band 3: IReadBlock failed at X offset 1, Y offset 4: GDALWMS: Unable to download block 1, 4.<br>URL: <br>  HTTP status code: 0, error: (null).<br>Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see <a href="http://www.gdal.org/frmt_wms.html">http://www.gdal.org/frmt_wms.html</a>).</i><br></font></div><div><font face="monospace">----------------------------------------------------------------------------------------------------</font><br></div><div><br></div><div>I use GDALRasterIO from C API and as we can see GDAL makes 10 requests. One of these request (<b>bolded</b>) ends with error, which generates the "Unable to open downloaded block." error later.</div><div>Is there any method to force a <b>re-request</b> in such situations?</div><div>This server error occurs randomly and temporarily, and the next attempt completes without problem.</div><div><br></div><div>Regards,</div><div>Michał </div></div></div>