<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Amedeo,</p>
<p>Is the www-data user able to read the pg service file? If you
didn't change the permissions, /home/ubuntu/.pg_service.conf is
only readable by ubuntu user.</p>
<p>Can you check the qgis server logs to see what is going on?</p>
<p>Best regards,</p>
<p>Jorge<br>
</p>
<div class="moz-cite-prefix">Às 21:05 de 07/07/25, Amedeo Fadini via
QGIS-User escreveu:<br>
</div>
<blockquote type="cite"
cite="mid:CAKGZ3GeObRnZmTTNoBwpaEDHtr-ZnKUk=ksykEbOtEZK9ykO2g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Errata corrige, the demo project works, the sqlite
file was with wrong permission.<br>
Still doesn't load postgis layer<br>
<div><br>
</div>
<div>Amedeo</div>
</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">Il giorno lun 7 lug 2025 alle
ore 21:54 Amedeo Fadini <<a href="mailto:amefad@gmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">amefad@gmail.com</a>>
ha scritto:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Hi everybody,
<div><br>
</div>
<div>I'm upgrading a project based on QGIS server and moved
all stuff to new server with Ubuntu 24, QGIS 3.40 LTR
postgresql 16. </div>
<div>Webserver is nginx, QGIS server is configured on
spawn-fcgi with single socket follwing the qgis manual <br>
<a
href="https://docs.qgis.org/3.40/en/docs/server_manual/getting_started.html#spawn-fcgi"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://docs.qgis.org/3.40/en/docs/server_manual/getting_started.html#spawn-fcgi</a></div>
<div>The project use two layers from postgis, the connection
is configured with pg service</div>
<div><br>
</div>
<div>Connecting on ssh with x.forwarding the project loads
without any error and works fine</div>
<div><br>
</div>
<div>Calling the qgis server getcapabilities or get
projectsettings it raise the error </div>
<div><span style="font-family:monospace;font-size:13px"><ServerException></span><span
style="color:rgb(0,0,0);font-family:monospace;font-size:13px">Layer(s)
not valid</span><span
style="font-family:monospace;font-size:13px"></ServerException></span></div>
<div>Setting QGIS_SERVER_IGNORE_BAD_LAYERS=true
getcapabilities works but postgis layer are not published
or not showed in Getmap request.</div>
<div><br>
</div>
<div>Any clue? Where can I find more detailed erro log?</div>
<div><br>
</div>
<div>even the demo project world.qgs gives balnk image in
getmap request. Am I misisng a local Xserver or gui
configuration?</div>
<div><br>
</div>
<div>Below is my nginx conf and
systemd/system/qgis-server.service</div>
<div><br>
</div>
<div>Thank you </div>
<div><br>
</div>
<div>Amedeo Fadini</div>
<div><br>
</div>
<div>---</div>
<div>server {<br>
listen 80;<br>
server_name <my server name>;<br>
<br>
location /qgis/ {<br>
include fastcgi_params;<br>
fastcgi_param SCRIPT_FILENAME
/usr/lib/cgi-bin/qgis_mapserv.fcgi;<br>
#fastcgi_param QGIS_DEBUG 1;<br>
fastcgi_param QGIS_SERVER_LOG_STDERR 1;<br>
#fastcgi_param QGIS_SERVER_LOG_LEVEL 0;<br>
fastcgi_param QGIS_SERVER_LOG_LEVEL 2;<br>
#fastcgi_param PGSERVICEFILE
/home/ubuntu/.pg_service.conf;<br>
#fastcgi_param QGIS_PROJECT_FILE
/home/ubuntu/fiduciali_qgis/fiduciali.qgs;<br>
fastcgi_pass <a class="moz-txt-link-freetext" href="unix:/var/run/qgisserver.socket">unix:/var/run/qgisserver.socket</a>;<br>
}<br>
}<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>---</div>
<div><br>
</div>
<div>[Unit]<br>
Description=QGIS server<br>
After=network.target<br>
<br>
[Service]<br>
;; set env var as needed<br>
;Environment="LANG=en_EN.UTF-8"<br>
;Environment="QGIS_SERVER_PARALLEL_RENDERING=1"<br>
;Environment="QGIS_SERVER_MAX_THREADS=12"<br>
Environment="QGIS_SERVER_LOG_LEVEL=0"<br>
Environment="QGIS_SERVER_LOG_STDERR=1"<br>
Environment="PGSERVICEFILE=/home/ubuntu/.pg_service.conf"<br>
;Environment="QGIS_PROJECT_FILE=/var/www/qgis_projects/world.qgs"<br>
Environment="QGIS_PROJECT_FILE=/var/www/qgis_projects/fiduciali.qgs"<br>
Environment="QGIS_SERVER_IGNORE_BAD_LAYERS=true"<br>
;; or use a file:<br>
;EnvironmentFile=/etc/qgis-server-env<br>
<br>
ExecStart=spawn-fcgi -s /var/run/qgisserver.socket -U
www-data -G www-data -n /usr/lib/cgi-bin><br>
<br>
[Install]<br>
WantedBy=multi-user.target<br>
</div>
</div>
</blockquote>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre wrap="" class="moz-quote-pre">_______________________________________________
QGIS-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="moz-signature"> <span class="im"> <b> <font
size="+2">Geomaster, LDA</font> </b> </span><br>
<div class="moz-signature"> <b> <font color="#999999"
size="-2">VENHA DESCOBRIR O CAMINHO DO OPEN SOURCE CONNOSC</font>
</b>
<table width="450" border="0" height="126" cellspacing="1"
cellpadding="2">
<tbody>
<tr>
<td width="150" height="50" valign="top"> <font
size="-1"><span class="im"> <font size="-2"> </font><br>
Rua Afonso Palmeira, 31, 7 D<br>
4715-278 Braga<br>
VAT/NIF </span><span class="im"> 510 906 109<br>
Phone</span><span class="im"> +351 253 257 173<br>
</span>Site <a href="http://geomaster.pt"
rel="noreferrer" target="_blank">geomaster.pt</a><br>
GPS 41.54627, -8.40432 </font><br>
<span class="im"><img
src="cid:part1.zp5CkS64.TFmKh7aS@geomaster.pt"
alt="Logo" width="50" height="50" align="left"></span>
</td>
<td width="25" valign="top" align="right"> <font
size="-1"><span class="im"></span></font>
<hr width="2" size="100" align="right"> </td>
<td width="150" height="50" valign="top" nowrap="nowrap">
<font size="-1"> <font size="-1"> <font size="-2"> </font><br>
Jorge Gustavo Rocha </font><br>
<font color="#999999" size="-2">CTO<br>
<br>
</font>Mobile </font> <font size="-1"><span
class="im"> +351 910 333 888<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:jgr@geomaster.pt">jgr@geomaster.pt</a></span></font> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>