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

lease_id null causes connection hangups on some endpoints #18850

Closed
ludovicianul opened this issue Jan 26, 2023 · 1 comment · Fixed by #18951
Closed

lease_id null causes connection hangups on some endpoints #18850

ludovicianul opened this issue Jan 26, 2023 · 1 comment · Fixed by #18951
Labels
bug Used to indicate a potential bug core/lease

Comments

@ludovicianul
Copy link

Describe the bug
The following endpoints are failing to respond when lease_id is null: /sys/leases/lookup, /sys/leases/renew and /sys/leases/revoke.

To Reproduce
Steps to reproduce the behavior:

curl  -X POST \
      -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Vault-Token: $token" \
      -d '{"lease_id":null}' \
      http://localhost:8200/v1/sys/leases/lookup
curl  -X POST \
      -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Vault-Token: $token" \
      -d '{"url_lease_id":"xA93aoKE2mSsv2h","sync":true,"lease_id":null}' \
      http://localhost:8200/v1/sys/leases/revoke
curl  -X POST \
      -H "Accept: application/json" -H "Content-Type: application/json" -H "X-Vault-Token: $token" \
      -d '{"url_lease_id":"kRmzOuXx6xbHcF","increment":6,"lease_id":null}' \
      http://localhost:8200/v1/sys/leases/renew

Expected behavior
A meaningful HTTP response.

Environment:

  • Vault Server Version (retrieve with vault status): 1.12.2
  • Vault CLI Version (retrieve with vault version): v1.12.2
  • Server Operating System/Architecture: macOS Ventura 13.0.1

Additional context
Logs:

 [INFO]  http: panic serving 127.0.0.1:65074: interface conversion: interface {} is nil, not string
goroutine 73282 [running]:
net/http.(*conn).serve.func1()
        /opt/hostedtoolcache/go/1.19.3/x64/src/net/http/server.go:1850 +0xbf
panic({0x595efa0, 0xc001c84960})
        /opt/hostedtoolcache/go/1.19.3/x64/src/runtime/panic.go:890 +0x262
github.com/hashicorp/vault/vault.(*Core).handleCancelableRequest(0xc000890e00, {0x77566d8, 0xc001c845d0}, 0xc000245e00)
        /home/runner/work/vault/vault/vault/request_handling.go:628 +0x2434
github.com/hashicorp/vault/vault.(*Core).switchedLockHandleRequest(0xc000890e00, {0x77566d8, 0xc00092bd70}, 0xc000245e00, 0x20?)
        /home/runner/work/vault/vault/vault/request_handling.go:472 +0x539
github.com/hashicorp/vault/vault.(*Core).HandleRequest(...)
        /home/runner/work/vault/vault/vault/request_handling.go:433
github.com/hashicorp/vault/http.request(0x5e44920?, {0x7745388, 0xc00092bb60}, 0xc0019aed00, 0xc000245e00?)
        /home/runner/work/vault/vault/http/handler.go:910 +0x86
@ccapurso
Copy link
Contributor

ccapurso commented Feb 3, 2023

Thanks for bring this to our attention @ludovicianul! We have implemented a fix and will backport it to 1.10.x, 1.11.x, and 1.12.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/lease
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants