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

Yi kaifei commented on RANGER-3108:
-----------------------------------

[~rmani] Shall we cherry-pick this patch to version 2.3.0 ? Currently, we use 
logback instead of log4j, it default log level is debug, this NPE is easy to 
trigger

> NPE in RangerPolicyRepository.init
> ----------------------------------
>
>                 Key: RANGER-3108
>                 URL: https://issues.apache.org/jira/browse/RANGER-3108
>             Project: Ranger
>          Issue Type: Bug
>          Components: plugins
>    Affects Versions: 2.2.0
>            Reporter: Andrew Wong
>            Assignee: Ramesh Mani
>            Priority: Critical
>             Fix For: 3.0.0
>
>         Attachments: 
> 0001-RANGER-3108-NPE-in-RangerPolicyRepository.init.patch, 
> ranger_client-test.txt
>
>
> Over the past few days, Kudu's {{RangerClientTestBase.TestLogging}} has 
> failed consistently when trying to access the Ranger plugin with unreleased 
> bits that are aligned with Ranger's {{master}} branch, at least from the 
> stack trace line numbers.
> {code:java}
> 2020-12-03 23:59:46.333 [ERROR - main] (RangerBasePlugin.java:309) 
> setPolicies: policy engine initialization failed!  Leaving current policy 
> engine as-is. Exception : 
> java.lang.NullPointerException: null
>       at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.init(RangerPolicyRepository.java:1075)
>  ~[kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:326)
>  ~[kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:277)
>  ~[kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.policyengine.PolicyEngine.<init>(PolicyEngine.java:195)
>  ~[kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.policyengine.RangerPolicyEngineImpl.<init>(RangerPolicyEngineImpl.java:82)
>  ~[kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.service.RangerBasePlugin.setPolicies(RangerBasePlugin.java:246)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:260)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:142)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:185)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.kudu.subprocess.ranger.authorization.RangerKuduAuthorizer.init(RangerKuduAuthorizer.java:90)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.kudu.subprocess.ranger.RangerProtocolHandler.<init>(RangerProtocolHandler.java:45)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
>       at 
> org.apache.kudu.subprocess.ranger.RangerSubprocessMain.main(RangerSubprocessMain.java:39)
>  [kudu-subprocess.jar:1.13.0.internal-version-SNAPSHOT]
> {code}
> Poking around the codebase a bit, it seems like the line in question was 
> [added 
> recently|https://github.com/apache/ranger/blame/master/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java#L1075]
>  (6 days ago as of writing this), while the Ranger code Kudu-side hasn't been 
> touched recently at all, leading me to suspect this being a Ranger plugin 
> issue rather than improper use of the plugin on our end.
> The failing Kudu test can be found 
> [here|https://github.com/apache/kudu/blob/master/src/kudu/ranger/ranger_client-test.cc#L405].
>  The gist of the test is that it starts a Ranger server, creates a simple 
> policy, and tries to authorize some requests by sending requests over a named 
> pipe to a Java process that runs a long-lived Ranger plugin (the first of 
> which fails, presumably because of this NPE).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to