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

Dapeng Sun commented on SENTRY-1184:
------------------------------------

Hi [~sravya], the {{java.lang.NullPointerException}} is occurred at [571 for 
(Entry e : eSet) 
{|https://github.com/cloudera/sentry/blob/cdh5-1.5.1_5.5.2/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java#L571].
I found {{deletePathsFromAuthzObject(oldName, pathElemsAsList);}} at line 560 
and {{addPathsToAuthzObject(oldName, pathElemsAsList);}} at line 565 are both 
checked {{if (entries != null) {}}.

And according the code, if  {{if (isUnderPrefix(newPath)}} at line 566 is true, 
the {{eSet}} shouldn't be null. I guess it may be happened at the rename 
operation of {{NotUnderPrefix path}}(external table?). And we may also have a 
check at the value of property 
{{sentry.authorization-provider.hdfs-path-prefixes}}.

I will also upload a simple patch to fix it.

> NPE in HMSPaths#renameAuthzObject
> ---------------------------------
>
>                 Key: SENTRY-1184
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1184
>             Project: Sentry
>          Issue Type: Bug
>            Reporter: Sravya Tirukkovalur
>            Assignee: Sravya Tirukkovalur
>
> java.lang.NullPointerException
> at org.apache.sentry.hdfs.HMSPaths.renameAuthzObject(HMSPaths.java:571)
> at 
> org.apache.sentry.hdfs.UpdateableAuthzPaths.applyPartialUpdate(UpdateableAuthzPaths.java:106)
> at 
> org.apache.sentry.hdfs.UpdateableAuthzPaths.updatePartial(UpdateableAuthzPaths.java:75)
> at 
> org.apache.sentry.hdfs.SentryAuthorizationInfo.processUpdates(SentryAuthorizationInfo.java:174)
> at 
> org.apache.sentry.hdfs.SentryAuthorizationInfo.update(SentryAuthorizationInfo.java:131)
> at 
> org.apache.sentry.hdfs.SentryAuthorizationInfo.run(SentryAuthorizationInfo.java:193)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to