geosolutions-it / nexus-geonode

Nexus Platform
BSD 2-Clause "Simplified" License
0 stars 4 forks source link

GeoNode CSW API errors when searching for layers #68

Open ricardogsilva opened 3 years ago

ricardogsilva commented 3 years ago

In the context of the QGIS GeoNode plugin we are implementing support for both the new V2 API and also the CSW API.

We're currently working on adding support for spatial filters when using the CSW API, as described in kartoza/qgis_geonode#134.

Currently facing an error with the CSW implementation, which seems related to GeoNode. I am attaching an XML file to this issue that has a sample request. This request is very simple, it can be used as the request body to perform a CSW GetRecords operation. It is similar to the samples shown on pycsw's own automated test suites, (look for example at this one: e.g https://github.com/geopython/pycsw/blob/master/tests/functionaltests/suites/apiso/post/GetRecords-filter-bbox.xml)

Unexpectedly, the NEXUS staging instance responds to this request with an error.

curl -d @test_request_payload.xml -H "Content-Type: application/xml" https://dev.nexus.geosolutionsgroup.com/catalogue/csw

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- pycsw 2.6.0 -->
<ows:ExceptionReport xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2.0" language="en" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
  <ows:Exception exceptionCode="InvalidParameterValue" locator="constraint">
    <ows:ExceptionText>Invalid query syntax</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

I also get this same error when I try this request against https://master.demo.geonode.org/catalogue/csw.

Oddly enough, I have a local instance of the NEXUS GeoNode running and it does not throw the error:

curl -d @test_request_payload.xml -H "Content-Type: application/xml" http://localhost/catalogue/csw

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- pycsw 2.6.0 -->
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
  <csw:SearchStatus timestamp="2021-03-30T16:46:36Z"/>
  <csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" nextRecord="0" recordSchema="http://www.isotc211.org/2005/gmd" elementSet="full"/>

I'm not sure what causes the error. However, I noticed that in my local env, if I change my GeoNode DBMS from PostGIS to spatialite I also start getting the same error message when I perform this request. I wonder if this is the root of the issue or not

This is the request XML payload (I had to zip it in order to make zenhub allow the upload): https://app.zenhub.com/files/331261945/e3aebe45-011f-4e8b-8e63-84452f2246a9/download

giohappy commented 3 years ago

@ricardogsilva is this is valid?