You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/03/08 14:11:00 UTC

[jira] [Commented] (NIFI-8285) NullPointerException in HBase_2_ClientService if kerberos is not enabled

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

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

Commit f2a03fca2a05fc20eafe826804724a4e6d9d67e8 in nifi's branch refs/heads/main from tpalfy
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=f2a03fc ]

NIFI-8285 Prevent HBase client services to throw NPE in non-kerberized environment. (#4868)

* NIFI-8285 Prevent HBase client services to throw NPE in non-kerberized environment.

* NIFI-8285 Improve exception handling.

> NullPointerException in HBase_2_ClientService if kerberos is not enabled
> ------------------------------------------------------------------------
>
>                 Key: NIFI-8285
>                 URL: https://issues.apache.org/jira/browse/NIFI-8285
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Denes Arvay
>            Assignee: Tamas Palfy
>            Priority: Critical
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> It seems this is a regression after NIFI-7954
>  The stack trace is the following:
> {code:java}
> 2021-03-02 14:29:37,171 WARN [Timer-Driven Process Thread-5] o.a.n.controller.tasks.ConnectableTask Administratively Yielding FetchDistributedMapCache[id=5aa4b8b0-0e2a-3e83-9163-c43105d05221] due to uncaught Exception: java.lang.NullPointerException
> java.lang.NullPointerException: null
> 	at org.apache.nifi.hadoop.SecurityUtil.callWithUgi(SecurityUtil.java:149)
> 	at org.apache.nifi.hbase.HBase_2_ClientService.scan(HBase_2_ClientService.java:620)
> 	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.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87)
> 	at com.sun.proxy.$Proxy99.scan(Unknown Source)
> 	at org.apache.nifi.hbase.HBase_2_ClientMapCacheService.get(HBase_2_ClientMapCacheService.java:217)
> 	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.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87)
> 	at com.sun.proxy.$Proxy90.get(Unknown Source)
> 	at org.apache.nifi.processors.standard.FetchDistributedMapCache.onTrigger(FetchDistributedMapCache.java:230)
> 	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> 	at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)
> 	at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
> 	at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
> 	at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 	at java.lang.Thread.run(Thread.java:748)
> {code}
> I did some research on this:
> - {{HBase_2_ClientService.ugi}} is null if kerberos is not configured, see: [HBase_2_ClientService.java#L359-L382|https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_2_ClientService.java#L359-L382]
> - thus {{getUgi}} returns {{null}} at [HBase_2_ClientService.java#L582]
> - and [{{SecurityUtil.callWithUgi}}|https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/hadoop/SecurityUtil.java#L154] throws NPEx



--
This message was sent by Atlassian Jira
(v8.3.4#803005)