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

Fix AuditQueryBuilder's date conversion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 9.10-HF05
    • Fix Version/s: 10.3
    • Component/s: Audit, Rest API, Web UI

      Description

      New audit search API queryLogs#AuditQueryBuilder, introduced in 9.3, and now used everywhere on Nuxeo, has regressions.

      While browsing on a specific version on WebUI, we've got this exception:

      Caused by: UncategorizedExecutionException[Failed execution]; nested: IOException[can not write type [class java.time.ZonedDateTime]];
              at org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:89)
              at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:47)
              at org.nuxeo.elasticsearch.client.ESTransportClient.search(ESTransportClient.java:201)
              at org.nuxeo.elasticsearch.audit.ESAuditBackend.runRequest(ESAuditBackend.java:671)
              at org.nuxeo.elasticsearch.audit.ESAuditBackend.queryLogs(ESAuditBackend.java:272)
              at org.nuxeo.ecm.platform.audit.api.document.DocumentAuditHelper.getAuditParamsForUUID(DocumentAuditHelper.java:110)
              at org.nuxeo.elasticsearch.audit.pageprovider.ESDocumentHistoryPageProvider.getParameters(ESDocumentHistoryPageProvider.java:117)
              at org.nuxeo.elasticsearch.audit.pageprovider.ESAuditPageProvider.buildAuditQuery(ESAuditPageProvider.java:187)
              at org.nuxeo.elasticsearch.audit.pageprovider.ESAuditPageProvider.getCurrentPage(ESAuditPageProvider.java:101)
              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)
              at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.writeTo(PartialCoreIODelegate.java:119)
      

      AuditQueryBuilder API converts all kind of date (Date, Calendar, Temporal) to a joda DateTime in order to hold it. Latter we'll get this value as a ZonedDateTime.
      When audit backend is Elasticsearch, we've got an exception because the date is not handled by Elasticsearch client. It also could the case for other backends.

      Fix the issue on all available backends.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: