Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to pass flowfile attributes as arguments to ExecuteStreamCommand processor?

avatar

I have the following EvaluateJsonPath processor which creates some new attributes for every flow file -

19592-evaluatejsonpath.jpg

Going forward, the attributes store some string values (which may contain spaces/special characters).

I want to pass these attributes (for every flowfile in queue respectively) to an ExecuteStreamCommand processor running an R script at the backend.

19594-executecommand.jpg

Handling arguments in R script -(see attachment)

But every time an invalid null character error is encountered as below -

2017-07-25 19:06:33,530 ERROR [Timer-Driven Process Thread-6] o.a.n.p.standard.ExecuteStreamCommand ExecuteStreamCommand[id=7912c788-015d-1000-b1aa-73e854d7b33a] Failed to process session due to org.apache.nifi.processor.exception.ProcessException: java.io.IOException: invalid null character in command: {} org.apache.nifi.processor.exception.ProcessException: java.io.IOException: invalid null character in command at org.apache.nifi.processors.standard.ExecuteStreamCommand.onTrigger(ExecuteStreamCommand.java:339) at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120) at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147) at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47) at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: invalid null character in command at java.lang.ProcessBuilder.start(ProcessBuilder.java:1024) at org.apache.nifi.processors.standard.ExecuteStreamCommand.onTrigger(ExecuteStreamCommand.java:336) ... 12 common frames omitted

How to resolve the same?

Attachments:

evaluatejsonpath.jpg

executecommand.jpg

rscript.jpg

1 REPLY 1

avatar
Master Guru

What are some sample values for those parameters? Could they have spaces in them? Perhaps try putting quotes around each of the arguments like "${to}"?