Andrew Wong created RANGER-3108:
-----------------------------------

             Summary: 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


Over the past few days, Kudu's {{RangerClientTestBase.TestLogging}} has failed 
consistently when trying to access the Ranger plugin with unreleased bits from 
CDP 7.2.7 that appear to be 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.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:326)
 ~[kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.policyengine.RangerPolicyRepository.<init>(RangerPolicyRepository.java:277)
 ~[kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.policyengine.PolicyEngine.<init>(PolicyEngine.java:195)
 ~[kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.policyengine.RangerPolicyEngineImpl.<init>(RangerPolicyEngineImpl.java:82)
 ~[kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.service.RangerBasePlugin.setPolicies(RangerBasePlugin.java:246)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:260)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:142)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:185)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.kudu.subprocess.ranger.authorization.RangerKuduAuthorizer.init(RangerKuduAuthorizer.java:90)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.kudu.subprocess.ranger.RangerProtocolHandler.<init>(RangerProtocolHandler.java:45)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-SNAPSHOT]
        at 
org.apache.kudu.subprocess.ranger.RangerSubprocessMain.main(RangerSubprocessMain.java:39)
 [kudu-subprocess.jar:1.13.0.7.2.7.0-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.3.4#803005)

Reply via email to