Skip to content

Conversation

@kumaab
Copy link
Contributor

@kumaab kumaab commented Jan 6, 2026

What changes were proposed in this pull request?

Ranger Ozone plugin installation encountered errors in the ozone-om container when instantiating audit destination for Log4J.

Below is a short snippet of logs captured from ozone-om container:

2025-07-13 20:05:16,873 [main] INFO destination.AuditDestination: AuditDestination() enter
2025-07-13 20:05:16,873 [main] INFO destination.Log4JAuditDestination: Log4JAuditDestination() called.
2025-07-13 20:05:16,874 [main] ERROR provider.AuditProviderFactory: Failed to instantiate audit destination org.apache.ranger.audit.destination.Log4JAuditDestination
java.lang.ClassCastException: class org.apache.ranger.audit.destination.Log4JAuditDestination cannot be cast to class org.apache.ranger.audit.destination.AuditDestination (org.apache.ranger.audit.destination.Log4JAuditDestination is in unnamed module of loader 'app'; org.apache.ranger.audit.destination.AuditDestination is in unnamed module of loader org.apache.ranger.plugin.classloader.RangerPluginClassLoader @56f730b2)
at org.apache.ranger.audit.provider.AuditProviderFactory.createDestination(AuditProviderFactory.java:392)
at org.apache.ranger.audit.provider.AuditProviderFactory.getProviderFromConfig(AuditProviderFactory.java:441)
at org.apache.ranger.audit.provider.AuditProviderFactory.init(AuditProviderFactory.java:186)
at org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:393)
at org.apache.ranger.authorization.ozone.authorizer.RangerOzoneAuthorizer.<init>(RangerOzoneAuthorizer.java:70)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at org.apache.ranger.authorization.ozone.authorizer.RangerOzoneAuthorizer.init(RangerOzoneAuthorizer.java:73)
at org.apache.ranger.authorization.ozone.authorizer.RangerOzoneAuthorizer.<init>(RangerOzoneAuthorizer.java:42)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
at org.apache.hadoop.ozone.security.acl.OzoneAuthorizerFactory.create(OzoneAuthorizerFactory.java:81)
at org.apache.hadoop.ozone.security.acl.OzoneAuthorizerFactory.forOM(OzoneAuthorizerFactory.java:43)
at org.apache.hadoop.ozone.om.OzoneManager.instantiateServices(OzoneManager.java:849)
at org.apache.hadoop.ozone.om.OzoneManager.<init>(OzoneManager.java:684)
at org.apache.hadoop.ozone.om.OzoneManager.createOm(OzoneManager.java:771)
at org.apache.hadoop.ozone.om.OzoneManagerStarter$OMStarterHelper.start(OzoneManagerStarter.java:189)
at org.apache.hadoop.ozone.om.OzoneManagerStarter.startOm(OzoneManagerStarter.java:86)
at org.apache.hadoop.ozone.om.OzoneManagerStarter.call(OzoneManagerStarter.java:74)
at org.apache.hadoop.hdds.cli.GenericCli.call(GenericCli.java:38)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.apache.hadoop.hdds.cli.GenericCli.execute(GenericCli.java:100)
at org.apache.hadoop.hdds.cli.GenericCli.run(GenericCli.java:91)
at org.apache.hadoop.ozone.om.OzoneManagerStarter.main(OzoneManagerStarter.java:58)
2025-07-13 20:05:16,878 [main] ERROR authorizer.RangerOzoneAuthorizer: Error Enabling RangerOzonePlugin

The patch adds support as it was a breaking change introduced in Ranger 2.7 and master.

How was this patch tested?

Tested with ozone-om container in docker. No errors seen in application logs.

@kumaab kumaab self-assigned this Jan 6, 2026
@kumaab kumaab requested a review from mneethiraj January 6, 2026 03:51
@kumaab kumaab changed the title RANGER-5248: Add log4j audit destination for Ozone in docker RANGER-5248: Disable Log4J Audit Destination for Ozone in OM container Jan 8, 2026
@kumaab kumaab merged commit f64b4b3 into apache:master Jan 8, 2026
3 of 4 checks passed
@kumaab kumaab deleted the ranger_5248 branch January 8, 2026 02:54
mneethiraj pushed a commit that referenced this pull request Jan 8, 2026
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.

2 participants