Skip to content

RANGER-5397: IllegalArgumentException in RangerRESTClient when no ran…#732

Merged
pradeepagrawal8184 merged 3 commits intoapache:masterfrom
vyommani:RANGER-5397
Dec 31, 2025
Merged

RANGER-5397: IllegalArgumentException in RangerRESTClient when no ran…#732
pradeepagrawal8184 merged 3 commits intoapache:masterfrom
vyommani:RANGER-5397

Conversation

@vyommani
Copy link
Copy Markdown
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.

Comment thread agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java Outdated
@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.
bhaveshamre pushed a commit to bhaveshamre/ranger that referenced this pull request Jan 22, 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