-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10
-
Fix Version/s: 8.10-HF29
-
Component/s: Audit, Core MongoDB
DocumentAuditHelper#runNativeQueryForBackend is only compatible with 2 backends : Elasticsearch and Hibernate. If Audit uses MongoDB, it will generate a native query for Hibernate which cannot be parsed and it throws the following exception
org.bson.json.JsonParseException: JSON reader was expecting a value but found 'from'. at org.bson.json.JsonReader.readBsonType(JsonReader.java:228) at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:645) at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687) at org.bson.AbstractBsonReader.readStartDocument(AbstractBsonReader.java:421) at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:138) at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:45) at org.bson.Document.parse(Document.java:105) at org.bson.Document.parse(Document.java:90) at org.nuxeo.mongodb.audit.MongoDBAuditBackend.buildFilter(MongoDBAuditBackend.java:182) at org.nuxeo.mongodb.audit.MongoDBAuditBackend.nativeQuery(MongoDBAuditBackend.java:172) at org.nuxeo.ecm.platform.audit.api.document.DocumentAuditHelper.runNativeQueryForBackend(DocumentAuditHelper.java:163) at org.nuxeo.ecm.platform.audit.api.document.DocumentAuditHelper.getAuditParamsForUUID(DocumentAuditHelper.java:90) at org.nuxeo.mongodb.audit.pageprovider.MongoDBDocumentHistoryPageProvider.getParameters(MongoDBDocumentHistoryPageProvider.java:91) at org.nuxeo.mongodb.audit.pageprovider.MongoDBAuditPageProvider.buildAuditFilter(MongoDBAuditPageProvider.java:167) at org.nuxeo.mongodb.audit.pageprovider.MongoDBAuditPageProvider.getCurrentPage(MongoDBAuditPageProvider.java:98) at org.nuxeo.ecm.restapi.server.jaxrs.enrichers.AuditJsonEnricher.write(AuditJsonEnricher.java:76) at org.nuxeo.ecm.restapi.server.jaxrs.enrichers.AuditJsonEnricher.write(AuditJsonEnricher.java:48) at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:54) at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:37) at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:76) at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:99) at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:76)
Steps to reproduce the error:
- configure Nuxeo to use MongoDB for the audit
- publish a document
- clear the audit for the live document in the database (or the complete audit)
- navigate to this document using the WebUI OR navigate to the History tab of the published document to produce this error
- depends on
-
NXP-21860 Make DocumentAuditHelper support all audit backends
- Resolved