Support Questions

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

HDF 2.1: Warnings, frequently, can't track down

avatar
Master Guru

2017-01-30 16:38:39,425 WARN [Timer-Driven Process Thread-9] o.a.n.c.t.ContinuallyRunProcessorTask java.lang.IndexOutOfBoundsException: No group 1 at java.util.regex.Matcher.start(Matcher.java:375) ~[na:1.8.0_77] at java.util.regex.Matcher.appendReplacement(Matcher.java:880) ~[na:1.8.0_77] at java.util.regex.Matcher.replaceAll(Matcher.java:955) ~[na:1.8.0_77] at java.lang.String.replaceAll(String.java:2223) ~[na:1.8.0_77] at org.apache.nifi.processors.standard.ReplaceText$RegexReplace.replace(ReplaceText.java:518) ~[na:na] at org.apache.nifi.processors.standard.ReplaceText.onTrigger(ReplaceText.java:263) ~[na:na] at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) ~[nifi-api-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099) ~[nifi-framework-core-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136) [nifi-framework-core-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47) [nifi-framework-core-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132) [nifi-framework-core-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_77] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_77] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@Timothy Spann,

I don't have a solution, yet, but I think that ReplaceText is doing recursive replacement of some sort. It is replacing the value with the requested attribute, but it is then evaluating that replacement again, including a new $2, but there is no group 2 captured in the search.

I find that this happens if the attribute I'm replacing has a dollar sign followed by a number in it. For instance, the following replace text is going to put the user.name attribute into the flowfile:

11983-screen-shot-2017-02-01-at-42944-pm.png

However, when the attribute has a $2 in it, I get an IndexOutOfBounds error and the offending flowfile stays in the upstream queue.

11984-screen-shot-2017-02-01-at-43331-pm.png

Here are the flowfile attributes that show a $2 in the middle of the user.name attribute.

11985-screen-shot-2017-02-01-at-43116-pm.png

I get the same issue with "no group 6" if the name has $6 in it.

I'm going to try some of the quoting functions to see if that changes the behavior.

John

View solution in original post

2 REPLIES 2

avatar

Tim,

It looks like the regex you're using might need more work to account for optional matches. The ReplaceText processor is complaining about missing match groups and has no context to do the replacement.

avatar
Expert Contributor

@Timothy Spann,

I don't have a solution, yet, but I think that ReplaceText is doing recursive replacement of some sort. It is replacing the value with the requested attribute, but it is then evaluating that replacement again, including a new $2, but there is no group 2 captured in the search.

I find that this happens if the attribute I'm replacing has a dollar sign followed by a number in it. For instance, the following replace text is going to put the user.name attribute into the flowfile:

11983-screen-shot-2017-02-01-at-42944-pm.png

However, when the attribute has a $2 in it, I get an IndexOutOfBounds error and the offending flowfile stays in the upstream queue.

11984-screen-shot-2017-02-01-at-43331-pm.png

Here are the flowfile attributes that show a $2 in the middle of the user.name attribute.

11985-screen-shot-2017-02-01-at-43116-pm.png

I get the same issue with "no group 6" if the name has $6 in it.

I'm going to try some of the quoting functions to see if that changes the behavior.

John