Support Questions

Find answers, ask questions, and share your expertise

Nifi InvokeHTTP "failed while executing OnScheduled task"

New Contributor

Hi all

I am trying to use Nifi to access some data in my Dropbox account. I am using this blog as a guide-

Get data from Dropbox using Nifi

Earlier I got "Unable to find valid certification path to requested target ", and it seems I needed to use SSLContextService since my web access is via company firewall which seems to add self signed certificates to each request. So went ahead and I did that, first adding the self signed cert root to my local JDK cacerts and pointing the service to the cacerts as the truststore

That made the original error go away but now I get a new error "StandardProcessorNode Failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task"

I get this error right away (as oppposed to the earlier certification error which at least made data show up in the Input side of the InvokeHttp processor ), perhaps that is an indication of the error location.

Would appreciate any help, thanks!

Error: 2017-12-12 17:02:02,456 ERROR [StandardProcessScheduler Thread-4] o.a.n.controller.StandardProcessorNode Failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
	at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1483)
	at org.apache.nifi.controller.StandardProcessorNode.access$000(StandardProcessorNode.java:103)
	at org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1302)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	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.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:206)
	at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1466)
	... 9 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.GeneratedMethodAccessor469.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137)
	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125)
	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70)
	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47)
	at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1306)
	at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1302)
	... 6 common frames omitted
Caused by: java.lang.NullPointerException: null
7 REPLIES 7

New Contributor

Can you picture your SSLContextService config

Super Guru

Also more from the log, specifically the stack trace below the NullPointerException

New Contributor

sslcontextsvc.jpginvokehttp.jpg

Not allowing me to post more than 6000 chars for a reply so I have posted it as an answer at the top level if you want the complete stacktrace.

Attached is more stack trace and screenshot of the processors

2017-12-13 15:31:46,056 ERROR [StandardProcessScheduler Thread-6] o.a.nifi.processors.standard.InvokeHTTP InvokeHTTP[id=4b978fb8-0160-1000-9580-343051a9b895] InvokeHTTP[id=4b978fb8-0160-1000-9580-343051a9b895] failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.; processor will not be scheduled to run for 30 seconds: java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.	at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1483)	at org.apache.nifi.controller.StandardProcessorNode.access$000(StandardProcessorNode.java:103)	at org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1302)	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)	at java.util.concurrent.FutureTask.run(FutureTask.java:266)	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)	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.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException	at java.util.concurrent.FutureTask.report(FutureTask.java:122)	at java.util.concurrent.FutureTask.get(FutureTask.java:206)	at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1466)	... 9 common frames omittedCaused by: java.lang.reflect.InvocationTargetException: null	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.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137)	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125)	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70)	at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47)	at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1306)	at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1302)	... 6 common frames omittedCaused by: java.lang.NullPointerException: null	at java.security.Provider$ServiceKey.<init>(Provider.java:872)	at java.security.Provider$ServiceKey.<init>(Provider.java:865)	at java.security.Provider.getService(Provider.java:1039)	at sun.security.jca.ProviderList.getService(ProviderList.java:332)	at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)	at java.security.Security.getImpl(Security.java:695)	at java.security.KeyStore.getInstance(KeyStore.java:848)	at org.apache.nifi.processors.standard.InvokeHTTP.setSslSocketFactory(InvokeHTTP.java:571)	at org.apache.nifi.processors.standard.InvokeHTTP.setUpClient(InvokeHTTP.java:540)	... 16 common frames omitted

New Contributor

Attached more stack trace and screenshot of the processors

2017-12-13 15:31:46,056 ERROR [StandardProcessScheduler Thread-6] o.a.nifi.processors.standard.InvokeHTTP InvokeHTTP[id=4b978fb8-0160-1000-9580-343051a9b895] InvokeHTTP[id=4b978fb8-0160-1000-9580-343051a9b895] failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.; processor will not be scheduled to run for 30 seconds: java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
 at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1483)
 at org.apache.nifi.controller.StandardProcessorNode.access$000(StandardProcessorNode.java:103)
 at org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1302)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 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.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 at java.util.concurrent.FutureTask.get(FutureTask.java:206)
 at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1466)
 ... 9 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
 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.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47)
 at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1306)
 at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1302)
 ... 6 common frames omitted
Caused by: java.lang.NullPointerException: null
 at java.security.Provider$ServiceKey.<init>(Provider.java:872)
 at java.security.Provider$ServiceKey.<init>(Provider.java:865)
 at java.security.Provider.getService(Provider.java:1039)
 at sun.security.jca.ProviderList.getService(ProviderList.java:332)
 at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
 at java.security.Security.getImpl(Security.java:695)
 at java.security.KeyStore.getInstance(KeyStore.java:848)
 at org.apache.nifi.processors.standard.InvokeHTTP.setSslSocketFactory(InvokeHTTP.java:571)
 at org.apache.nifi.processors.standard.InvokeHTTP.setUpClient(InvokeHTTP.java:540)
 ... 16 common frames omitted
2017-12-13 15:31:46,056 ERROR [StandardProcessScheduler Thread-6] o.a.n.controller.StandardProcessorNode Failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
 at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1483)
 at org.apache.nifi.controller.StandardProcessorNode.access$000(StandardProcessorNode.java:103)
 at org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1302)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 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.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 at java.util.concurrent.FutureTask.get(FutureTask.java:206)
 at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1466)
 ... 9 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
 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.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70)
 at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47)
 at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1306)
 at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1302)
 ... 6 common frames omitted
Caused by: java.lang.NullPointerException: null
 at java.security.Provider$ServiceKey.<init>(Provider.java:872)
 at java.security.Provider$ServiceKey.<init>(Provider.java:865)
 at java.security.Provider.getService(Provider.java:1039)
 at sun.security.jca.ProviderList.getService(ProviderList.java:332)
 at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
 at java.security.Security.getImpl(Security.java:695)
 at java.security.KeyStore.getInstance(KeyStore.java:848)
 at org.apache.nifi.processors.standard.InvokeHTTP.setSslSocketFactory(InvokeHTTP.java:571)
 at org.apache.nifi.processors.standard.InvokeHTTP.setUpClient(InvokeHTTP.java:540)
 ... 16 common frames omitted
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.c.s.StandardProcessScheduler Stopping PutFile[id=4d37fff1-0160-1000-7a99-c384cdc9bad9]
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.controller.StandardProcessorNode Stopping processor: class org.apache.nifi.processors.standard.PutFile
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.c.s.StandardProcessScheduler Stopping GetFile[id=4b94f122-0160-1000-88d0-13d123320b47]
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.controller.StandardProcessorNode Stopping processor: class org.apache.nifi.processors.standard.GetFile
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.c.s.StandardProcessScheduler Stopping InvokeHTTP[id=4b978fb8-0160-1000-9580-343051a9b895]
2017-12-13 15:31:59,455 INFO [NiFi Web Server-444] o.a.n.controller.StandardProcessorNode Stopping processor: class org.apache.nifi.processors.standard.InvokeHTTP
2017-12-13 15:31:59,457 INFO [StandardProcessScheduler Thread-5] o.a.n.c.s.TimerDrivenSchedulingAgent Stopped scheduling PutFile[id=4d37fff1-0160-1000-7a99-c384cdc9bad9] to run
2017-12-13 15:31:59,457 INFO [StandardProcessScheduler Thread-5] o.a.n.c.scheduling.QuartzSchedulingAgent Stopped scheduling GetFile[id=4b94f122-0160-1000-88d0-13d123320b47] to run
2017-12-13 15:32:10,207 INFO [Flow Service Tasks Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@5109dd37 // Another save pending = false

44430-sslcontextsvc.jpg


invokehttp.jpg

Did you ever resolve this? I have the same issue. InvokeHTTP only when using HTTPS.

This might not be a resolution but the error went away under the following circumstances for me:

  • Use HTTPS
  • Do not set an SSL Context Service
  • Make sure your SSL endpoint has the full chain of trust.

New Contributor

Anthony

Can you elaborate what you meant by your third point and what steps you took i.e SSL endpoint having a full chain of trust?

BTW, I could never get it resolved in my corporate network , however it does work in my personal network without using SSLContextService where I don't have the corporate firewall coming in between so I presumed this may have something to do with the way my company's firewall regulates HTTPS traffic.


Thanks!

PS: the error I am getting (NullPointerException somewhere at KeyStore.getInstance ) seems to indicate Nifi doesn't like that I'm not populating anything in the keystore/keystore password fields. But from what I understand, Dropbox doesn't require key authentication, so not sure why Nifi is expecting something to be there.