-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Cockroach CLI commands not using default location for --certs-dir #87191
Description
Describe the problem
During testing of the new 22.2.0-alpha.1 build. It no longer finds my certificates in the default location of $HOME/.cockroach-certs when I fail to pass a --certs-dir flag.
To Reproduce
Have certificates in $HOME/.cockroach-certs, in mine I have ca.crt, client.root.crt, client.root.key, node.crt and node.key - ie the usual suspects.
Attempt to start a new cockroach instance/cluster with this command:
/home/vagrant/bin/cockroach start --advertise-addr=172.28.128.21 --join=172.28.128.21
I get this:
[vagrant@node-1 ~]$ /home/vagrant/bin/cockroach start --advertise-addr=172.28.128.21 --join=172.28.128.21
*
* ERROR: ERROR: cannot load certificates.
* Check your certificate settings, set --certs-dir, or use --insecure for insecure clusters.
*
* failed to start server: problem using security settings: no certificates found; does certs dir exist?
*
ERROR: cannot load certificates.
Check your certificate settings, set --certs-dir, or use --insecure for insecure clusters.
failed to start server: problem using security settings: no certificates found; does certs dir exist?
Failed running "start"
Swapping the new binary out for the previous GA release works as expected. I have no ~/.postgresql.
Other CLI commands also break in the same way, such as cockroach sql, cockroach init etc.
Expected behavior
Normally, without the --certs-dir flag, it finds all the necessary certificates in $HOME/.cockroach-certs but now it doesn't.
Jira issue: CRDB-19204