<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Sans Unicode";
        panose-1:2 11 6 2 3 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I have already reduced it to version 1.0 to prevent paging as I think that is a red herring in terms of the crashing here. As far as I can tell the version 1.0 requests all work fine but the older
 version of QGIS returns an invalid layer and version 3.16 crashes. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’ve found a *.wer error file associated with the 3.16 crash and it lists the following:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[0].Name=Application Name<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[0].Value=qgis-bin.exe<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[1].Name=Application Version<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[1].Value=0.0.0.0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[2].Name=Application Timestamp<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[2].Value=5f9304c8<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[3].Name=Fault Module Name<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[3].Value=KERNELBASE.dll<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[4].Name=Fault Module Version<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[4].Value=10.0.18362.1139<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[5].Name=Fault Module Timestamp<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[5].Value=a8b891f5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[6].Name=Exception Code<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[6].Value=c0000005<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[7].Name=Exception Offset<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Sig[7].Value=0000000000043b29<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Unfortunately I’m pretty sure that error roughly translates to:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">FriendlyEventName=Stopped working<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">ConsentKey=APPCRASH<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">So I don’t think my Windows knows what went wrong. Is there another log I can look for that might give something more useful?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Paul<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Ian Turton <ijturton@gmail.com>
<br>
<b>Sent:</b> 27 November 2020 15:35<br>
<b>To:</b> Paul Wittle <P.Wittle@dorsetcc.gov.uk><br>
<b>Cc:</b> rdmailings@duif.net; qgis-developer@lists.osgeo.org<br>
<b>Subject:</b> Re: [QGIS-Developer] Loading WFS layers from GeoServer<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">If you are using WFS 2.0 and limits/paging (which I think QGis does behind the scenes) then GeoServer is going to want a specific primary key for the view - since most Databases won't let you add a primary key to a view we fake it with
 a <i><span style="font-family:"Lucida Sans Unicode",sans-serif;color:#262523">primary key metadata table </span></i>(see
<a href="https://docs.geoserver.org/stable/en/user/data/database/primarykey.html">
https://docs.geoserver.org/stable/en/user/data/database/primarykey.html</a>). The examples on that page are for PostGIS and Oracle so if you are using a different table you may need to adapt the DDO scripts (and please do add back to that page if you work out
 a new one). <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Alternatively, try adding version=1.1.0 to the end of your capabilities request string that you add into QGis which I think will stop the two programs agreeing to use the highest version available.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Ian<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, 27 Nov 2020 at 15:20, Paul Wittle <<a href="mailto:paul.wittle@dorsetcouncil.gov.uk">paul.wittle@dorsetcouncil.gov.uk</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hi,<br>
<br>
It is also interesting that when I run the query again using WFS version 1.0 and network logging all four requests succeed but the layer is still invalid.<br>
<br>
The getFeature returns a single feature with the following geometry:<br>
<gml:Polygon srsName="<a href="http://www.opengis.net/gml/srs/epsg.xml#27700" target="_blank">http://www.opengis.net/gml/srs/epsg.xml#27700</a>" srsDimension="2"><br>
<gml:exterior><br>
<gml:LinearRing><br>
<gml:posList>389814.604 97465.168 389823.18 97454.59 389858.98 97463.67 389855.18 97472.01 389849.77 97481.28 389845.792 97486.125 389814.604 97465.168</gml:posList><br>
</gml:LinearRing><br>
</gml:exterior><br>
</gml:Polygon><br>
<br>
Does that give any clues?<br>
<br>
I'll head off and check it in my 3.16 version now.<br>
Paul<br>
<br>
-----Original Message-----<br>
From: Paul Wittle<br>
Sent: 27 November 2020 15:14<br>
To: <a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a>;
<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a><br>
Subject: RE: [QGIS-Developer] Loading WFS layers from GeoServer<br>
<br>
Hi,<br>
<br>
I was using the 32 bit version (don't ask) but I've just tried it in the 64bit version (although 3.10) with the network logger installed and the errors read:<br>
<br>
java.lang.RuntimeException: Failed to get property: {<a href="http://www.opengis.net/wfs/2.0%7DboundedBy" target="_blank">http://www.opengis.net/wfs/2.0}boundedBy</a> Failed to get property: {<a href="http://www.opengis.net/wfs/2.0%7DboundedBy" target="_blank">http://www.opengis.net/wfs/2.0}boundedBy</a>
 java.io.IOExceptionCannot do natural order without a primary key, please add it or specify a manual sort over existing attributes<br>
<br>
The datasource is GeoServer but GeoServer is connecting to a view in SQL Server where the first table in the view is a table with a primary key and spatial index.<br>
<br>
However I don't really understand because requesting the data in the GeoServer layer preview works fine so I assume QGIS is asking something the layer preview does not?<br>
<br>
Thanks,<br>
Paul<br>
<br>
-----Original Message-----<br>
From: Richard Duivenvoorde <<a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a>><br>
Sent: 27 November 2020 15:00<br>
To: Paul Wittle <<a href="mailto:P.Wittle@dorsetcc.gov.uk" target="_blank">P.Wittle@dorsetcc.gov.uk</a>>;
<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a><br>
Subject: Re: [QGIS-Developer] Loading WFS layers from GeoServer<br>
<br>
Hi Paul,<br>
<br>
QGIS 3.16 (well, since ... I don not know exactly) has s NetworkLogger/Debugger.<br>
If you hit the F12 button, you will see all WFS-requests that QGIS is firing to the server.<br>
You can 'replay' these in a browser, and see if it returns valid GML (as in: save it to disk and then try to open it as vector data).<br>
Normally QGIS starts with a GetCapabilities request, then a DescribeLayer and then a GetFeature. You need that last one.<br>
In the Network Debugging window you can also see if the server maybe returns an error code (as: not 200).<br>
<br>
Does the Geoserver-layer preview work? As in can you see the layers there?<br>
<br>
Normally WFS/WMS from Geoserver play pretty well together with QGIS.<br>
Is there something special to the data? (curves, nonvalid geometries, ???)<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<br>
<br>
<br>
<br>
On 11/27/20 3:48 PM, Paul Wittle wrote:<br>
> Hi,<br>
><br>
><br>
><br>
> So the WFS layers do now return correctly from GeoServer in both WMS and all WFS formats and I’ve improved various indexes.<br>
><br>
><br>
><br>
> I also found a plugin called WFS 2.0 Client and tried that; it returned the features successfully.<br>
><br>
><br>
><br>
> Unfortunately that seems to be a one off download method rather than adding a live linked layer so it didn’t fix the issue but did prove that the GeoServer can return features.<br>
><br>
><br>
><br>
> I’m still having the same trouble when trying to add the layers to QGIS 3.10 though; it just adds a layer with the image icon but of course it can’t draw the layer and it loads as a bad layer if you save it in the project.<br>
><br>
><br>
><br>
> Does anyone have any suggestions of what might be the issue?<br>
><br>
><br>
><br>
> The server does require authentication.<br>
><br>
><br>
><br>
> Thanks,<br>
> Paul<br>
><br>
><br>
><br>
><br>
><br>
> *From:*Ian Turton <<a href="mailto:ijturton@gmail.com" target="_blank">ijturton@gmail.com</a>><br>
> *Sent:* 27 November 2020 09:59<br>
> *To:* Paul Wittle <<a href="mailto:P.Wittle@dorsetcc.gov.uk" target="_blank">P.Wittle@dorsetcc.gov.uk</a>><br>
> *Cc:* <a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a><br>
> *Subject:* Re: [QGIS-Developer] Loading WFS layers from GeoServer<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, 27 Nov 2020 at 09:48, Paul Wittle <<a href="mailto:paul.wittle@dorsetcouncil.gov.uk" target="_blank">paul.wittle@dorsetcouncil.gov.uk</a> <mailto:<a href="mailto:paul.wittle@dorsetcouncil.gov.uk" target="_blank">paul.wittle@dorsetcouncil.gov.uk</a>>>
 wrote:<br>
><br>
>     Hi,<br>
><br>
><br>
><br>
>     I’m trying to load some WFS layers from my internal GeoServer into QGIS 3.10 and 3.16. The datastore in GeoServer is based on a view in a SQL Server database but it does have a primary key on the spatial table at least.<br>
><br>
><br>
><br>
>     When I load it in 3.10 it comes in as the image icon (i.e. doesn’t load) so I thought I’d try it in the latest version and in that version QGIS just disappears (completely crashes).<br>
><br>
><br>
><br>
>     Has anyone else had a similar problem and can help me work out how to get the layers to load? I suspect the issue is the way the view is configured in SQL Server however I also wonder if I need to investigate the 3.16 crash and potentially log that as
 a bug as it is not handling the crash with the normal message the application just closes without warning?<br>
><br>
><br>
><br>
><br>
><br>
> Can you check if GeoServer is returning GML or an error message when you make a WFS request? But I don't think that QGis should crash no matter what is in the response.<br>
><br>
><br>
><br>
> Ian<br>
><br>
><br>
><br>
> This e-mail and any files transmitted with it are intended solely for<br>
> the use of the individual or entity to whom they are addressed. It may<br>
> contain unclassified but sensitive or protectively marked material and<br>
> should be handled accordingly. Unless you are the named addressee (or<br>
> authorised to receive it for the addressee) you may not copy or use<br>
> it, or disclose it to anyone else. If you have received this<br>
> transmission in error please notify the sender immediately. All<br>
> traffic may be subject to recording and/or monitoring in accordance<br>
> with relevant legislation. Any views expressed in this message are<br>
> those of the individual sender, except where the sender specifies and<br>
> with authority, states them to be the views of Dorset Council. Dorset<br>
> Council does not accept service of documents by fax or other<br>
> electronic means. Virus checking: Whilst all reasonable steps have<br>
> been taken to ensure that this electronic communication and its<br>
> attachments whether encoded, encrypted or otherwise supplied are free<br>
> from computer viruses, Dorset Council accepts no liability in respect<br>
> of any loss, cost, damage or expense suffered as a result of accessing<br>
> this message or any of its attachments. For information on how Dorset<br>
> Council processes your information, please see<br>
> <a href="http://www.dorsetcouncil.gov.uk/416433" target="_blank">www.dorsetcouncil.gov.uk/416433</a><br>
><br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
<br>
This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. It may contain unclassified but sensitive or protectively marked material and should be handled accordingly. Unless you are
 the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All traffic may be subject to recording and/or
 monitoring in accordance with relevant legislation. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Dorset Council. Dorset Council does not accept
 service of documents by fax or other electronic means. Virus checking: Whilst all reasonable steps have been taken to ensure that this electronic communication and its attachments whether encoded, encrypted or otherwise supplied are free from computer viruses,
 Dorset Council accepts no liability in respect of any loss, cost, damage or expense suffered as a result of accessing this message or any of its attachments. For information on how Dorset Council processes your information, please see
<a href="http://www.dorsetcouncil.gov.uk/416433" target="_blank">www.dorsetcouncil.gov.uk/416433</a><br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Ian Turton<o:p></o:p></p>
</div>
</div>
This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. It may contain unclassified but sensitive or protectively marked material and should be handled accordingly. Unless you are
 the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All traffic may be subject to recording and/or
 monitoring in accordance with relevant legislation. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Dorset Council. Dorset Council does not accept
 service of documents by fax or other electronic means. Virus checking: Whilst all reasonable steps have been taken to ensure that this electronic communication and its attachments whether encoded, encrypted or otherwise supplied are free from computer viruses,
 Dorset Council accepts no liability in respect of any loss, cost, damage or expense suffered as a result of accessing this message or any of its attachments. For information on how Dorset Council processes your information, please see www.dorsetcouncil.gov.uk/416433
</body>
</html>