Vault
Troubleshoot lease problems
Explanations, workarounds, and solutions for common lease problems in Vault.
429 - Too Many Requests
Problem
Vault returns a 429 - Too Many Requests response when users try to
authenticate. For example:
Error making API request.
URL: PUT https://127.0.0.1:61555/v1/auth/userpass/login/foo
Code: 429. Errors:
* 1 error occurred:
* request path "auth/userpass/login/foo": lease count quota exceeded
Cause
Vault returns a 429 - Too Many Requests response if a new lease request
violates the configured lease quota limit.
To guard against lease explosions, Vault rejects authentication requests if completing the request would violate the configured lease quota limit.
Solution
- Correct any client-side errors that may cause excessive lease creation.
- Determine if your resource needs have changed and complete the Protecting Vault with Resource Quotas tutorial to determine new, appropriate defaults.
- Use the
vault leaseCLI command or lease count quota endpoint to tune your lease count quota.
Lease explosion (degraded performance)
Problem
Your Vault nodes are out of memory and unresponsive to new lease requests.
Cause
Clients have caused a lease explosion with consistent, high-volume API requests.
Solution
To resolve a lease explosion, you need to mitigate the problem to stabilize Vault and provide space for cluster recovery then clean up your Vault environment.
Mitigate resource stress by adjusting TTL values for your Vault instance:
Config level Parameter Precedence Database plugin ttlordefault_ttlfirst Database plugin max_ttlfirst AuthN/secrets plugin ttlordefault_ttlsecond AuthN/secrets plugin max_ttlsecond Vault default_lease_ttllast Vault max_lease_ttllast Granular TTLs on a role, group, or user level always override plugin and system-wide TTL values.
Use firewalls or load balancers to limit API calls to Vault from aberrant clients and reduce load on the struggling cluster .
Once the cluster stabilizes, check the active node to determine if you can wait for it to purge leases automatically or if you need to speed up the process by manually revoking leases.
If the cluster requires manual intervention, confirm you have a recent, valid snapshots of the cluster.
Once you confirm a valid snapshot of the cluster exists, use
vault lease revoketo manually revoke the offending leases.