Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7043

UpdateRecord fails to write schema when the record writer's Schema Access Strategy is set to Inherit Record Schema

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0
    • Component/s: Core Framework
    • Labels:
      None

      Description

      When using an UpdateRecord processor with JsonRecordSetWriter, with Schema Access Strategy set to Inherit Record Schema, I get the exception shown below.

      This is a regression. The same flow works on NiFi 1.9.x without problems.

      As a workaround, if I change the record writer's to get the schema directly from Schema Registry, instead of inheriting it, the flow works fine.

      2020-01-17 19:56:09,289 ERROR org.apache.nifi.processors.standard.UpdateRecord: UpdateRecord[id=bdfc4119-9eaa-3a0b-ba6c-90f138fd70a9] Failed to process StandardFlowFileRecord[uuid=c0ba0dc9-fb4d-430a-8f21-c41f3cb29319,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1579290967244-1, container=default, section=1], offset=34, length=34],offset=0,name=c0ba0dc9-fb4d-430a-8f21-c41f3cb29319,size=34]; will route to failure: org.apache.nifi.processor.exception.ProcessException: Cannot write Schema Reference as Attributes because it does not contain a Schema Identifier
      org.apache.nifi.processor.exception.ProcessException: Cannot write Schema Reference as Attributes because it does not contain a Schema Identifier
      	at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:168)
      	at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2997)
      	at org.apache.nifi.processors.standard.AbstractRecordProcessor.onTrigger(AbstractRecordProcessor.java:122)
      	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
      	at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)
      	at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
      	at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
      	at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.nifi.schema.access.SchemaNotFoundException: Cannot write Schema Reference as Attributes because it does not contain a Schema Identifier
      	at org.apache.nifi.schema.access.HortonworksAttributeSchemaReferenceWriter.validateSchema(HortonworksAttributeSchemaReferenceWriter.java:62)
      	at org.apache.nifi.serialization.SchemaRegistryRecordSetWriter.getSchemaAccessWriter(SchemaRegistryRecordSetWriter.java:150)
      	at org.apache.nifi.json.JsonRecordSetWriter.createWriter(JsonRecordSetWriter.java:213)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87)
      	at com.sun.proxy.$Proxy124.createWriter(Unknown Source)
      	at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:150)
      	... 14 common frames omitted
      

        Attachments

        1. UpdateRecord.xml
          24 kB
          Andre Araujo

          Issue Links

            Activity

              People

              • Assignee:
                markap14 Mark Payne
                Reporter:
                asdaraujo Andre Araujo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h