[
https://issues.apache.org/jira/browse/RANGER-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Madhan Neethiraj resolved RANGER-5397.
--------------------------------------
Fix Version/s: 3.0.0
2.8.0
Resolution: Fixed
master branch:
https://github.com/apache/ranger/commit/d21032d1241b8890c5fa53455781261fa9178b04
ranger-2.8 branch:
https://github.com/apache/ranger/commit/968ec9699b28d0f8f6370e7b48e8ea0a36dda6ff
> IllegalArgumentException in RangerRESTClient when no
> ranger.plugin.<service>.policy.rest.url is configured
> ----------------------------------------------------------------------------------------------------------
>
> Key: RANGER-5397
> URL: https://issues.apache.org/jira/browse/RANGER-5397
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Affects Versions: 2.5.0, 2.6.0, 2.7.0
> Reporter: Vyom Mani Tiwari
> Assignee: Vyom Mani Tiwari
> Priority: Major
> Fix For: 3.0.0, 2.8.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> RangerBasePlugin initialization fails with an IllegalArgumentException when
> the {{ranger.plugin.<serviceType>.policy.rest.url}} property is not set.
>
> The issue occurs because {{getConfiguredURLs()}} returns an empty list,
> causing {{Random.nextInt(0)}} to throw an exception.
>
> Proposed fix: Handle the case where {{getConfiguredURLs()}} returns an empty
> list, logging a warning and setting a default value.
>
> {{int size = getConfiguredURLs().size();if (size == 0) {LOG.warn("No policy
> REST URL configured for service '{}'",
> serviceType);setLastKnownActiveUrlIndex(0);} else
> {setLastKnownActiveUrlIndex(new Random().nextInt(size));}}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)