<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>ok,</p>
    <p>so the issue was related to QGIS setting VSI_CACHE=YES, which
      triggered a bug in /vsicurl_streaming/</p>
    <p>So the workaround is that you type "set VSI_CACHE=" in the QGIS
      console</p>
    <p>Proper fix queued in <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/13690">https://github.com/OSGeo/gdal/pull/13690</a></p>
    <p>Even</p>
    <div class="moz-cite-prefix">Le 12/01/2026 à 17:59, Jeroen Hovens a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:007e01dc83e4$cf446360$6dcd2a20$@groenebij.nl">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <div class="WordSection1">
        <p class="MsoNormal">Hi Even,</p>
        <p class="MsoNormal"> </p>
        <p class="MsoNormal"><span lang="EN-GB">Find attached two txt
            files.</span></p>
        <p class="MsoNormal"><span lang="EN-GB">env_var_winprompt is the
            normal windows prompt terminal after adding the QGIS bin
            folder to path</span></p>
        <p class="MsoNormal"><span lang="EN-GB">env_var_qgisterminal is
            the QGIS terminal as is, no changes made</span></p>
        <p class="MsoNormal"><span lang="EN-GB"> </span></p>
        <p class="MsoNormal"><span lang="EN-GB">Jeroen</span></p>
        <p class="MsoNormal"><span lang="EN-GB"> </span></p>
        <p class="MsoNormal"><span lang="EN-GB"> </span></p>
        <div>
          <div>
            <p class="MsoNormal"><b><span>Van:</span></b><span> Even
                Rouault <a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a> <br>
                <b>Verzonden:</b> maandag 12 januari 2026 17:34<br>
                <b>Aan:</b> Jeroen Hovens <a class="moz-txt-link-rfc2396E" href="mailto:jeroen@groenebij.nl"><jeroen@groenebij.nl></a>;
                <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
                <b>Onderwerp:</b> Re: [gdal-dev] ogr2ogr explanations
                for error XML parsing of GML file failed?</span></p>
          </div>
        </div>
        <p class="MsoNormal"> </p>
        <p>Hi Jeroen,<span></span></p>
        <p>can you type "set" to list environment variables that are
          defined, both in a terminal from QGIS or the Windows prompt,
          (possibly redirecting to file, like "set > env_vars.txt"),
          and compare the differences</p>
        <p>Even</p>
        <div>
          <p class="MsoNormal">Le 12/01/2026 à 17:06, Jeroen Hovens via
            gdal-dev a écrit :</p>
        </div>
        <blockquote>
          <p class="MsoNormal">Hi,</p>
          <p class="MsoNormal"> </p>
          <p class="MsoNormal"><span lang="EN-GB">I use QGIS on
              Windows10 which comes with GDAL. The latest QGIS LTR
              (3.40.14) uses GDAL 3.12.1</span></p>
          <p class="MsoNormal"><span lang="EN-GB">In QGIS I can open a
              terminal (browser panel, rightclick a folder and select
              Open in Terminal) and immediately use ogr2ogr to convert a
              WFS to a geopackage, because QGIS has altered the path to
              include the GDAL directory</span></p>
          <p class="MsoNormal"><span lang="EN-GB">However, with some WFS
              services ogr2ogr throws an error. I have no trouble using
              those WFS services in QGIS.</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">For instance, this one
              I can’t convert:</span></p>
          <p class="MsoNormal">ogr2ogr -f gpkg test.gpkg WFS:<a
href="https://service.pdok.nl/kadaster/bestuurlijkegebieden/wfs/v1_0?"
              moz-do-not-send="true">"https://service.pdok.nl/kadaster/bestuurlijkegebieden/wfs/v1_0?"</a>
            Provincieg<span lang="EN-GB">ebied -overwrite -nln
              provincie_kadaster</span></p>
          <p class="MsoNormal"><span lang="EN-GB">But this one I can:</span></p>
          <p class="MsoNormal">ogr2ogr -f gpkg test2.gpkg WFS:<a
              href="https://map.data.amsterdam.nl/maps/gebieden"
              moz-do-not-send="true">"https://map.data.amsterdam.nl/maps/gebieden"</a>
            wijk -overwrite -nln amsterdam_wijk</p>
          <p class="MsoNormal"> </p>
          <p class="MsoNormal"><span lang="EN-GB">The first WFS is part
              of a large Dutch open data organization and depending on
              which WFS  I choose from them I see two different errors:</span></p>
          <p class="MsoNormal"><span lang="EN-GB">ERROR 1: XML parsing
              of GML file failed : no element found at line 27, column
              31065   (or different numbers)</span></p>
          <p class="MsoNormal"><span lang="EN-GB">Or</span></p>
          <p class="MsoNormal"><span lang="EN-GB">ERROR 1: XML parsing
              of GML file failed : unclosed token at line 555, column 9</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">I was able to compare
              a debug on with someone who was able to convert the WFS to
              a gpkg and this part was surely different</span></p>
          <p class="MsoNormal"><span lang="EN-GB">VSICURL: Read attempt
              beyond end of file</span></p>
          <p class="MsoNormal"><span lang="EN-GB">VSICURL: Read attempt
              beyond end of file</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">After this, the error
              appeared.</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">To make things more
              complicated:</span></p>
          <p class="MsoNormal"><span lang="EN-GB">When I open a Windows
              Prompt (terminal) and set a path to the GDAL directory in
              QGIS using set PATH=%PATH%;<a moz-do-not-send="true">C:\Program</a>
              Files\QGIS 3.40.14\bin</span></p>
          <p class="MsoNormal"><span lang="EN-GB">I can also use
              ogr2ogr.</span></p>
          <p class="MsoNormal"><span lang="EN-GB">Interestingly, now I
              can convert both WFS datasets to gpkg.</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">What could be
              different with the QGIS Terminal setting from a Windows
              Prompt setting with the path set that would explain the
              errors?</span></p>
          <p class="MsoNormal"><span lang="EN-GB">What might be
              different in both WFS services that triggers these errors?</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-US">Kind regards,</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB">Jeroen Hovens</span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span lang="EN-GB"> </span></p>
          <p class="MsoNormal"><span><br>
              <br>
            </span></p>
          <pre>_______________________________________________</pre>
          <pre>gdal-dev mailing list</pre>
          <pre><a href="mailto:gdal-dev@lists.osgeo.org"
          moz-do-not-send="true" class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a></pre>
          <pre><a
          href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
        </blockquote>
        <pre>-- </pre>
        <pre><a href="http://www.spatialys.com" moz-do-not-send="true"
        class="moz-txt-link-freetext">http://www.spatialys.com</a></pre>
        <pre>My software is free, but my time generally not.</pre>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>