Skip to content

ClientOpts does not always include legacy option name in error output #6501

Description

@lbschanno

Describe the bug
org.apache.accumulo.core.cli.ClientOpts does not display the argument name in its error message when a non-flag legacy argument is passed in. See the following example when the legacy argument -p is given.

~/src/accumulo-uno ⑂main* $ accumulo shell -u root -p secret
SLF4J(W): Class path contains multiple SLF4J providers.
SLF4J(W): Found provider [org.apache.logging.slf4j.SLF4JServiceProvider@1175e2db]
SLF4J(W): Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@36aa7bc2]
SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J(I): Actual provider is of type [org.apache.logging.slf4j.SLF4JServiceProvider@1175e2db]
Thread 'shell' died.
java.lang.IllegalArgumentException: The Client options: have been dropped. Use accumulo-client.properties for any connection or token options. See '-c, --config-file' option.
	at org.apache.accumulo.core.cli.ClientOpts.validateArgs(ClientOpts.java:190)
	at org.apache.accumulo.core.cli.BaseKeywordExecutable.execute(BaseKeywordExecutable.java:51)
	at org.apache.accumulo.start.Main.lambda$execKeyword$1(Main.java:116)
	at java.base/java.lang.Thread.run(Thread.java:1583)

compared to when the legacy flag option --debug is passed in:

~/src/accumulo-uno ⑂main* $ accumulo shell -u root --password secret --debug
SLF4J(W): Class path contains multiple SLF4J providers.
SLF4J(W): Found provider [org.apache.logging.slf4j.SLF4JServiceProvider@1175e2db]
SLF4J(W): Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@36aa7bc2]
SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J(I): Actual provider is of type [org.apache.logging.slf4j.SLF4JServiceProvider@1175e2db]
Thread 'shell' died.
java.lang.IllegalArgumentException: The Client options: --debug, -fake, --mock, --ssl, --saslhave been dropped. Use accumulo-client.properties for any connection or token options. See '-c, --config-file' option.
	at org.apache.accumulo.core.cli.ClientOpts.validateArgs(ClientOpts.java:195)
	at org.apache.accumulo.core.cli.BaseKeywordExecutable.execute(BaseKeywordExecutable.java:51)
	at org.apache.accumulo.start.Main.lambda$execKeyword$1(Main.java:116)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Versions (OS, Maven, Java, and others, as appropriate):

  • Affected version(s) of this project: 4.0.0-SNAPSHOT
  • OS: Ubuntu

To Reproduce
On a 4.0.0-SNAPSHOT instance, run the following command: accumulo shell -u <user> -p <password>

Expected behavior
I would expect to see -p listed in the error output. There should also be a space between --sasl and have been dropped in the error output above.

Metadata

Metadata

Assignees

Labels

bugThis issue has been verified to be a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions