[ 
https://issues.apache.org/jira/browse/NIFI-14935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018602#comment-18018602
 ] 

ASF subversion and git services commented on NIFI-14935:
--------------------------------------------------------

Commit c00502adfb1c4dbac5ce4ce205e888420e0bb6df in nifi's branch 
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=c00502adfb ]

NIFI-14935 Improved handling of a Parameter referencing a Controller Service 
(#10265)

Signed-off-by: David Handermann <[email protected]>

> Trying to commit processor flow to registry fails out with null pointer 
> exception when Reference Parameter is empty
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-14935
>                 URL: https://issues.apache.org/jira/browse/NIFI-14935
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Flow Versioning
>    Affects Versions: 2.0.0
>         Environment: All
>            Reporter: Craig Patrick
>            Assignee: Pierre Villard
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When trying to commit a process flow to registry, if the parameter context 
> being used contains a reference parameter to a service - and the parameter is 
> empty or null - the process fails with an unknown error in the UI and a "null 
> pointer exception" in the logs.
> Use case:
> a process flow which has an invokeHttp processor in it, which uses a 
> `{{{}Reference Parameter{}}}` to an SSL service to allow https connections. 
> If this parameter is empty / null, ANY processors using the same context will 
> not be committed to the registry due to this "unable to find componentId" 
> issue. This is a full stack trace:
> {code:java}
> 2025-09-03 14:14:37,537 ERROR [NiFi Web Server-976] 
> o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: 
> java.lang.NullPointerException: Cannot invoke 
> "String.getBytes(java.nio.charset.Charset)" because "componentId" is null. 
> Returning Internal Server Error response.java.lang.NullPointerException: 
> Cannot invoke "String.getBytes(java.nio.charset.Charset)" because 
> "componentId" is null       at 
> org.apache.nifi.registry.flow.mapping.ComponentIdLookup.lambda$static$0(ComponentIdLookup.java:26)
>    at 
> org.apache.nifi.registry.flow.mapping.ComponentIdLookup$1.getComponentId(ComponentIdLookup.java:54)
>   at 
> org.apache.nifi.registry.flow.mapping.ComponentIdLookup.getComponentId(ComponentIdLookup.java:35)
>     at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.getId(NiFiRegistryFlowMapper.java:314)
>   at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.mapParameter(NiFiRegistryFlowMapper.java:928)
>    at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.lambda$mapParameters$14(NiFiRegistryFlowMapper.java:906)
>         at 
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
>   at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)     at 
> java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
>         at 
> java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
>       at 
> java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
>        at 
> java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
>  at 
> java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>       at 
> java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
>      at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.mapParameters(NiFiRegistryFlowMapper.java:911)
>   at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.mapParameterContext(NiFiRegistryFlowMapper.java:886)
>     at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.mapParameterContexts(NiFiRegistryFlowMapper.java:868)
>    at 
> org.apache.nifi.registry.flow.mapping.NiFiRegistryFlowMapper.mapParameterContexts(NiFiRegistryFlowMapper.java:859)
>    at 
> org.apache.nifi.web.StandardNiFiServiceFacade.createVersionedParameterContexts(StandardNiFiServiceFacade.java:5452)
>   at 
> org.apache.nifi.web.StandardNiFiServiceFacade.registerFlowWithFlowRegistry(StandardNiFiServiceFacade.java:5141)
>       at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)   at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:355)
>    at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
>     at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
>     at 
> org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
>         at 
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
>      at 
> org.apache.nifi.web.NiFiServiceFacadeLock.proceedWithReadLock(NiFiServiceFacadeLock.java:161)
>         at 
> org.apache.nifi.web.NiFiServiceFacadeLock.registerLock(NiFiServiceFacadeLock.java:144)
>        at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)   at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)
>         at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)
>      at 
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
>     at 
> org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
>         at 
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
>   at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
>     at 
> org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
>         at 
> org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
>   at 
> org.apache.nifi.web.StandardNiFiServiceFacade$$SpringCGLIB$$0.registerFlowWithFlowRegistry(<generated>)
>       at 
> org.apache.nifi.web.api.VersionsResource.lambda$saveToFlowRegistry$10(VersionsResource.java:608)
>      at 
> org.apache.nifi.web.api.ApplicationResource.withWriteLock(ApplicationResource.java:575)
>       at 
> org.apache.nifi.web.api.VersionsResource.saveToFlowRegistry(VersionsResource.java:585)
>        at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)   at 
> org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
>     at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
>  at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
>         at 
> org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
>  at 
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
>        at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
>        at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
>         at 
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
>  at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:274)   
>    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) at 
> org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) at 
> org.glassfish.jersey.internal.Errors.process(Errors.java:292)        at 
> org.glassfish.jersey.internal.Errors.process(Errors.java:274)        at 
> org.glassfish.jersey.internal.Errors.process(Errors.java:244)        at 
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
>  at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:253) 
>    at 
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:696)
>    at 
> org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:397) 
> at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:349)   
>   at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
>      at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
>      at 
> org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
>      at 
> org.eclipse.jetty.ee10.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1379)
>        at 
> org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
>     at 
> org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231)
>        at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365)
>      at 
> org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)
>  at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
>      at 
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
>      at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.apache.nifi.web.security.log.AuthenticationUserFilter.doFilterInternal(AuthenticationUserFilter.java:57)
>  at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
>        at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:145)
>     at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.apache.nifi.web.security.NiFiAuthenticationFilter.authenticate(NiFiAuthenticationFilter.java:94)
>  at 
> org.apache.nifi.web.security.NiFiAuthenticationFilter.doFilter(NiFiAuthenticationFilter.java:56)
>      at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.apache.nifi.web.security.csrf.CsrfCookieFilter.doFilterInternal(CsrfCookieFilter.java:43)
>         at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:131)
>        at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.apache.nifi.web.security.csrf.SkipReplicatedCsrfFilter.doFilterInternal(SkipReplicatedCsrfFilter.java:59)
>         at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62)
>    at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
>      at 
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233)
>         at 
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191)
>         at 
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:362)
>   at 
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:278)
>         at 
> org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
>        at 
> org.apache.nifi.web.filter.ExceptionFilter.doFilter(ExceptionFilter.java:44) 
> at 
> org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:208)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
>        at 
> org.eclipse.jetty.ee10.servlets.DoSFilter.doFilterChain(DoSFilter.java:462)  
> at 
> org.apache.nifi.web.server.filter.DataTransferExcludedDoSFilter.doFilterChain(DataTransferExcludedDoSFilter.java:51)
>  at org.eclipse.jetty.ee10.servlets.DoSFilter.doFilter(DoSFilter.java:317)    
>    at org.eclipse.jetty.ee10.servlets.DoSFilter.doFilter(DoSFilter.java:282)  
>      at 
> org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
>        at 
> org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
>         at 
> org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
>       at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
>        at 
> org.apache.nifi.web.server.log.RequestAuthenticationFilter.doFilterInternal(RequestAuthenticationFilter.java:59)
>      at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
>   at 
> org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)  
> at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
>        at 
> org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
>  at 
> org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:824)
>       at 
> org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436) 
>        at 
> org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464) 
>        at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)  
> at 
> org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717) 
>        at 
> org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
>      at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:181)
>   at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:181)
>   at org.eclipse.jetty.server.Server.handle(Server.java:182)      at 
> org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
>      at 
> org.eclipse.jetty.util.thread.Invocable$ReadyTask.run(Invocable.java:105)    
> at 
> org.eclipse.jetty.http2.server.internal.HttpStreamOverHTTP2$1.run(HttpStreamOverHTTP2.java:135)
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
>      at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
>    at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
>         at java.base/java.lang.Thread.run(Thread.java:1583){code}
> I will be submitting an additional ticket for further issue regarding use of 
> Reference Parameter



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to