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 connect mistakenly uses port 443 if the --join flag did not provide a port number #61620

Closed
knz opened this issue Mar 8, 2021 · 0 comments · Fixed by #65014
Closed
Labels
A-cli-admin CLI commands that pertain to controlling and configuring nodes A-security 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.

Comments

@knz
Copy link
Contributor

knz commented Mar 8, 2021

The following command:

cockroach connect --num-expected-initial-nodes 2   --init-token abc   --join=192.168.2.10

Fails with

W210308 14:59:03.705454 39 1@server/init_handshake.go:389  [connect,init-tls-handshake,peer=192.168.2.10:] 1  peer CA retrieval error: Post
"https://192.168.2.10/trustInit/
": dial tcp 192.168.2.10:443: connect: connection refused
W210308 14:59:03.705769 1 1@server/init_handshake.go:546  [connect,init-tls-handshake] 2  error from client when connecting to peers (retrying): Post
"https://192.168.2.10/
trustInit/": dial tcp 192.168.2.10:443: connect: connection refused

Notice: the connect command tries to use port 443, whereas the other side was listening on the default RPC port, 26257.

Related to #60632

cc @itsbilal @aaron-crl

Epic: CRDB-6663

@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. A-cli A-security labels Mar 8, 2021
@knz knz added A-cli-admin CLI commands that pertain to controlling and configuring nodes and removed A-cli labels Mar 20, 2021
rauchenstein added a commit to rauchenstein/cockroach that referenced this issue May 11, 2021
This behavior existed for "start --join" but not for "connect --join".
(Our code didn't set a default, so it defaulted to port 443 for https.)
The change is implemented at the level of flag parsing, so it is now
uniform for all commands using the join flag.

Fixes cockroachdb#61620.

Release note (bug fix): Hosts listed with the "connect --join" command
line flag now default to port 26257 (was 443).  This matches the
existing behavior of "start --join".
craig bot pushed a commit that referenced this issue May 12, 2021
65014: cli: default "--join" flag port to 26257 r=rauchenstein a=rauchenstein

This behavior existed for "start --join" but not for "connect --join".
(Our code didn't set a default, so it defaulted to port 443 for https.)
The change is implemented at the level of flag parsing, so it is now
uniform for all commands using the join flag.

Fixes #61620.

Release note (bug fix): Hosts listed with the "connect --join" command
line flag now default to port 26257 (was 443).  This matches the
existing behavior of "start --join".

Co-authored-by: Jay Rauchenstein <rauchenstein@cockroachlabs.com>
@craig craig bot closed this as completed in 96880bc May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-admin CLI commands that pertain to controlling and configuring nodes A-security 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

Successfully merging a pull request may close this issue.

1 participant