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/api/sys_health.go returns nil as a body when HTTP code is 429 #2840

Closed
ghost opened this issue Jun 8, 2017 · 0 comments
Closed

vault/api/sys_health.go returns nil as a body when HTTP code is 429 #2840

ghost opened this issue Jun 8, 2017 · 0 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jun 8, 2017

We are checking each of our deployed vaults to determine if the vault is sealed or unsealed.
We are encountering a problem with the health check response in the client.

eg. health, err = v.Client.Sys().Health()

r := c.c.NewRequest("GET", "/v1/sys/health")
	resp, err := c.c.RawRequest(r)
	if err != nil {
		return nil, err
	}

When called for a vault pod which is a standby, the http response code 429 is correctly returned to indicate a standby instance, but the HealthResponse is discarded and nil is returned alongside, so we can never tell what state the vault is in !

Compared against a curl of the REST API

curl -v http://localhost:8200/v1/sys/health
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8200 (#0)
> GET /v1/sys/health HTTP/1.1
> Host: localhost:8200
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 429 Too Many Requests
< Cache-Control: no-store
< Content-Type: application/json
< Date: Thu, 08 Jun 2017 14:44:32 GMT
< Content-Length: 190
< 
{"initialized":true,"sealed":false,"standby":true,"server_time_utc":1496933072,"version":"0.7.0","cluster_name":"vault-cluster-7c947708","cluster_id":"dbf06f1f-6b8e-e900-4e44-895674d9f6f4"}

which returns information about the standby instance as well as the 429.

@jefferai jefferai modified the milestone: 0.7.4 Jun 8, 2017
@jefferai jefferai modified the milestones: 0.7.4, 0.8.0 Jul 24, 2017
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

1 participant