Skip to content

Cockroach CLI commands not using default location for --certs-dir #87191

@smcvey

Description

@smcvey

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

Metadata

Metadata

Assignees

Labels

A-cli-clientCLI commands that pertain to using SQL featuresC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.branch-masterFailures and bugs on the master branch.branch-release-22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2regressionRegression from a release.release-blockerIndicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions