cockroach start with --join that only has IPv6 addrs using [ ... ] notation fails
Describe the problem
cockroach start with --join that only has IPv6 addrs using [ ... ] notation fails
To Reproduce *** node 1:
/usr/bin/cockroach start --certs-dir=/var/lib/cockroach/certs --listen-addr=[2607:a600:124:755c::15] --join=[2607:a600:124:755c::15],[2607:a600:124:755c::16],[2607:a600:124:755c::17]
/usr/bin/cockroach init --certs-dir=/var/lib/cockroach/certs [2607:a600:124:755c::15]
Output Node1:
*
* INFO: initial startup completed.
* Node will now attempt to join a running cluster, or wait for `cockroach init`.
* Client connections will be accepted after this completes successfully.
* Check the log file(s) for progress.
*
*
* WARNING: The server appears to be unable to contact the other nodes in the cluster. Please try:
*
* - starting the other nodes, if you haven't already;
* - double-checking that the '--join' and '--listen'/'--advertise' flags are set up correctly;
* - running the 'cockroach init' command if you are trying to initialize a new cluster.
*
* If problems persist, please see https://www.cockroachlabs.com/docs/v19.1/cluster-setup-troubleshooting.html.
*
CockroachDB node starting at 2019-07-15 19:00:01.429797804 +0000 UTC (took 166.5s)
build: CCL v19.1.2 @ 2019/06/07 17:32:15 (go1.11.6)
webui: https://[2607:a600:124:755c::15]:8080
sql: postgresql://root@[2607:a600:124:755c::15]:26257?sslcert=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fclient.root.crt&sslkey=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fclient.root.key&sslmode=verify-full&sslrootcert=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fca.crt
client flags: /usr/bin/cockroach <client cmd> --host=2607:a600:124:755c::15:26257 --certs-dir=/var/lib/cockroach/certs
logs: /var/lib/cockroach/cockroach-data/logs
temp dir: /var/lib/cockroach/cockroach-data/cockroach-temp829406050
external I/O path: /var/lib/cockroach/cockroach-data/extern
store[0]: path=/var/lib/cockroach/cockroach-data
status: initialized new cluster
clusterID: 8807a7af-b14f-4e43-b549-bb81a942ff54
nodeID: 1
On Node 2:
/usr/bin/cockroach start --certs-dir=/var/lib/cockroach/certs --listen-addr=[2607:a600:124:755c::16] --join=[2607:a600:124:755c::15],[2607:a600:124:755c::16],[2607:a600:124:755c::17]
output on node 2:
*
* INFO: initial startup completed.
* Node will now attempt to join a running cluster, or wait for `cockroach init`.
* Client connections will be accepted after this completes successfully.
* Check the log file(s) for progress.
*
*
* WARNING: The server appears to be unable to contact the other nodes in the cluster. Please try:
*
* - starting the other nodes, if you haven't already;
* - double-checking that the '--join' and '--listen'/'--advertise' flags are set up correctly;
* - running the 'cockroach init' command if you are trying to initialize a new cluster.
*
* If problems persist, please see https://www.cockroachlabs.com/docs/v19.1/cluster-setup-troubleshooting.html.
If I remove the [ ] from the addrs in the -join command on node 2 it works:
/usr/bin/cockroach start --certs-dir=/var/lib/cockroach/certs --listen-addr=2607:a600:124:755c::16 --join=2607:a600:124:755c::15,2607:a600:124:755c::16,2607:a600:124:755c::17
warning: the syntax "2607:a600:124:755c::16" for IPv6 addresses is deprecated; use "[2607:a600:124:755c::16]"
CockroachDB node starting at 2019-07-15 19:04:48.294224442 +0000 UTC (took 0.3s)
build: CCL v19.1.2 @ 2019/06/07 17:32:15 (go1.11.6)
webui: https://[2607:a600:124:755c::16]:8080
sql: postgresql://root@[2607:a600:124:755c::16]:26257?sslcert=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fclient.root.crt&sslkey=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fclient.root.key&sslmode=verify-full&sslrootcert=%2Fvar%2Flib%2Fcockroach%2Fcerts%2Fca.crt
client flags: /usr/bin/cockroach <client cmd> --host=2607:a600:124:755c::16:26257 --certs-dir=/var/lib/cockroach/certs
logs: /var/lib/cockroach/cockroach-data/logs
temp dir: /var/lib/cockroach/cockroach-data/cockroach-temp661043354
external I/O path: /var/lib/cockroach/cockroach-data/extern
store[0]: path=/var/lib/cockroach/cockroach-data
status: initialized new node, joined pre-existing cluster
clusterID: 8807a7af-b14f-4e43-b549-bb81a942ff54
nodeID: 2
Expected behavior
Using [ ... ] notation for IPv6 addrs in the join flag should work
Environment:
- CockroachDB version 19.1.2
- Server OS: CentOS 7.6
- Client app: cockroach start
Additional context Inconsistent that sometimes [...] notation is required for some commands to work and fails silently in others.
cc @piyush-singh
Hey, I was able to reproduce this and can see that IPv6 [...] notation fails with the join flag.
Thanks for bringing this up.
As a workaround, I can suggest setting up DNS names for your IPv6 addresses.