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

Handle array/list of blobs when writing entries to Audit stream

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 10.10-HF62, 2021.22
    • Component/s: Streams
    • Release Notes Summary:
      Multivalued blob properties are ignored in the audit records.
    • Backlog priority:
      750
    • Sprint:
      nxplatform #61, nxplatform #62, nxplatform #63
    • Story Points:
      3

      Description

       This case happens for example when completing a workflow task where one of the variable is a multi-valued blob.

      It produces this message in the logs

      WARN  [http-nio-0.0.0.0-8080-exec-15] [org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener] Unable to translate entry into json, eventId:afterWorkflowTaskEnded: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->org.nuxeo.ecm.core.blob.binary.BinaryBlob["binary"]->org.nuxeo.ecm.core.blob.binary.Binary["stream"]->java.io.FileInputStream["fd"])
      com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->org.nuxeo.ecm.core.blob.binary.BinaryBlob["binary"]->org.nuxeo.ecm.core.blob.binary.Binary["stream"]->java.io.FileInputStream["fd"])
              at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1191) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:313) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2656) ~[jackson-databind-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:381) ~[jackson-core-2.9.10.jar:2.9.10]
              at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1726) ~[jackson-core-2.9.10.jar:2.9.10]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeExtendedInfo(LogEntryJsonWriter.java:148) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeExtendedInfo(LogEntryJsonWriter.java:156) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeExtendedInfo(LogEntryJsonWriter.java:156) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeExtendedInfos(LogEntryJsonWriter.java:125) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeEntityBody(LogEntryJsonWriter.java:116) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter.writeEntityBody(LogEntryJsonWriter.java:92) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:80) ~[nuxeo-core-io-10.10-HF44.jar:?]
              at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) ~[nuxeo-core-io-10.10-HF44.jar:?]
              at org.nuxeo.ecm.core.io.registry.MarshallerHelper.objectToJson(MarshallerHelper.java:76) ~[nuxeo-core-io-10.10-HF44.jar:?]
              at org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener.asJson(StreamAuditEventListener.java:164) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener.writeEntry(StreamAuditEventListener.java:142) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener.lambda$writeEntries$1(StreamAuditEventListener.java:128) ~[nuxeo-platform-audit-core-10.10-HF53.jar:?]
              at java.util.ArrayList.forEach(ArrayList.java:1259) [?:1.8.0_292]
              at org.nuxeo.ecm.platform.audit.listener.StreamAuditEventListener.writeEntries(StreamAuditEventListener.java:128) [nuxeo-platform-audit-core-10.10-HF53.jar:?]
      

      and the record is not written to the stream because it was not possible to serialize all the values as JSON.

      NB: Simple blob properties are correctly managed.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: