Sam,
When you get the error that a FlowFile is not the most recent version, it means
that you have modified
the FlowFile in some way via the ProcessSession and then attempted to use an
old, out-dated version.
Commonly this happens when you have code that looks something like this:
----
FlowFile flowFile = session.get();
if (flowFile == null) {
return;
}
session.putAttribute(flowFile, "hello", "hello");
session.transfer(flowFile, REL_SUCCESS);
----
The issue here is that the ProcessSession.putAttribute method called above
returns a new FlowFile
object, and we then pass the old version of the FlowFile to session.transfer.
This code would need
to be updated to look like this:
----
FlowFile flowFile = session.get();
if (flowFile == null) {
return;
}
flowFile = session.putAttribute(flowFile, "hello", "hello");
session.transfer(flowFile, REL_SUCCESS);
----
Note the 'flowFile' variable is re-assigned to the new FlowFile object when
session.putAttribute is
called so that we pass the most up-to-date version of the FlowFile to
ProcessSession.transfer.
Thanks!
-Mark
> On Feb 14, 2017, at 8:45 AM, sam <[email protected]> wrote:
>
> Hi Joe, I made those changes, also increase disk I hope this gets better.
> However I am still getting one error, which started appearing only now, not
> sure related to these changes with splitText, removing the putAttribute code
> from CustomProcessor and Adding RouteOnContent after ListS3.
>
> 2017-02-14 14:44:23,022 WARN [Timer-Driven Process Thread-5]
> o.a.n.c.t.ContinuallyRunProcessorTask Administratively Yielding
> STOztamEventsTransformations[id=cbfeb987-0159-1000-9280-cb6801c353c8] due to
> uncaught Exception:
> org.apache.nifi.processor.exception.FlowFileHandlingException:
> StandardFlowFileRecord[uuid=d063007d-d32f-44fc-bcad-8819bfd7e213,claim=StandardContentClaim
> [resourceClaim=StandardResourceClaim[id=1487083212093-3, container=default,
> section=3], offset=0,
> length=491],offset=0,name=filename-e0-b67a-068de154615f,size=491] is not the
> most recent version of this FlowFile within this session
> (StandardProcessSession[id=589955])
> 2017-02-14 14:44:23,022 WARN [Timer-Driven Process Thread-5]
> o.a.n.c.t.ContinuallyRunProcessorTask
> org.apache.nifi.processor.exception.FlowFileHandlingException:
> StandardFlowFileRecord[uuid=d063007d-d32f-44fc-bcad-8819bfd7e213,claim=StandardContentClaim
> [resourceClaim=StandardResourceClaim[id=1487083212093-3, container=default,
> section=3], offset=0,
> length=491],offset=0,name=filename-068de154615f,size=491] is not the most
> recent version of this FlowFile within this session
> (StandardProcessSession[id=589955])
> at
> org.apache.nifi.controller.repository.StandardProcessSession.validateRecordState(StandardProcessSession.java:2806)
> ~[nifi-framework-core-1.1.1.jar:1.1.1]
> at
> org.apache.nifi.controller.repository.StandardProcessSession.transfer(StandardProcessSession.java:1764)
> ~[nifi-framework-core-1.1.1.jar:1.1.1]
> at
> org.streamhub.processors.STOztamEventsTransformations.onTrigger(STOztamEventsTransformations.java:146)
> ~[na:na]
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> ~[nifi-api-1.1.1.jar:1.1.1]
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099)
> ~[nifi-framework-core-1.1.1.jar:1.1.1]
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
> [nifi-framework-core-1.1.1.jar:1.1.1]
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
> [nifi-framework-core-1.1.1.jar:1.1.1]
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
> [nifi-framework-core-1.1.1.jar:1.1.1]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [na:1.8.0_111]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> [na:1.8.0_111]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> [na:1.8.0_111]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> [na:1.8.0_111]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [na:1.8.0_111]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [na:1.8.0_111]
> at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/Nifi-in-a-hung-state-tp14713p14737.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.