Re: [Qgis-user] QGIS Server sending UPDATE... WHERE NULL to postgis in a WFS layer
UPDATE 03/03/2016 I updated to QGIS Server and QGIS Desktop to 2.12.3 both and the problem continues. After many days of tests I finally found when the issue occurs. I happens when I save edits of the layer in QGIS (via WFS-T) and at the same time a [Lizmap Map][1] is being loaded by another user. Lizmap also uses qgis-server. Looks like when loading a map, Lizmap makes the server busy and when a WFS-T update request is recived, QGIS Server is not capable of building the UPDATE SQL query correctly.Example: If there is a Lizmap loading at the time the WFS-T post is received, the PostgreSQL query generated in qgis-server is: 2016-03-03 11:47:30 CET LOG: 0: sentencia: UPDATE "public"."getxo_alumbrado_tendido_canalizacion" SET "diametro"='22' WHERE NULL On the other hand, if qgis-server is not serving data to a loading Lizmap when the WFS-T arrives, the PostgreSQL query generated is: 2016-03-03 11:46:21 CET LOG: 0: sentencia: UPDATE "public"."getxo_alumbrado_tendido_canalizacion" SET "diametro"='111' WHERE "id"::text='1' Note the diference in the where clause. The first one it does nothing. The second one works ok. I don't know if I can tune Apache or any config files for qgis-server to fix this issue. I tried giving much more hardware to the server (4 cores and 16 GB RAM) with no chnage. I am making all the software updates using OSGEO4W. Ia read somewhere that Apache and PHP packages have not been updated for years. I'll try to update them manually and check that the apache or php version is not the cause of the problem. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Server-sending-UPDATE-WHERE-NULL-to-postgis-in-a-WFS-layer-tp5248880p5254124.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] QGIS Server sending UPDATE... WHERE NULL to postgis in a WFS layer
Hi, I am running a Windows Server 2012 server. PostgreSQL 9.3.5, 64-bit POSTGIS 2.1.3 QGIS Server 2.6.1-2 QGIS Desktop 2.8.3 and 2.12 I am using a Microsoft Surface Pro 4 tablet using QGIS Desktop 2.12 to edit some layers stored in the Postgresql database. The layers in the tablet are WFS layers served by QGIS Server. When I toogle editing after inserting some data in the layer to force the data to be sent and stored in the server sometimes the update is not being done in the Database. I can see that the POST http request arrives to the server ok, but sometimes I can't see a commit (update) in the database and some other times it works ok and does the commit. In QGIS Server's logs I can see (I updated 3 features' data in QGIS Desktop): //QGIS SERVER RECEIVED HTTP POST FROM QGIS DESKTOP [4852][11:11:19] new request*** [4852][11:11:19] remote ip: 192.168.144.20 [4852][11:11:19] CONTENT_TYPE: text/xml [4852][11:11:19] HTTP_USER_AGENT: Mozilla/5.0 QGIS/2.8.2-Wien [4852][11:11:19] MAP:D:\OSGeo4W\apps\qgis\bin\alumbrado\alumbrado.qgs [4852][11:11:19] REQUEST:Transaction [4852][11:11:19] REQUEST_BODY:http://www.opengis.net/wfs"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0.0" service="WFS" xsi:schemaLocation="http://www.qgis.org/gml http://eudala2.getxo.net/qgis/qgis_mapserv.fcgi.exe?map=D:\OSGeo4W\apps\qgis\bin\alumbrado\alumbrado.qgs&SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=getxo_alumbrado_arquetas_registros_cajas&SRSNAME=EPSG:23030"; xmlns:gml="http://www.opengis.net/gml";>http://www.opengis.net/wfs"; typeName="getxo_alumbrado_arquetas_registros_cajas">http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>id_modelohttp://www.opengis.net/wfs";>0http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>alumbradohttp://www.opengis.net/wfs";>thttp://www.opengis.net/ogc";>http://www.opengis.net/ogc"; fid="getxo_alumbrado_arquetas_registros_cajas.3"/>http://www.opengis.net/wfs"; typeName="getxo_alumbrado_arquetas_registros_cajas">http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>id_modelohttp://www.opengis.net/wfs";>0http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>alumbradohttp://www.opengis.net/wfs";>thttp://www.opengis.net/ogc";>http://www.opengis.net/ogc"; fid="getxo_alumbrado_arquetas_registros_cajas.4"/>http://www.opengis.net/wfs"; typeName="getxo_alumbrado_arquetas_registros_cajas">http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>tipohttp://www.opengis.net/wfs";>Ahttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>tipo_tapahttp://www.opengis.net/wfs";>Bhttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>estadohttp://www.opengis.net/wfs";>Dhttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>p_tierra_tipo_electrodo_tierrahttp://www.opengis.net/wfs";>Ohttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>p_tierra_tipo_union_electrodo_tierrahttp://www.opengis.net/wfs";>Nhttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>p_tierra_estado_union_tierrahttp://www.opengis.net/wfs";>Dhttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>tipo_intervencionhttp://www.opengis.net/wfs";>OTRhttp://www.opengis.net/wfs";>http://www.opengis.net/wfs";>m_codcallehttp://www.opengis.net/wfs";>20http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>id_modelohttp://www.opengis.net/wfs";>0http://www.opengis.net/wfs";>http://www.opengis.net/wfs";>alumbradohttp://www.opengis.net/wfs";>thttp://www.opengis.net/ogc";>http://www.opengis.net/ogc"; fid="getxo_alumbrado_arquetas_registros_cajas.5"/> [4852][11:11:19] SERVICE:WFS [4852][11:11:19] SRSNAME:EPSG:23030 [4852][11:11:19] VERSION:1.0.0 [4852][11:11:22] Request finished in 2977 ms Ok, when I look into PostgreSQL logs I can see that the update has a WHERE NULL clause, which updates nothing.. //POSTGRESQL UPDATE QUERIES 2016-01-29 11:11:22 CET LOG: 0: sentencia: UPDATE "public"."getxo_alumbrado_arquetas_registros_cajas" SET "id_modelo"=0,"alumbrado"='t' WHERE NULL 2016-01-29 11:11:22 CET UBICACIÓN: exec_simple_query, src\backend\tcop\postgres.c:890 2016-01-29 11:11:22 CET LOG: 0: sentencia: UPDATE "public"."getxo_alumbrado_arquetas_registros_cajas" SET "id_modelo"=0,"alumbrado"='t' WHERE NULL 2016-01-29 11:11:22 CET UBICACIÓN: exec_simple_query, src\backend\tcop\postgres.c:890 2016-01-29 11:11:22 CET LOG: 0: sentencia: UPDATE "public"."getxo_alumbrado_arquetas_registros_cajas" SET "tipo"='A',"tipo_tapa"='B',"estado"='D',"p_tierra_tipo_electrodo_tierra"='O',"p_tierra_tipo_union_electrodo_tierra"='N',"p_tierra_estado_union_tierra"='D',"tipo_intervencion"='OTR',"m_codcalle"='20',"id_modelo"=0,"alumbrado"='t' WHERE NULL I can see in the POST data that QGIS Server knows which feature needs to be updated using de internal "fid" number. My layer, on the other hand, has "id" field as primary key. Somewhere when it does the mapping from QGIS internal fid to my layer's id it's getting lost and adds WHE
Re: [Qgis-user] QGIS Server sometimes not sending commits to postgis
Thank for your answer Nathan. The problem is that ogr2ogr inserts all the data to Postgis from the origin (SHP or Spatialite). I need a way to send only the changes made, not the whole table. This way, several people could work in field with different tablets or there could be other people in the office changing other elements in that postgis layer while the others are in field with the tablet... I have also been testing the "Offline Editing Plugin" unsuccessfully. These are the issues I have experienced: It does not work with WFS layers. When I try to convert the layer to offline QGIS crashes. It does not work with MULTIGEOMETRIES I get some warnings saying that it does not understand QDate fields (normal date fields in postgis). Due to this, I have discarded to use this plugin. I can't find anywhere any other architecture that would fit my needs (save only changes), that's why I am focused on finding a solution to my WFS and QGIS Server architecture problems... Any other suggestion will be very very appreciated. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Server-sometimes-not-sending-commits-to-postgis-tp5247297p5247545.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] QGIS Server sometimes not sending commits to postgis
Hi, I am running a Windows Server 2012 server. PostgreSQL 9.3.5, 64-bit POSTGIS 2.1.3 QGIS Server 2.6.1-2 QGIS Desktop 2.8.3 I am using a Microsoft Surface Pro 4 tablet using QGIS Desktop 2.12 to edit some layers stored in the Postgresql database. The layers in the tablet are WFS layers served by QGIS Server. When I toogle editing after inserting some data in the layer to force the data to be sent and stored in the server sometimes the commit is not being done from QGIS Server to the Database. I can see that the POST http request arrives to the server ok, but sometimes I can't see a commit (update) in the database and some other times it works ok and does the commit. I ensure every time that internet connection is fine. When loading the QGIS project with 50 WFS layers in the tablet (client), sometimes two or three layers are not read and I need to click in apply several times until they are read properly and the project finishes loading.. I don't know if this problem is related to the one I mentioned before. The problem that worries me is the first one, because there is people working in field inserting data the whole day, and when they arrive to their office they connect teh tablet to wifi (or even ethernet cable) to ensure internet is fine and they toogle edition to save changes. As mentioned before, sometimes data is not stored in postgis but no error is propagated to QGIS Client, so the user thinks that the data has been stores correctly. The funny thing is that they have been working for 40 days and hey only got this problem once, but since last week they have had this problem every day... I've been trying to activate QGIS Server logs to see what error it is giving adding these two lines to D:\OSGeo4W\httpd.d\httpd_qgis.conf SetEnv QGIS_SERVER_LOG_FILE /var/tmp/qgislog.txt SetEnv QGIS_SERVER_LOG_LEVEL 0 But no log file is being generated. I've been with this issue 3 days and no progress.. Any help will be appreciated... Regards, -- View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Server-sometimes-not-sending-commits-to-postgis-tp5247297.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user