Skip to content

cli: cockroach sql fails after successful connect and start-single-node without arguments #61616

@knz

Description

@knz

The following two commands succeed without any additional arguments:

% cockroach connect --single-node
% cockroach start-single-node

Then after issuing the following command, which was recommended by the output of connect:

% ./cockroach cert create-client root --ca-key=~/.cockroach-certs/ca-client.key

invocation of cockroach sql without argument fails:

% ./cockroach sql
[...]
ERROR: x509: certificate is valid for kenax, not localhost
Failed running "sql"

This is because of a design mismatch:

  • connect and start commands use the "hostname" of the machine
  • sql and other client commands default to localhost
  • connect command does not populate localhost into the cert unless requested explicitly

What to do about this?

cc @aaron-crl @itsbilal

Part of #60632

Jira issue: CRDB-6274
Epic: CRDB-6663

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-authenticationPertains to authn subsystemsA-cli-adminCLI commands that pertain to controlling and configuring nodesA-cli-clientCLI commands that pertain to using SQL featuresA-securityC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.T-server-and-securityDB Server & Security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions