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

vault status panics for HA server when /sys/leader returns 500 #3998

Closed
jgiles opened this issue Feb 17, 2018 · 0 comments
Closed

vault status panics for HA server when /sys/leader returns 500 #3998

jgiles opened this issue Feb 17, 2018 · 0 comments
Milestone

Comments

@jgiles
Copy link
Contributor

jgiles commented Feb 17, 2018

Environment:

  • Vault Version: Vault v0.9.3 ('5acd6a21d5a69ab49d0f7c0bf540123a9b2c696d')
  • Operating System/Architecture: OSX

Expected Behavior:
Display error from server rather than panicking.

Actual Behavior:
Panics.

Steps to Reproduce:

  1. Get your HA cluster into a state where leader election is busted (e.g. my server logs are spamming [ERROR] core: failed to acquire lock: error=failed to create session: Unexpected response code: 500 (No known Consul servers))

  2. Try to check the Vault status.

$ curl --cacert $VAULT_CACERT $VAULT_ADDR/v1/sys/leader
{"errors":["Unexpected response code: 500"]}

$ vault status
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x25c6624]

goroutine 1 [running]:
github.com/hashicorp/vault/command.OutputSealStatus(0x3d1e2a0, 0xc420097e50, 0xc4201c36c0, 0xc4205dc980, 0x0)
        /private/tmp/vault-20180128-5063-cdu8kz/src/github.com/hashicorp/vault/command/format.go:244 +0x6d4
github.com/hashicorp/vault/command.(*StatusCommand).Run(0xc4201a93e0, 0xc420098010, 0x0, 0x0, 0xc42063e2a0)
        /private/tmp/vault-20180128-5063-cdu8kz/src/github.com/hashicorp/vault/command/status.go:82 +0x1e2
github.com/hashicorp/vault/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc42042db80, 0xc42042db80, 0xc420640c40, 0xc420180780)
        /private/tmp/vault-20180128-5063-cdu8kz/src/github.com/hashicorp/vault/vendor/github.com/mitchellh/cli/cli.go:255 +0x1eb
github.com/hashicorp/vault/command.Run(0xc420098010, 0x1, 0x1, 0x2622fb9)
        /private/tmp/vault-20180128-5063-cdu8kz/src/github.com/hashicorp/vault/command/main.go:47 +0x411
main.main()
        /private/tmp/vault-20180128-5063-cdu8kz/src/github.com/hashicorp/vault/main.go:10 +0x63

Important Factoids:

I'm pretty sure the HA setup problem is user error. This issue is just about the client panic on vault status

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

2 participants