candlerb opened a new issue #5533: Missing CLI error handling in pulsar-admin
URL: https://github.com/apache/pulsar/issues/5533
**Describe the bug**
pulsar-admin can raise Java exceptions in certain conditions
**To Reproduce**
(1) Giving an invalid command - e.g. "functions getstate" (should be "functions querystate"),
with or without `--help` added
```
$ apache-pulsar-2.4.1/bin/pulsar-admin functions getstate
Expected a command, got getstate
Exception in thread "main" com.beust.jcommander.ParameterException: Asking description
for unknown command: null
at com.beust.jcommander.JCommander.getCommandDescription(JCommander.java:1003)
at com.beust.jcommander.JCommander.usage(JCommander.java:988)
at com.beust.jcommander.JCommander.usage(JCommander.java:980)
at com.beust.jcommander.JCommander.usage(JCommander.java:972)
at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:49)
at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:218)
at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:260)
```
(Hangs here, have to press `^C`)
(2) Giving a querystate command without the "--key" option
```
$ apache-pulsar-2.4.1/bin/pulsar-admin functions querystate --name womble
null
Reason: java.lang.NullPointerException: path is 'null'.
```
tcpdump shows no traffic on port 8080, so this appears to be a local CLI issue.
**Expected behavior**
Error message to be reported
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
|