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

--sql-advertise-addr has no effect if you don't also set --sql-addr alongside it #87040

Closed
a-robinson opened this issue Aug 29, 2022 · 1 comment · Fixed by #87412
Closed
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-server-and-security DB Server & Security X-blathers-triaged blathers was able to find an owner

Comments

@a-robinson
Copy link
Contributor

a-robinson commented Aug 29, 2022

Describe the problem

I tried setting --sql-advertise-addr on a cluster purely in order to improve the output of cockroach node status and related debug endpoints so that they would include a useful identifying hostname that makes reading their output easier (the cluster is using IP addresses for its normal listen/advertise addr for reasons that are unimportant here). But found that it had zero effect, not even in the initial "CockroachDB node starting at ..." message that gets printed out when a node starts up. The non-sql --advertise-addr was instead used as the advertised SQL address.

And you can't cheekily work around it by setting --sql-addr to the same thing as --listen-addr, because cockroach reasonably assumes that you want it to bind to the two addresses separately, so it fails to bind both during startup.

I previously mentioned this in #52266 (comment), but haven't personally take the time to fix it myself, so I'm creating a separate issue in case it's helpful given that it isn't really the same issue as #52266 and it bothered me again recently.

To Reproduce

cockroach start-single-node --insecure --listen-addr 127.0.0.1 --advertise-sql-addr localhost

Expected behavior
I'd expect the various places that the SQL address is printed such as the cockroach start output and cockroach node status to use localhost in the SQL address, but both use 127.0.0.1.

Additional data / screenshots

$ cockroach start-single-node --insecure --listen-addr 127.0.0.1 --advertise-sql-addr localhost
[...]
CockroachDB node starting at 2022-08-29 15:44:58.872696991 +0000 UTC (took 0.8s)
build:               CCL v22.1.6 @ 2022/08/23 17:05:04 (go1.17.11)
webui:               http://127.0.0.1:8080
sql:                 postgresql://[email protected]:26257/defaultdb?sslmode=disable
sql (JDBC):          jdbc:postgresql://127.0.0.1:26257/defaultdb?sslmode=disable&user=root
RPC client flags:    cockroach <client cmd> --host=127.0.0.1:26257 --insecure
[...]
$ cockroach node status --insecure
  id |     address     |   sql_address   |  build  |        started_at         |         updated_at         | locality | is_available | is_live
-----+-----------------+-----------------+---------+---------------------------+----------------------------+----------+--------------+----------
   1 | 127.0.0.1:26257 | 127.0.0.1:26257 | v22.1.6 | 2022-08-29 15:44:58.67473 | 2022-08-29 15:51:12.196074 |          | true         | true
(1 row)

Environment:

  • CockroachDB version: v22.1.6
  • Server OS: Linux

Jira issue: CRDB-19116

@a-robinson a-robinson added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Aug 29, 2022
@blathers-crl
Copy link

blathers-crl bot commented Aug 29, 2022

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I have CC'd a few people who may be able to assist you:

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Aug 29, 2022
@blathers-crl blathers-crl bot added the T-server-and-security DB Server & Security label Aug 29, 2022
@knz knz self-assigned this Sep 6, 2022
@craig craig bot closed this as completed in 3ff179c Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-server-and-security DB Server & Security X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants