Oliverwqcwrw opened a new issue, #4647:
URL: https://github.com/apache/rocketmq/issues/4647
**BUG REPORT**
1. Please describe the issue you observed:
- What did you do (The steps to reproduce)?
when i exec `./bin/mqadmin updateAclConfig -n 192.168.137.73:9876 -c
DefaultCluster -a test-acl -w 192.168.137.73`
then return
>
org.apache.rocketmq.tools.command.SubCommandException:
UpdateAccessConfigSubCommand command failed
at
org.apache.rocketmq.tools.command.acl.UpdateAccessConfigSubCommand.execute(UpdateAccessConfigSubCommand.java:180)
at
org.apache.rocketmq.tools.command.MQAdminStartup.main0(MQAdminStartup.java:149)
at
org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:100)
Caused by: org.apache.rocketmq.client.exception.MQClientException:
CODE: 209 DESC: The accessKey=test-acl and secretKey=null cannot be null and
length should longer than 6
For more information, please visit the url,
http://rocketmq.apache.org/docs/faq/
at
org.apache.rocketmq.client.impl.MQClientAPIImpl.createPlainAccessConfig(MQClientAPIImpl.java:335)
at
org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.createAndUpdatePlainAccessConfig(DefaultMQAdminExtImpl.java:206)
at
org.apache.rocketmq.tools.admin.DefaultMQAdminExt.createAndUpdatePlainAccessConfig(DefaultMQAdminExt.java:176)
at
org.apache.rocketmq.tools.command.acl.UpdateAccessConfigSubCommand.execute(UpdateAccessConfigSubCommand.java:170)
I noticed secretKey is not necessary
>
opt = new Option("s", "secretKey", true, "set secretKey in acl config
file");
opt.setRequired(false);
options.addOption(opt);
but In
`org.apache.rocketmq.acl.plain.PlainPermissionManager#checkPlainAccessConfig`
is checked
>
public void checkPlainAccessConfig(PlainAccessConfig plainAccessConfig)
throws AclException {
if (plainAccessConfig.getAccessKey() == null
|| plainAccessConfig.getSecretKey() == null
|| plainAccessConfig.getAccessKey().length() <=
AclConstants.ACCESS_KEY_MIN_LENGTH
|| plainAccessConfig.getSecretKey().length() <=
AclConstants.SECRET_KEY_MIN_LENGTH) {
throw new AclException(String.format(
"The accessKey=%s and secretKey=%s cannot be null and length
should longer than 6",
plainAccessConfig.getAccessKey(),
plainAccessConfig.getSecretKey()));
}
}
- What is expected to see?
the two place is consistent
- What did you see instead?
is not consistent
2. Please tell us about your environment:
4.9.4
4. Other information (e.g. detailed explanation, logs, related issues,
suggestions on how to fix, etc):
I suggest modify to below
>
opt = new Option("s", "secretKey", true, "set secretKey in acl config
file");
opt.setRequired(true);
options.addOption(opt);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]