Skip to content

Conversation

@vyommani
Copy link
Contributor

@vyommani vyommani commented Nov 12, 2025

What changes were proposed in this pull request?

RangerBasePlugin initialization fails with an IllegalArgumentException when the ranger.plugin..policy.rest.url property is not set.
The issue occurs because getConfiguredURLs() returns an empty list, causing Random.nextInt(0) to throw an exception.

How was this patch tested?

wrote a new test TestRangerRESTClient.testPluginInit_WithNoUrl_DoesNotCrash() this will fail without fix and pass with fix.

@vyommani vyommani requested a review from rameeshm December 8, 2025 11:30
@pradeepagrawal8184 pradeepagrawal8184 merged commit 464bfd9 into apache:master Dec 31, 2025
1 check failed
vyommani added a commit to vyommani/ranger that referenced this pull request Jan 2, 2026
apache#732)

* RANGER-5397: IllegalArgumentException in RangerRESTClient when no ranger.plugin.<service>.policy.rest.url is configured

* fixed checkstyle issues.

* change the code to throw IAE if url is not set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants