Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] start faild when acl2.0 authentication enabled #8613

Closed
3 tasks done
kingkh1995 opened this issue Aug 30, 2024 · 0 comments · Fixed by #8614
Closed
3 tasks done

[Bug] start faild when acl2.0 authentication enabled #8613

kingkh1995 opened this issue Aug 30, 2024 · 0 comments · Fixed by #8614

Comments

@kingkh1995
Copy link
Contributor

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

windows11

RocketMQ version

develop

JDK Version

jdk8

Describe the Bug

AuthorizationFactory

public static AuthorizationStrategy getStrategy(AuthConfig config, Supplier<?> metadataService) {
try {
Class<? extends AuthorizationStrategy> clazz = StatelessAuthorizationStrategy.class;
if (StringUtils.isNotBlank(config.getAuthenticationStrategy())) { // wrong
clazz = (Class<? extends AuthorizationStrategy>) Class.forName(config.getAuthorizationStrategy());
}
return clazz.getDeclaredConstructor(AuthConfig.class, Supplier.class).newInstance(config, metadataService);
} catch (Exception e) {
throw new RuntimeException(e);
}
}

Steps to Reproduce

broker.conf

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

authenticationEnabled = true
authenticationProvider = org.apache.rocketmq.auth.authentication.provider.DefaultAuthenticationProvider
initAuthenticationUser = {"username":"rocketmq","password":"12345678"}
innerClientAuthenticationCredentials = {"accessKey":"rocketmq","secretKey":"12345678"}
authenticationMetadataProvider = org.apache.rocketmq.auth.authentication.provider.LocalAuthenticationMetadataProvider
authenticationStrategy = org.apache.rocketmq.auth.authentication.strategy.StatefulAuthenticationStrategy

What Did You Expect to See?

start success

What Did You See Instead?

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.rocketmq.broker.BrokerController.initialRequestPipeline(BrokerController.java:1064)
at org.apache.rocketmq.broker.BrokerController.recoverAndInitService(BrokerController.java:882)
at org.apache.rocketmq.broker.BrokerController.initialize(BrokerController.java:834)
at org.apache.rocketmq.broker.BrokerStartup.createBrokerController(BrokerStartup.java:248)
at org.apache.rocketmq.proxy.ProxyStartup.createBrokerController(ProxyStartup.java:230)
at org.apache.rocketmq.proxy.ProxyStartup.createMessagingProcessor(ProxyStartup.java:188)
at org.apache.rocketmq.proxy.ProxyStartup.main(ProxyStartup.java:79)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getStrategy(AuthorizationFactory.java:113)
at org.apache.rocketmq.auth.authorization.AuthorizationEvaluator.(AuthorizationEvaluator.java:36)
at org.apache.rocketmq.auth.authorization.AuthorizationEvaluator.(AuthorizationEvaluator.java:32)
at org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.lambda$getEvaluator$2(AuthorizationFactory.java:97)
at org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.computeIfAbsent(AuthorizationFactory.java:147)
at org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getEvaluator(AuthorizationFactory.java:97)
at org.apache.rocketmq.broker.auth.pipeline.AuthorizationPipeline.(AuthorizationPipeline.java:43)
at org.apache.rocketmq.broker.BrokerController.initialRequestPipeline(BrokerController.java:1060)
... 6 more
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.rocketmq.auth.authorization.factory.AuthorizationFactory.getStrategy(AuthorizationFactory.java:109)
... 13 more

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant