<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi,<br>
    <br>
    Here is the QGIS code<br>
    <br>
    ```c<br>
    // Creating a SpatiaLite database can be quite slow on some file
    systems<br>
      // so we create a GDAL in-memory file, and then copy it on<br>
      // the file system.<br>
      GDALDriverH hDrv = GDALGetDriverByName( "SQLite" );<br>
      if ( !hDrv )<br>
      {<br>
        logMessageWithReason( QStringLiteral( "GDAL SQLite driver not
    available" ) );<br>
        return false;<br>
      }<br>
      const QString vsimemFilename = QStringLiteral(
    "/vsimem/qgis_cache_template_%1/features.sqlite" ).arg(
    reinterpret_cast< quintptr >( this ), QT_POINTER_SIZE * 2, 16,
    QLatin1Char( '0' ) );<br>
      mCacheTablename = CPLGetBasename(
    vsimemFilename.toStdString().c_str() );<br>
      VSIUnlink( vsimemFilename.toStdString().c_str() );<br>
      const char *apszOptions[] = { "INIT_WITH_EPSG=NO",
    "SPATIALITE=YES", nullptr };<br>
      GDALDatasetH hDS = GDALCreate( hDrv,
    vsimemFilename.toUtf8().constData(), 0, 0, 0, GDT_Unknown,
    const_cast<char **>( apszOptions ) );<br>
      if ( !hDS )<br>
      {<br>
        logMessageWithReason( QStringLiteral( "GDALCreate() failed: %1"
    ).arg( CPLGetLastErrorMsg() ) );<br>
        return false;<br>
      }<br>
      GDALClose( hDS );<br>
    <br>
      // Copy the temporary database back to disk<br>
      vsi_l_offset nLength = 0;<br>
      GByte *pabyData = VSIGetMemFileBuffer(
    vsimemFilename.toStdString().c_str(), &nLength, TRUE );<br>
      Q_ASSERT( !QFile::exists( mCacheDbname ) );<br>
      VSILFILE *fp = VSIFOpenL( mCacheDbname.toStdString().c_str(), "wb"
    );<br>
      if ( fp )<br>
      {<br>
        VSIFWriteL( pabyData, 1, nLength, fp );<br>
        VSIFCloseL( fp );<br>
        CPLFree( pabyData );<br>
      }<br>
      else<br>
      {<br>
        CPLFree( pabyData );<br>
        logMessageWithReason( QStringLiteral( "Cannot copy file to %1:
    %2" ).arg( mCacheDbname ).arg( CPLGetLastErrorMsg() ) );<br>
        return false;<br>
      }<br>
    ```<br>
    <br>
    So the database to store WFS Features has been created in memory
    with GDAL/OGR and the path
    "/vsimem/qgis_cache_template_%1/features.sqlite" and will be write
    to disk in QGIS cache directory.<br>
    <br>
    The mCacheDbname is defined like that:<br>
    ```c<br>
      Q_ASSERT( mCacheDbname.isEmpty() );<br>
    <br>
      static QAtomicInt sTmpCounter = 0;<br>
      int tmpCounter = ++sTmpCounter;<br>
      QString cacheDirectory( acquireCacheDirectory() );<br>
      mCacheDbname = QDir( cacheDirectory ).filePath( QStringLiteral(
    "cache_%1.sqlite" ).arg( tmpCounter ) );<br>
      Q_ASSERT( !QFile::exists( mCacheDbname ) );<br>
    ```<br>
    <br>
    In the log provided by Günter, we don't have enough reason. The
    CPLGetLastErrorMsg is empty.<br>
    <br>
    Günter, can you provide more logs arround the message "Cannot create
    temporary SpatiaLite cache.: Cannot copy file to" ?<br>
    <br>
    Regards,<br>
    René-Luc DHONT<br>
    <br>
    <div class="moz-cite-prefix">Le 30/05/2022 à 08:57, FANGAIN Marjorie
      a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:PR2P264MB025455CDAD0B02A0BB7F5904E1DD9@PR2P264MB0254.FRAP264.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@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;}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:#0563C1;
        text-decoration:underline;}span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’ve
            got also some problems with WFS layers for several months.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’ve
            created a ticket on github :<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><a
href="https://github.com/3liz/lizmap-web-client/issues/2792"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/3liz/lizmap-web-client/issues/2792</a><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#786E64">Marjorie
              <b>FANGAIN</b><o:p></o:p></span></p>
        </div>
        <p class="MsoNormal"><span style="mso-fareast-language: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>De :</b> Lizmap
              <a class="moz-txt-link-rfc2396E" href="mailto:lizmap-bounces@lists.osgeo.org"><lizmap-bounces@lists.osgeo.org></a> <b>De la part de</b>
              Peter Berger<br>
              <b>Envoyé :</b> vendredi 27 mai 2022 11:26<br>
              <b>À :</b> G. Wagner, Wagner-IT <a class="moz-txt-link-rfc2396E" href="mailto:info@wagner-it.de"><info@wagner-it.de></a>;
              <a class="moz-txt-link-abbreviated" href="mailto:lizmap@lists.osgeo.org">lizmap@lists.osgeo.org</a><br>
              <b>Objet :</b> Re: [Lizmap] Publish WFS services in QGIS
              with Lizmap<o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <table class="MsoNormalTable"
            style="width:100.0%;background:#D7D4D0" width="100%"
            cellspacing="3" cellpadding="0" border="0" align="left">
            <tbody>
              <tr>
                <td style="padding:.75pt .75pt .75pt .75pt">
                  <p class="MsoNormal"
style="text-align:center;mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly"
                    align="center">
                    <span
style="font-size:13.5pt;font-family:"Arial",sans-serif;color:#786E64">EXTERNAL
                      EMAIL<br>
                    </span><span
style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#786E64">Original
                      Sender:
                      <a
                        href="mailto:SRS0=UtB1=WD=lists.osgeo.org=lizmap-bounces@osgeo.org"
                        moz-do-not-send="true"
                        class="moz-txt-link-freetext">SRS0=UtB1=WD=lists.osgeo.org=lizmap-bounces@osgeo.org</a></span><o:p></o:p></p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
        <p class="MsoNormal">I made the same observation. On Windows 10
          all WFS layers are well displayed in Lizmap but not on a
          osgeolive linux installation with the same QGIS file.<o:p></o:p></p>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <div>
          <p class="MsoNormal">Peter<o:p></o:p></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <p class="MsoNormal">Von meinem iPhone gesendet<o:p></o:p></p>
          </div>
          <div>
            <p class="MsoNormal"><br>
              <br>
              <o:p></o:p></p>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <p class="MsoNormal" style="margin-bottom:12.0pt">Am
                27.05.2022 um 07:34 schrieb G. Wagner, Wagner-IT <<a
                  href="mailto:info@wagner-it.de" moz-do-not-send="true"
                  class="moz-txt-link-freetext">info@wagner-it.de</a>>:<o:p></o:p></p>
            </blockquote>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <div>
              <p class="MsoNormal"><o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US">Hi everyone,</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US">I am trying to
                  publish a WFS service integrated in QGIS with QGIS
                  Server/Lizmap (</span>QGIS-Server 3.22.7, Lizmap
                3.5.3)<span style="mso-fareast-language:EN-US">.</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US">The corresponding
                  layer name is displayed in the Lizmap client but no
                  data is displayed. Or sometimes and only once in a
                  zoom level.</span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span
                  style="mso-fareast-language:EN-US">The error message
                  in the QGIS error log could fit to this (cache
                  problem?):</span><o:p></o:p></p>
              <p class="MsoNormal">WARNING WFS[1497]: Cannot create
                temporary SpatiaLite cache.: Cannot copy file to
/home/qgis/.local/share/QGIS/QGIS3/profiles/default/cache/wfsprovider/pid_1497/cache_1.sqlite:<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">Creating the directories
                "/home/qgis/.local/share/QGIS/QGIS3/profiles/default/cache/wfsprovider"
                with appropriate permissions does not change anything.<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">In the Apache error.log there is
                still the message:<o:p></o:p></p>
              <p class="MsoNormal">QNetworkDiskCache::prepare() unable
                to open temporary file<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">In the Apache.conf is defined:<o:p></o:p></p>
              <p class="MsoNormal">        FcgidInitialEnv
                QGIS_SERVER_CACHE_DIRECTORY "/home/qgis/cache"<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">What am I doing wrong?<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">Greeting<o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal">Günter<o:p></o:p></p>
            </div>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Lizmap mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lizmap@lists.osgeo.org">Lizmap@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/lizmap">https://lists.osgeo.org/mailman/listinfo/lizmap</a>
</pre>
    </blockquote>
    <br>
    <div id="grammalecte_menu_main_button_shadow_host" style="width:
      0px; height: 0px;"></div>
  </body>
</html>