Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-4295

When selecting a controller service for a processor, services that belong to the wrong scope are shown

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.0
    • 1.4.0
    • Core Framework
    • None

    Description

      I have a Process Group, and in that Process Group I have defined a Controller Service. If I then move up to the root group and add a Processor, that takes a Controller Service of that type, I can now choose the Controller Service that is defined in a child group. When I do so, my processor becomes invalid and the reason given for the processor to be invalid is a NullPointer:

      2017-08-14 12:38:24,016 WARN [NiFi Web Server-76] o.a.n.controller.StandardProcessorNode Failed during validation
      java.lang.NullPointerException: null
      	at org.apache.nifi.processor.StandardValidationContext.isValidationRequired(StandardValidationContext.java:143)
      	at org.apache.nifi.components.PropertyDescriptor.validate(PropertyDescriptor.java:150)
      	at org.apache.nifi.components.AbstractConfigurableComponent.validate(AbstractConfigurableComponent.java:103)
      	at org.apache.nifi.controller.AbstractConfiguredComponent.validate(AbstractConfiguredComponent.java:329)
      	at org.apache.nifi.controller.StandardProcessorNode.isValid(StandardProcessorNode.java:968)
      	at org.apache.nifi.controller.FlowController.getProcessorStatus(FlowController.java:2964)
      	at org.apache.nifi.controller.FlowController.getGroupStatus(FlowController.java:2559)
      	at org.apache.nifi.controller.FlowController.getGroupStatus(FlowController.java:2518)
      	at org.apache.nifi.controller.FlowController.getGroupStatus(FlowController.java:2485)
      	at org.apache.nifi.web.controller.ControllerFacade.getProcessGroupStatus(ControllerFacade.java:599)
      	at org.apache.nifi.web.controller.ControllerFacade$$FastClassBySpringCGLIB$$5a42ba54.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
      	at org.apache.nifi.web.controller.ControllerFacade$$EnhancerBySpringCGLIB$$344e3ba2.getProcessGroupStatus(<generated>)
      	at org.apache.nifi.web.StandardNiFiServiceFacade.getProcessGroupFlow(StandardNiFiServiceFacade.java:3054)
      	at org.apache.nifi.web.StandardNiFiServiceFacade$$FastClassBySpringCGLIB$$358780e0.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
      	at org.apache.nifi.web.NiFiServiceFacadeLock.proceedWithReadLock(NiFiServiceFacadeLock.java:137)
      	at org.apache.nifi.web.NiFiServiceFacadeLock.getLock(NiFiServiceFacadeLock.java:108)
      	at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
      	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
      	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
      	at org.apache.nifi.web.StandardNiFiServiceFacade$$EnhancerBySpringCGLIB$$c5bfd05e.getProcessGroupFlow(<generated>)
      	at org.apache.nifi.web.api.FlowResource.getFlow(FlowResource.java:349)
      	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:497)
      	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
      	at org.apache.nifi.web.filter.RequestLogger.doFilter(RequestLogger.java:66)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1621)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.authenticate(NiFiAuthenticationFilter.java:83)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.doFilter(NiFiAuthenticationFilter.java:57)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.authenticate(NiFiAuthenticationFilter.java:83)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.doFilter(NiFiAuthenticationFilter.java:57)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.authenticate(NiFiAuthenticationFilter.java:83)
      	at org.apache.nifi.web.security.NiFiAuthenticationFilter.doFilter(NiFiAuthenticationFilter.java:57)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
      	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
      	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
      	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1621)
      	at org.apache.nifi.web.filter.TimerFilter.doFilter(TimerFilter.java:51)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1613)
      	at org.apache.nifi.web.server.JettyServer$2.doFilter(JettyServer.java:910)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1621)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:541)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1593)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1239)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:481)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1562)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1141)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:118)
      	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:561)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:564)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            githubbot ASF GitHub Bot added a comment -

            GitHub user markap14 opened a pull request:

            https://github.com/apache/nifi/pull/2087

            NIFI-4295: When determining which controller services to return for a…

            … component, ensure that we don't show services that belong to 'child groups'

            Thank you for submitting a contribution to Apache NiFi.

            In order to streamline the review of the contribution we ask you
            to ensure the following steps have been taken:

                1. For all changes:
            • [ ] Is there a JIRA ticket associated with this PR? Is it referenced
              in the commit message?
            • [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
            • [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
            • [ ] Is your initial contribution a single, squashed commit?
                1. For code changes:
            • [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
            • [ ] Have you written or updated unit tests to verify your changes?
            • [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
            • [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
            • [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
            • [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
                1. For documentation related changes:
            • [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
                1. Note:
                  Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

            You can merge this pull request into a Git repository by running:

            $ git pull https://github.com/markap14/nifi NIFI-4295

            Alternatively you can review and apply these changes as the patch at:

            https://github.com/apache/nifi/pull/2087.patch

            To close this pull request, make a commit to your master/trunk branch
            with (at least) the following in the commit message:

            This closes #2087


            commit fd9d71dbf412746de2cc36ddb91c59b05f8b4134
            Author: Mark Payne <markap14@hotmail.com>
            Date: 2017-08-15T16:48:30Z

            NIFI-4295: When determining which controller services to return for a component, ensure that we don't show services that belong to 'child groups'


            githubbot ASF GitHub Bot added a comment - GitHub user markap14 opened a pull request: https://github.com/apache/nifi/pull/2087 NIFI-4295 : When determining which controller services to return for a… … component, ensure that we don't show services that belong to 'child groups' Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: For all changes: [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. [ ] Has your PR been rebased against the latest commit within the target branch (typically master)? [ ] Is your initial contribution a single, squashed commit? For code changes: [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? [ ] Have you written or updated unit tests to verify your changes? [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0] ( http://www.apache.org/legal/resolved.html#category-a)? [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? For documentation related changes: [ ] Have you ensured that format looks appropriate for the output in which it is rendered? Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/markap14/nifi NIFI-4295 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2087.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2087 commit fd9d71dbf412746de2cc36ddb91c59b05f8b4134 Author: Mark Payne <markap14@hotmail.com> Date: 2017-08-15T16:48:30Z NIFI-4295 : When determining which controller services to return for a component, ensure that we don't show services that belong to 'child groups'
            githubbot ASF GitHub Bot added a comment -

            Github user mcgilman commented on the issue:

            https://github.com/apache/nifi/pull/2087

            Will review...

            githubbot ASF GitHub Bot added a comment - Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2087 Will review...
            githubbot ASF GitHub Bot added a comment -

            Github user mcgilman commented on the issue:

            https://github.com/apache/nifi/pull/2087

            @markap14 It appears the changes introduced are causing some test failures.

            ```
            Failed tests:
            TestStandardControllerServiceProvider.validateEnableServices:506 null
            TestStandardControllerServiceProvider.validateEnableServices2:554 null
            TestStandardControllerServiceProvider.validateEnableServicesWithDisabledMissingService:614 null

            Tests in error:
            TestStandardProcessScheduler.testDisableControllerServiceWithProcessorTryingToStartUsingIt:207 » IllegalState
            TestStandardControllerServiceProvider.testConcurrencyWithEnablingReferencingServicesGraph:217->testEnableReferencingServicesGraph:261 » IllegalState
            TestStandardControllerServiceProvider.testEnableDisableWithReference:183 » IllegalState
            ```

            githubbot ASF GitHub Bot added a comment - Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2087 @markap14 It appears the changes introduced are causing some test failures. ``` Failed tests: TestStandardControllerServiceProvider.validateEnableServices:506 null TestStandardControllerServiceProvider.validateEnableServices2:554 null TestStandardControllerServiceProvider.validateEnableServicesWithDisabledMissingService:614 null Tests in error: TestStandardProcessScheduler.testDisableControllerServiceWithProcessorTryingToStartUsingIt:207 » IllegalState TestStandardControllerServiceProvider.testConcurrencyWithEnablingReferencingServicesGraph:217->testEnableReferencingServicesGraph:261 » IllegalState TestStandardControllerServiceProvider.testEnableDisableWithReference:183 » IllegalState ```
            githubbot ASF GitHub Bot added a comment -

            Github user markap14 commented on the issue:

            https://github.com/apache/nifi/pull/2087

            @mcgilman wow! Sorry about that. Pushed a new commit to address.

            githubbot ASF GitHub Bot added a comment - Github user markap14 commented on the issue: https://github.com/apache/nifi/pull/2087 @mcgilman wow! Sorry about that. Pushed a new commit to address.

            Commit 69a08e78c2cd47661e3d775ceece94ae82ac567e in nifi's branch refs/heads/master from markap14
            [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=69a08e7 ]

            NIFI-4295:

            • When determining which controller services to return for a component, ensure that we don't show services that belong to 'child groups'
            • Fixed a logic bug that determined which process group to use for obtaining controller services
            • This closes #2087
            jira-bot ASF subversion and git services added a comment - Commit 69a08e78c2cd47661e3d775ceece94ae82ac567e in nifi's branch refs/heads/master from markap14 [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=69a08e7 ] NIFI-4295 : When determining which controller services to return for a component, ensure that we don't show services that belong to 'child groups' Fixed a logic bug that determined which process group to use for obtaining controller services This closes #2087
            githubbot ASF GitHub Bot added a comment -

            Github user asfgit closed the pull request at:

            https://github.com/apache/nifi/pull/2087

            githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/2087
            githubbot ASF GitHub Bot added a comment -

            Github user mcgilman commented on the issue:

            https://github.com/apache/nifi/pull/2087

            Thanks @markap14! This has been merged to master.

            githubbot ASF GitHub Bot added a comment - Github user mcgilman commented on the issue: https://github.com/apache/nifi/pull/2087 Thanks @markap14! This has been merged to master.

            People

              markap14 Mark Payne
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: