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

cli: cockroach init lack of argument validation leads to confusing error message #24628

Closed
rmloveland opened this issue Apr 10, 2018 · 2 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Milestone

Comments

@rmloveland
Copy link
Collaborator

rmloveland commented Apr 10, 2018

FEATURE REQUEST

  1. Does an issue already exist addressing this request? If yes, please add a 👍 reaction to the existing issue. If not, move on to step 2.

I did not find anything via 'cli is:open'

  1. Please describe the feature you are requesting, as well as your proposed use case for this feature.
  1. cockroach start --join accepts hosts in the format host:port
  2. cockroach init requires separate --host and --port arguments, which would be slightly odd but fine, except that
  3. If you assume (based on your experience with cockroach start) that the incorrect cockroach init --host=localhost:12345 will work, it doesn't give you an invalid argument error and exit, it (apparently?) passes the bad arg through and you get a networking error (pasted below). I spent waaaaay too much time scratching my head before realizing that this was due to a bad argument and not something "network-y" on my machine. This is especially confusing because (a) I'm not a networking expert, and (b) the error message is talking about RPCs and credentials and such.

The feature request is that cockroach init validate its arguments and print an error message and exit instead of the current behavior.

Error message for incorrect --host arg to cockroach init:

/Users/rloveland/bin/cockroach init --insecure --host=localhost:26500

E180410 12:45:12.324448 1 cli/error.go:109  unable to connect or connection lost.

Please check the address and credentials such as certificates (if attempting to
communicate with a secure cluster).

initial connection heartbeat failed: rpc error: code = Unavailable desc = all SubConns are in TransientFailure
Error: unable to connect or connection lost.

Please check the address and credentials such as certificates (if attempting to
communicate with a secure cluster).

initial connection heartbeat failed: rpc error: code = Unavailable desc = all SubConns are in TransientFailure
Failed running "init"
@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. labels Apr 10, 2018
@knz knz added this to the 2.1 milestone Apr 10, 2018
@knz
Copy link
Contributor

knz commented Apr 10, 2018

cc @bdarnell for triage

@bdarnell
Copy link
Contributor

init is like all the other client commands in this respect, so this is a duplicate of #23277.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Projects
None yet
Development

No branches or pull requests

3 participants