<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<p>Hi devs!<br>
</p>
<p>I'm a junior developer and I'm working on a project trying to refresh an old GISWEB, to do so i chose QWC2+QGISServer.</p>
<p>Actual setup is:<br>
<br>
Debian 10, Apache2, QGIS-Server 3.8, using .shp as layers... the QWC2 works fine, WMS works fine, i can print some templates, print png, etc...</p>
<p>The issue is that I'm trying to use the &ATLAS_PK (implemented in <a href="https://github.com/qgis/QGIS/commit/21e3adfbcac4ffa339b28a4fb5fefc3a704bd2fb" target="_blank">
QGIS Server 3.6</a> and I'm getting an annoying "Internal Server Error". When I use "&ATLAS_PK=1" or "&ATLAS_PK=1, 2, 3", log says:</p>
<pre><code>"CRITICAL Server: An error occurred during the Atlas print
WARNING: finish() called twice"
</code></pre>
<p>As I read in the code <a href="https://github.com/qgis/QGIS/blob/master/src/server/services/wms/qgswmsrenderer.cpp" target="_blank">
here</a> it could be caused by 2 things :</p>
<pre><code>"if ( pkIndexes.size() < 1 )
    {
      throw QgsException( QStringLiteral( "An error occurred during the Atlas print" ) );
    }"
</code></pre>
<p>or:</p>
<pre><code>"QString errorString;
    atlas->setFilterExpression( filterString, errorString );
    if ( !errorString.isEmpty() )
    {
      throw QgsException( QStringLiteral( "An error occurred during the Atlas print" ) );
    }"
</code></pre>
<p>I can't determine which one is causing it. (My shapes have FID field, so pkIndexes shouldn't be null)<br>
</p>
<p>If I try to use "&ATLAS_PK=*" it seems to work but I get "timed out" because I have like 4k features to print (I already changed the feature limit in QGIS Server conf). I'm going to try with a layer with less features as soon as I can and post updates.</p>
<p>GetProjectSettings WMS request returns that I have 2 templates both with atlas enabled.</p>
<p>There's not much <a href="https://docs.qgis.org/testing/en/docs/user_manual/working_with_ogc/server/services.html" rel="nofollow" target="_blank">
documentation</a> to read about, as it's a new feature...</p>
<p>The issue has nothing to do with QWC2, it's just the QGIS-Server.</p>
<p>ISSUE URL: <a href="https://github.com/qgis/QGIS/issues/30817" target="_blank">
https://github.com/qgis/QGIS/issues/30817</a></p>
<p>Regards,</p>
<p>Zeus.</p>
</div>
</body>
</html>