[ https://issues.apache.org/jira/browse/NIFI-12891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Sampson resolved NIFI-12891. ---------------------------------- Fix Version/s: 2.0.0 Resolution: Fixed > ElasticSearchClientService fails config verification with Nullpointer before > first enable > ----------------------------------------------------------------------------------------- > > Key: NIFI-12891 > URL: https://issues.apache.org/jira/browse/NIFI-12891 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 2.0.0 > Reporter: Bob Paulin > Priority: Minor > Fix For: 2.0.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > If a user clicks the "Verify Properties" button before the > ElasticSearchClientService Controller Service is first enabled it fails to > verify the connection. This is due to a null pointer that occurs because > both the responseEncoding and objectmapper is not set in the verify method > before the test. This gives the user the incorrect error that the connection > failed even though the connection would have succeed. > > Recommend managing these variables in the verify method. > > ``` > 2024-03-12 15:36:39,437 WARN [Verify Controller Service Config Thread-1] > o.a.n.e.ElasticSearchClientServiceImpl > ElasticSearchClientServiceImpl[id=46f88c3f-53ce-3fb6-6014-995ad23028de] > Unable to connect to Elasticsearch > org.apache.nifi.elasticsearch.ElasticsearchException: > java.lang.NullPointerException > at > org.apache.nifi.elasticsearch.ElasticSearchClientServiceImpl.parseResponse(ElasticSearchClientServiceImpl.java:566) > at > org.apache.nifi.elasticsearch.ElasticSearchClientServiceImpl.getElasticsearchRoot(ElasticSearchClientServiceImpl.java:329) > at > org.apache.nifi.elasticsearch.ElasticSearchClientServiceImpl.verifyRootConnection(ElasticSearchClientServiceImpl.java:336) > at > org.apache.nifi.elasticsearch.ElasticSearchClientServiceImpl.verify(ElasticSearchClientServiceImpl.java:243) > at > org.apache.nifi.controller.service.StandardControllerServiceNode.verifyConfiguration(StandardControllerServiceNode.java:531) > at > org.apache.nifi.web.dao.impl.StandardControllerServiceDAO.verifyConfiguration(StandardControllerServiceDAO.java:433) > 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:343) > 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:751) > 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:751) > at > org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) > at > org.apache.nifi.web.dao.impl.StandardControllerServiceDAO$$SpringCGLIB$$0.verifyConfiguration(<generated>) > at > org.apache.nifi.web.StandardNiFiServiceFacade.performControllerServiceConfigVerification(StandardNiFiServiceFacade.java:2945) > 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:343) > 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:751) > 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:751) > at > org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) > at > org.apache.nifi.web.StandardNiFiServiceFacade$$SpringCGLIB$$0.performControllerServiceConfigVerification(<generated>) > at > org.apache.nifi.web.api.ControllerServiceResource.lambda$performAsyncConfigVerification$28(ControllerServiceResource.java:1108) > at > org.apache.nifi.web.api.concurrent.AsyncRequestManager$2.run(AsyncRequestManager.java:119) > at > java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) > at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) > at > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) > at > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) > at java.base/java.lang.Thread.run(Thread.java:1583) > Caused by: java.lang.NullPointerException: null > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.base/java.lang.String.<init>(String.java:1425) > at > org.apache.nifi.elasticsearch.ElasticSearchClientServiceImpl.parseResponse(ElasticSearchClientServiceImpl.java:559) > ... 35 common frames omitted > ``` > -- This message was sent by Atlassian Jira (v8.20.10#820010)