Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24876

Fix audit for proxies and versions with MongoDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.10
    • Fix Version/s: 8.10-HF29
    • Component/s: Audit, Core MongoDB
    • Release Notes Summary:
      The history is displayed for proxies and versions when the related MongoDB audit has been cleared.
    • Tags:
    • Backlog priority:
      900
    • Sprint:
      nxFG 10.2.4
    • Story Points:
      5

      Description

      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:

      1. configure Nuxeo to use MongoDB for the audit
      2. publish a document
      3. clear the audit for the live document in the database (or the complete audit)
      4. navigate to this document using the WebUI OR navigate to the History tab of the published document to produce this error

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h