<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;}
span.spelle
        {mso-style-name:spelle;}
span.Shkpostityyli27
        {mso-style-type:personal-compose;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Large <span class="spelle">MaxConnections</span> value leads to more concurrent requests and it may cause problems if the WMS server is very busy. Reducing
<span class="spelle">MaxConnections</span> may help if you are the only user of that WMS but if there are thousands of other users as well the service may still run at 100% and drop request either because they reach the server side timeout or because load balancer
 denies requests. If the overload is temporary then retry after a while could help but I do not believe that GDAL WMS driver can be configured that way  <a href="https://gdal.org/drivers/raster/wms.html" target="_BLANK">https://gdal.org/drivers/raster/wms.html</a>. 
 Special tile cache programs like GeoWebCache are better prepared for failing requests
<a href="https://www.geowebcache.org/docs/current/production/index.html#seed-failure-tolerance">
https://www.geowebcache.org/docs/current/production/index.html#seed-failure-tolerance</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The GDAL WMS configuration options are documented only by example
<a href="https://gdal.org/drivers/raster/wms.html">https://gdal.org/drivers/raster/wms.html</a>. I wonder where I could find information about the meaning of options that I can’t guess by the name, like “CleanTimeout”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>-Jukka Rahkonen-<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span class="spelle"><b><span lang="EN-US">Lähettäjä</span></b></span><b><span lang="EN-US">:</span></b><span lang="EN-US"> Roman
<span class="spelle">Breitfuss</span>-Schiffer <roman.schiffer@gmail.com> <br>
<span class="spelle"><b>Lähetetty</b></span><b>:</b> <span class="spelle">perjantai</span> 19.
<span class="spelle">marraskuuta</span> 2021 10.18<br>
<span class="spelle"><b>Vastaanottaja</b></span><b>:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi>; gdal-dev@lists.osgeo.org<br>
<span class="spelle"><b>Aihe</b></span><b>:</b> Re: [<span class="spelle">gdal</span>-dev] GDALWMS - error: TCP connection reset by peer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p><span class="spelle"><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Dear</span></span><span lang="EN-US" style="font-family:"Tahoma",sans-serif"> Jukka!</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Thanks for your answer! I think I'm gonna follow that road you suggested.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">We have been thinking a lot and I was just wondering if there could be some GDAL configuration which could cause that behaviour? For example the value for <MaxConnections> in the WMS XML file? Or
 if more applications are accessing the same WMS XML at the same time which is theoretically possible in our case.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Best regards<br>
Roman</span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Am 18.11.2021 um 12:12 schrieb Rahkonen Jukka (MML):<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It seems that the WMS server is closing the door and there is nothing else to do on the GDAL side except to try again later. Contact the WMS service maintainer and report your troubles. They may be able to provide you
 a more reliable service especially if you are ready to pay for it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">Lähettäjä:</span></b><span lang="EN-US"> gdal-dev
</span><a href="mailto:gdal-dev-bounces@lists.osgeo.org"><span lang="EN-US"><gdal-dev-bounces@lists.osgeo.org></span></a>
<b><span lang="EN-US">Puolesta </span></b><span lang="EN-US">Roman Breitfuss-Schiffer<br>
<b>Lähetetty:</b> torstai 18. marraskuuta 2021 11.59<br>
<b>Vastaanottaja:</b> </span><a href="mailto:gdal-dev@lists.osgeo.org"><span lang="EN-US">gdal-dev@lists.osgeo.org</span></a><span lang="EN-US"><br>
<b>Aihe:</b> [gdal-dev] GDALWMS - error: TCP connection reset by peer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Dear all!</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">We are running a Python application an a linux distribution (RedHat) which creates clips in MBTILES format from a WMS. We are using the Python-API and are basically doing something like this:</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Courier New"">src_ds = gdal.Warp(<br>
    tmp_file,<br>
    ds_in,<br>
    format='GTiff',<br>
    outputBounds=[bbox[0], bbox[2], bbox[1], bbox[3]],<br>
    dstSRS=output_srs,<br>
)<br>
ds_out = gdal.Translate(<br>
    out_filepath,<br>
    src_ds,<br>
    format='MBTILES',<br>
    creationOptions=creation_options,<br>
)</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">The application throughs an error from time to time since a few days. We couldn't figure out a pattern yet and therefore we are also not able to reproduce the error. The error is the following:</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Courier New"">Mon Nov 15 13:48:13 2021: CPLError: GDALWMS: Unable to download block 2765, 602.<br>
URL: TCP connection reset by peer<br>
  HTTP status code: 0, error: TCP connection reset by peer.<br>
Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see </span>
<a href="http://www.gdal.org/frmt_wms.html" target="_BLANK"><span lang="EN-US" style="font-family:"Courier New"">http://www.gdal.org/frmt_wms.html</span></a><span lang="EN-US" style="font-family:"Courier New"">).<br>
Mon Nov 15 13:48:13 2021: CPLError: /wms_xml/wms_config.xml, band 1: IReadBlock failed at X offset 2764, Y offset 601<br>
Mon Nov 15 13:48:13 2021: CPLError: GetBlockRef failed at X block offset 2764, Y block offset 601</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">The exact same data gets processed successfully in one run and not successfully in another run. We didn't change the code nor the Python or GDAL version. Hence, we are kind of puzzled as the error
 comes and goes seemingly at random.</span><span lang="EN-US"> <o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Does anyone of you have any hints?</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Thanks & best regards!<br>
Roman</span><span lang="EN-US"><o:p></o:p></span></p>
<pre><span lang="EN-US">_______________________________________________<o:p></o:p></span></pre>
<pre><span lang="EN-US">Dipl.-Ing. </span>Roman Breitfuss-Schiffer, MSc. (GIS)<o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Dipl.-Ing. Roman Breitfuss-Schiffer, MSc. (GIS)<o:p></o:p></pre>
<pre>Veronikagasse 38/20, 1170 Wien<o:p></o:p></pre>
<pre>+43 664 5547678<o:p></o:p></pre>
</div>
</div>
</body>
</html>