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

wangzhongwei commented on RANGER-3637:
--------------------------------------

[~kirbyzhou] I found the root reason of the NullPointerException, when 
plugins's debug opened,policy update failed,beause  auditPolicyEvaluators never 
be newed before  init(options) functions,  Swap the order of the two modules 
will fix the bug.  patch:RANGER-3637.003.patch

!image-2022-02-24-15-11-26-819.png|width=493,height=119!

 

> setpolicies failed because of NullPointerException
> --------------------------------------------------
>
>                 Key: RANGER-3637
>                 URL: https://issues.apache.org/jira/browse/RANGER-3637
>             Project: Ranger
>          Issue Type: Bug
>          Components: plugins
>    Affects Versions: 2.2.0
>         Environment: centos7 java1.8
>            Reporter: wangzhongwei
>            Priority: Major
>         Attachments: RANGER-3637.001.patch, RANGER-3637.002.patch, 
> RANGER-3637.003.patch, image-2022-02-24-15-11-26-819.png
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> when use ranger hdfs plugins ,update policies and save the policies 
> ,sometimes failed because of the NullPointerException,like the same issue as 
> RANGER-3108,but we should
> make a non-empty judgment on  all 3 
> lists:dataMaskPolicyEvaluators,rowFilterPolicyEvaluators,auditPolicyEvaluators
>  
> issue log:
> 2022-02-22 16:32:06,200 INFO 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: This policy 
> engine contains 4 policy evaluators
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: policy 
> evaluation order: 4 policies
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: policy 
> evaluation order: #1 - policy id=1; name=all - path; evalOrder=9933
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: policy 
> evaluation order: #2 - policy id=2; name=kms-audit-path; evalOrder=9944
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: policy 
> evaluation order: #3 - policy id=3; name=hbase-archive; evalOrder=9944
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: policy 
> evaluation order: #4 - policy id=5; name=test11112; evalOrder=9952
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: dataMask policy 
> evaluation order: 0 policies
> 2022-02-22 16:32:06,200 DEBUG 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository: rowFilter 
> policy evaluation order: 0 policies
> 2022-02-22 16:32:06,200 ERROR 
> org.apache.ranger.plugin.service.RangerBasePlugin: setPolicies: policy engine 
> initialization failed!  Leaving current policy engine as-is. Exception :
> java.lang.NullPointerException
>         at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.init(RangerPolicyRepository.java:991)
>         at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:229)
>         at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:180)
>         at 
> org.apache.ranger.plugin.policyengine.PolicyEngine.<init>(PolicyEngine.java:212)
>         at 
> org.apache.ranger.plugin.policyengine.RangerPolicyEngineImpl.<init>(RangerPolicyEngineImpl.java:104)
>         at 
> org.apache.ranger.plugin.service.RangerBasePlugin.setPolicies(RangerBasePlugin.java:325)
>         at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:263)
>         at 
> org.apache.ranger.plugin.util.PolicyRefresher.run(PolicyRefresher.java:209)
> @                                                                             
>              
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to