You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When doing a CSW GetRecords request with a Filter to get records modified since a given date, GeoNetwork generates an invalid JSON object for ElasticSearch.
<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\' (code 92)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"{ "bool": {
"must": [
{
"range" : {
"changeDate" : {
"gt" : \"1910-02-05\"
}
}
}
]
,"filter":{"query_string":{"query":"(op0:(1) ) AND (isTemplate:n) AND (draft:n OR draft:e)"}}}}"; line: 6, column: 26]</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
NOTE: The quotes around the date value are escaped. That's what is causing the exception.
The bug applies to the following CSW filters:
<PropertyIsLessThan>
<PropertyIsLessThanOrEqualTo>
<PropertyIsGreaterThan>
<PropertyIsGreaterThanOrEqualTo>
<PropertyIsLike>
<PropertyIsBetween>
Doesn't apply to the following CSW filters:
<PropertyIsEqualTo>
<PropertyIsNotEqualTo>
To Reproduce
Steps to reproduce the behavior:
Log as admin in GeoNetwork
Go to: Admin console - Settings - CSW test
Copy / paste the request above in the "CSW Request" box
Click the "Send CSW Request" button
Expected behavior
List of records in the response
Desktop (please complete the following information):
GeoNetwork Versions:
4.2.7: Not affected (filtering works)
4.2.8: Affected
4.2.9: Affected
4.4.4: Affected
Additional context
GeoNetwork is running in Docker, using the official GeoNetwork Docker image found on DockerHub.
NOTE: I believe the following issue has introduced the bug: #7527
The text was updated successfully, but these errors were encountered:
gaellafond
changed the title
CSW GetRecords filter - java.lang.RuntimeException
CSW GetRecords filter to get last modified records - java.lang.RuntimeException
May 14, 2024
gaellafond
changed the title
CSW GetRecords filter to get last modified records - java.lang.RuntimeException
CSW GetRecords filter to get last modified records - JsonParseException
May 14, 2024
I figured out I can use timestamp (numerical value) for the "Modified" property. It's a good workaround, but the bug is still present. String comparison should not produce a JsonParseException.
The timestamp doesn't work with GeoNetwork 3 and GeoNetwork 4 (up to 4.2.7). A formatted date must be used in the filter. The point of using a standard API is to keep it consistent. There is nothing consistent in the implementation of the CSW API between version of GeoNetwork... It's very frustrating to use...
Describe the bug
When doing a CSW GetRecords request with a Filter to get records modified since a given date, GeoNetwork generates an invalid JSON object for ElasticSearch.
Request example:
Response:
NOTE: The quotes around the date value are escaped. That's what is causing the exception.
The bug applies to the following CSW filters:
<PropertyIsLessThan>
<PropertyIsLessThanOrEqualTo>
<PropertyIsGreaterThan>
<PropertyIsGreaterThanOrEqualTo>
<PropertyIsLike>
<PropertyIsBetween>
Doesn't apply to the following CSW filters:
<PropertyIsEqualTo>
<PropertyIsNotEqualTo>
To Reproduce
Steps to reproduce the behavior:
Expected behavior
List of records in the response
Desktop (please complete the following information):
Additional context
GeoNetwork is running in Docker, using the official GeoNetwork Docker image found on DockerHub.
NOTE: I believe the following issue has introduced the bug: #7527
The text was updated successfully, but these errors were encountered: