Invalid WFS-T requests may lead to SUCCESS with no data inserted

Description

I'm testing the official geoserver 2.8.2 on Linux, I've enabled WFS-T transactional on all workspaces.
I'm doing some insert tests using topp: roads, state_boundaries and cities as test layers for linestrings, polygons and points.

Using QGIS as a client, this works:

  • insert on cities

This doesn't:

  • insert on roads and state_boundaries

First issue: geoserver returns <wfs:SUCCESS/> (no errors and no warnings in the logs) but data are not inserted in the shapefiles.

By comparing example XML I've tracked down the problem (at least for linestrings) to the simple GML used by QGIS, compared with the multi geometry GML used in the geoserver demo requests (which works):

QGIS (silently fails):

{{<the_geom xmlns="http://www.openplans.org/topp">
<gml:LineString srsName="EPSG:4326">
<gml:coordinates cs="," ts=" ">146.1911....

}}

GeoServer Demo Requests (works):

{{<topp:the_geom>
<gml:MultiLineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:lineStringMember>
<gml:LineString>
<gml:coordinates decimal="." cs="," ts=" ">146.1911....
}}

I believe that geoserver should not return <wfs:SUCCESS/> if data are not saved

Attached transaction (Jira refused to accept this upload, that's why I'm attaching inline):

{{<Transaction xmlns="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xmlns:topp="http://www.openplans.org/topp" service="WFS" xsi:schemaLocation="http://www.openplans.org/topp http://localhost:8080/geoserver/topp/wfs?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=topp:tasmania_roads&amp;SRSNAME=EPSG:4326&amp;username=admin&amp;password=geoserver" xmlns:gml="http://www.opengis.net/gml">
<Insert xmlns="http://www.opengis.net/wfs">
<tasmania_roads xmlns="http://www.openplans.org/topp">
<TYPE xmlns="http://www.openplans.org/topp">halley</TYPE>
<the_geom xmlns="http://www.openplans.org/topp">
<gml:LineString srsName="EPSG:4326">
<gml:coordinates cs="," ts=" ">146.19112816620227591,-41.66950710727635965 146.50087137079171384,-41.78901432794472015 146.86670980140911524,-41.77194186784923602 146.98133917633592205,-41.9963227719612604 146.98133917633592205,-42.24021505903954221 146.77403073231937469,-42.16216952717449118 146.54233305959502331,-41.98412815760734418 146.31063538687064352,-41.94754431454560262 146.09113232850017994,-41.96705569751186715 145.87894603874207178,-41.86218201406820327 145.883823884483661,-41.73535802478749446 145.94479695625321369,-41.62072864986070186 146.13991078591584483,-41.62560649560226977</gml:coordinates>
</gml:LineString>
</the_geom>
</tasmania_roads>
</Insert>
</Transaction>
}}

Response:

{{<wfs:WFS_TransactionResponse version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-transaction.xsd"><wfs:InsertResult><ogc:FeatureId fid="new0"/></wfs:InsertResult><wfs:TransactionResult><wfs:Status><wfs:SUCCESS/></wfs:Status></wfs:TransactionResult></wfs:WFS_TransactionResponse>
}}

Environment

Build Information
Version
2.8.2
Git Revision
f1366aa5e0c9d477b9c6a05fd31d59e0e81985f9
Build Date
23-Jan-2016 02:21
GeoTools Version
14.2 (rev 73d5c95ed430b6c891eb2f0dfebb742ba01780fe)
GeoWebCache Version
1.8.1 (rev f22447f59ca37f72bfe6bc746d834b0e73e7c3fc/f22447f59ca37f72bfe6bc746d834b0e73e7c3fc)

Activity

Andrea Aime 
April 2, 2016 at 9:12 AM

Adding to the report, this happens if the geometry field is not required, and it's not being provided not in accordance to the schema.
A service exception should be returned instead (the data being inserted would not validate against the schema), but for some reason we cannot perform validations against inserts (I don't have the details, just reporting what I remember from a conversation with Justin).

Details

Assignee

Reporter

Affects versions

Components

Priority

Created March 30, 2016 at 11:25 AM
Updated April 2, 2016 at 9:12 AM