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

-addr not respected? #281

Closed
chadwhitacre opened this issue May 31, 2015 · 4 comments
Closed

-addr not respected? #281

chadwhitacre opened this issue May 31, 2015 · 4 comments

Comments

@chadwhitacre
Copy link
Contributor

First steps with Vault, ran ./vault server -dev in one shell, and then in another:

$ ./vault write foo/bar baz=buz
Error writing data to foo/bar: Put https://127.0.0.1:8200/v1/foo/bar: tls: oversized record received with length 20527

This error usually means that the server is running with TLS disabled
but the client is configured to use TLS. Please either enable TLS
on the server, or run the client with -addr set to http://<addr>
where <addr> is replaced by the actual address to the server.

Fair enough. But the advice doesn't seem to be good:

$ ./vault -addr=http://127.0.0.1:8200 write foo/bar baz=buz
Error writing data to foo/bar: Put https://127.0.0.1:8200/v1/foo/bar: tls: oversized record received with length 20527

This error usually means that the server is running with TLS disabled
but the client is configured to use TLS. Please either enable TLS
on the server, or run the client with -addr set to http://<addr>
where <addr> is replaced by the actual address to the server.
$
@sethvargo
Copy link
Contributor

Hi @whit537

Thank you for opening an issue. I think the issue is the ordering of arguments here. If you run vault write -h, you will see that vault expects options before the path and data:

$ vault write -h
Usage: vault write [options] path [data]

It looks like you are specifying the -addr option before the write command, so I do not think it's getting passed through. This is definitely a bug because Vault should either honor the flag earlier or at least throw an error so you could come to this conclusion as the user (I'm open to discuss the proper UX). Nonetheless, I think if you move the -addr flag, you'll have better success 😄.

@karel1980
Copy link

  • Compare to running git -S vault log vs git log -S vault. Although -address is allowed on multiple commands, it still doesn't apply toall commands.
  • Allowing options before the command could become confusing.

IMO the best thing to do is to have vault complain if using anything other than -h[elp] or -v[ersion].

@mitchellh
Copy link
Contributor

This is fixed upstream. The CLI now errors.

@karel1980
Copy link

I just found out :) mitchellh/cli#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants