5

I have a PostGIS database being served by Geoserver. I can load the layers I want into QGIS no worries; however whenever I try to edit the layer I get this error message:

Could not commit changes to layer X Errors: ERROR: 1 geometries not changed.

Provider errors: empty response

Does QGIS-2.4 actually support wfs-t capabilities at the moment?

EDIT

QGIS

Network request http://*******.com:**/geoserver/****/wfs?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3308 timed out

Geoserver

2014-09-29 09:43:06,297 INFO [geoserver.wfs] - 
Request: getServiceInfo
2014-09-29 09:43:06,330 INFO [geoserver.wfs] - 
Request: getServiceInfo
2014-09-29 09:43:06,330 INFO [geoserver.wfs] - 
Request: describeFeatureType
    service = WFS
    version = 1.0.0
    baseUrl = http://***.com:**/geoserver/
    typeName[0] = {*****}*****
    outputFormat = XMLSCHEMA

POST Request

<Transaction xmlns="http://www.opengis.net/wfs"     
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0"   
xmlns:NCTPROP="NCTPROP" service="WFS" xsi:schemaLocation="NCTPROP  
http://****.com:****/geoserver/****/wfs?   
SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=*****
v&amp;SRSNAME=EPSG:3308&amp;username=****&amp;password=****" 
xmlns:gml="http://www.opengis.net/gml"><Insert xmlns="http://www.opengis.net/wfs">
<nct_cov xmlns="****"><prop_name xmlns="****">test</*****><status 
xmlns="****">lol</*****><geom xmlns="****"><gml:MultiPolygon 
srsName="EPSG:3308"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs>
<gml:LinearRing><gml:coordinates cs="," ts=" ">COORDS HERE</gml:coordinates>
</gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember>
</gml:MultiPolygon></geom></*****></Insert></Transaction>
4
  • Yes it does. If you want to know what goes wrong you must gather more information by capturing the actual WFS-T request either from QGIS side or from the GeoServer logs. For capturing the request that QGIS sends you can use some logging proxy between QGIS and outer world.
    – user30184
    Sep 29, 2014 at 8:26
  • The QGIS request is not a complete WFS request but perhaps all parameters are just not logged. How did you catch it?
    – user30184
    Sep 29, 2014 at 10:20
  • Sorry I can't comment so have to reply here. I got the log from the QGIS network log messages
    – lolcat
    Sep 29, 2014 at 10:28
  • Obviously it does not log the http POST request body and all the interesting information is in there. You need some better logger.
    – user30184
    Sep 29, 2014 at 12:40

4 Answers 4

6

This looks like a bug in GeoServer.

GeoServer needs to identify when a schemaLocation references the GeoServer's own WFS service and does this by looking at the hostname of the URL and comparing it to a list of known hostnames it generates at start up by looking at the network interfaces.

If it fails to recognize itself it will make an HTTP request to retrieve the schema which will lead to a deadlock between the threads handling the two requests. This deadlock will also block all attempts to resolve schemas including all requests that include any schemaLocation attribute at all.

Windows is particularly susceptible because it doesn't recognize localhost or hostname.local but will resolve them to itself. This can affect other OSes though as a result of proxies, address translation, or DNS aliases not reachable by a reverse lookup or which are added after GeoServer starts up.

Adding the missing hostnames to the hosts file may help.

1
3

I have the latest Geoserver 2.7.2 and latest Qgis at the time of my writing 2.10.1-Pisa

After lot of trial and error and googling

this worked for me

in geoserver admin global settings

add a proxy base url to be base url of your geoserver i used

http://hostname:8080/geoserver

save the details

suddenly no more errors from QGIS all working

2

I've stumbled upon a very similar situation, so I'll add the information I have here with the hopes of contributing to a solution.

My setup:

  • On a Debian linux server:
    • PostGIS 2.0/PostgreSQL 8.4
    • GeoServer 2.4.0
  • On Windows 7 x64:
    • QGIS 2.6.0-Brighton

For testing purposes I'm trying to edit (tried both insert and delete) the demo layer tiger:poi in GeoServer, using QGIS. Below, step by step, are logs I've gathered:

17:53:30,192: POST request (from Fiddler):

to http://my.server/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:4326

<Transaction xmlns="http://www.opengis.net/wfs"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="1.0.0"
    service="WFS"
    xsi:schemaLocation="http://www.census.gov
      http://my.server/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=tiger:poi&amp;SRSNAME=EPSG:4326"
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:tiger="http://www.census.gov">
  <Delete xmlns="http://www.opengis.net/wfs" typeName="tiger:poi">
    <Filter xmlns="http://www.opengis.net/ogc">
      <FeatureId xmlns="http://www.opengis.net/ogc" fid="poi.8"/>
    </Filter>
  </Delete>
</Transaction>

17:53:30,364: GeoServer receives the request:

2014-11-13 17:53:30,364 INFO [geoserver.wfs] - 
Request: getServiceInfo
2014-11-13 17:53:35,396 INFO [geoserver.wfs] - 
Request: getServiceInfo
2014-11-13 17:53:35,398 INFO [geoserver.wfs] - 
Request: describeFeatureType
    service = WFS
    version = 1.0.0
    baseUrl = http://localhost:8080/geoserver/
    typeName[0] = {http://www.census.gov}poi
    outputFormat = XMLSCHEMA

17:54:30: QGIS reports the commit error after 1 minute (timed-out): QGIS Commit Error

17:58:35,475: Exactly 5 minutes after the request, with no further action on my part, GeoServer logs the following:

2014-11-13 17:58:35,475 WARN [geotools.xml] - Error parsing:
    http://my.server/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=tiger:poi&SRSNAME=EPSG:4326
2014-11-13 17:58:35,481 WARN [geotools.xml] - Could not find a schema
2014-11-13 17:58:35,559 INFO [geoserver.gwc] - DataStoreChange: {http://www.census.gov}poi PostDelete
2014-11-13 17:58:35,693 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 17:58:35,697 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 17:58:35,701 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 17:58:35,705 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 17:58:35,738 INFO [geoserver.wfs] - 
    Request: transaction
        service = WFS
        version = 1.0.0
        baseUrl = http://localhost:8080/geoserver/
        group[0] = wfs:delete=net.opengis.wfs.impl.DeleteElementTypeImpl@44c2fcca (filter: [ poi.8 ], handle: null, typeName: {http://www.census.gov}poi)
        delete[0]:
            filter = [ poi.8 ]
            typeName = {http://www.census.gov}poi
        releaseAction = ALL

After this, the feature was not deleted of course but, interestingly, a subsequent insert operation gave a similar log response, except the feature was then added.

18:47:26,251: 5 minutes after an insert operation, GeoServer logged this and added the feature:

2014-11-13 18:47:26,251 WARN [geotools.xml] - Error parsing:
    http://my.server/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=tiger:poi&SRSNAME=EPSG:4326
2014-11-13 18:47:26,252 WARN [geotools.xml] - Could not find a schema
2014-11-13 18:47:26,273 INFO [geoserver.gwc] - DataStoreChange: {http://www.census.gov}poi PreInsert
2014-11-13 18:47:26,290 INFO [geoserver.gwc] - DataStoreChange: {http://www.census.gov}poi PostInsert
2014-11-13 18:47:26,312 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 18:47:26,313 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 18:47:26,314 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 18:47:26,317 INFO [seed.GWCTask] - Thread group finished TRUNCATE task after 0.0 seconds
2014-11-13 18:47:26,329 INFO [geoserver.wfs] - 
    Request: transaction
        service = WFS
        version = 1.0.0
        baseUrl = http://localhost:8080/geoserver/
        group[0] = wfs:insert=net.opengis.wfs.impl.InsertElementTypeImpl@6f929696 (feature: [SimpleFeatureImpl:poi=[SimpleFeatureImpl.Attribute: the_geom<the_geom id=fid--492f5793_149aa05031b_-7ffe>=POINT (-74.01345063373635 40.71583592083637), SimpleFeatureImpl.Attribute: NAME<NAME id=fid--492f5793_149aa05031b_-7ffe>=Test2, SimpleFeatureImpl.Attribute: THUMBNAIL<THUMBNAIL id=fid--492f5793_149aa05031b_-7ffe>=null, SimpleFeatureImpl.Attribute: MAINPAGE<MAINPAGE id=fid--492f5793_149aa05031b_-7ffe>=null]], handle: null, idgen: <unset>, inputFormat: <unset>, srsName: null)
        insert[0]:
            feature[0] = SimpleFeatureImpl:poi=[SimpleFeatureImpl.Attribute: the_geom<the_geom id=fid--492f5793_149aa05031b_-7ffe>=POINT (-74.01345063373635 40.71583592083637), SimpleFeatureImpl.Attribute: NAME<NAME id=fid--492f5793_149aa05031b_-7ffe>=Test2, SimpleFeatureImpl.Attribute: THUMBNAIL<THUMBNAIL id=fid--492f5793_149aa05031b_-7ffe>=null, SimpleFeatureImpl.Attribute: MAINPAGE<MAINPAGE id=fid--492f5793_149aa05031b_-7ffe>=null]
            idgen = GenerateNew
            inputFormat = text/xml; subtype=gml/3.1.1
        releaseAction = ALL

Playing around with QGIS's POST contents, I noticed that removing the schemaLocation turned the request successful. A successful request from uDig also did not use schemaLocation.

That is, I removed this:

xsi:schemaLocation="http://www.census.gov http://my.server/geoserver/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=tiger:poi&amp;SRSNAME=EPSG:4326"
2
  • 1
    I'm having the same problem. Doing some test, I also noticed that if you provide no schema it works. But also if you provide an url wrong or inaccessible to the geoserver box it also works. Even if in the Geoserver log you get an error message for the schema.
    – jeb
    Nov 20, 2014 at 18:40
  • 1
    Same prolem here, how could i remove xsi:schemaLocation from the POST to make it work? Or how could I provide a wrong url to make it work too? Geoserver on Windows Server 2012 + QGIS 2.6.1 on Windows7
    – Egidi
    Dec 26, 2014 at 10:24
0

I had the same problem, suffered with it quite a lot.

For me this was the problem: the GeoServer was running under Windows. With Lubuntu (OSGeoLive VirtualBox) there was no errors with WFS editing.

So: GeoServer: Linux, QGIS: Windows && Linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.