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

cli: unusable ui url printed when $(hostname) doesn't resolve #16173

Closed
wendigo opened this issue May 26, 2017 · 3 comments
Closed

cli: unusable ui url printed when $(hostname) doesn't resolve #16173

wendigo opened this issue May 26, 2017 · 3 comments
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Milestone

Comments

@wendigo
Copy link

wendigo commented May 26, 2017

Is this a question, feature request, or bug report?

When running cockroach in single-node on macOS:

cockroach start --insecure

CockroachDB node starting at 2017-05-26 19:29:00.429726493 +0200 CEST
build:      CCL v1.0.1 @ 2017/05/25 17:12:12 (go1.8.3)
admin:      http://polpc02585:8080
sql:        postgresql://root@polpc02585:26257?sslmode=disable
...

While accessing web UI I got following errors on requests to _status/*: grpc: the connection is unavailable"

I have observed that this error is caused by my hostname not being resolvable to any IP:

~ hostname
polpc02585
~ ping polpc02585
ping: cannot resolve polpc02585: Unknown host

When I've added 127.0.0.1 polpc02585 to /etc/hosts everything works fine.

So my best guess is that cockroach should not use hostname name if it's not resolvable.

@tbg
Copy link
Member

tbg commented May 26, 2017

@wendigo thanks for your report! if your hostname isn't resolvable, use --http-host 127.0.0.1 and the problem will go away. Our ergonomics here are off - not sure what good other options are; but definitely not printing a hostname we know is not resolvable.

We in fact do something a little weird here, namely even when you use

./cockroach start --advertise-host=127.0.0.1 --insecure

then the printed UI endpoint still uses the inferred hostname, but at the SQL endpoint picks it up. This is unrelated, but perhaps that's also incorrect - --advertise-host is for intra-cluster communication.

Perhaps also related to #8832, #10374.

@tbg tbg changed the title grpc: the connection is unavailable cli: unusable ui url printed when $(hostname) doesn't resolve May 26, 2017
@petermattis petermattis added this to the 1.1 milestone May 26, 2017
@petermattis
Copy link
Collaborator

I mentioned this same idea somewhere else recently (but I never filed an issue): we should try resolving os.Hostname() before using it. Not having a resolvable hostname seems to be a very common configuration and source of errors.

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. labels May 30, 2017
@wendigo
Copy link
Author

wendigo commented Jun 4, 2017

I agree. Recently I had to reinstall macOS from scratch and default hostname is not resolvable thus creating situation I've described which can be surprising to many unexperienced users.

@tamird tamird closed this as completed in 92c483e Jun 19, 2017
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. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Projects
None yet
Development

No branches or pull requests

5 participants