Overview
This article addresses the issue encountered with setting/updating the local_max_space
parameter for Raft automated snapshots in 32-bit and 64-bit Vault binaries. Specifically, it discusses the error encountered in a 32-bit binary and how switching to a 64-bit binary resolves the issue.
As a matter of fact, the need to increase the local_max_space
occurs when we observe the following error or similar on the Vault operational logs:
snapshot failure: name=XYZ error="exceeded max space: written=1305201664,
available=1305201020, max_space=21474836480"
consecutive errors=13 next retry=20m0s
Problem Description
When configuring Raft automated snapshots in a 32-bit Vault binary, an error occurs when setting the local_max_space
parameter to a large value. This issue is due to the 32-bit system's inability to handle large integers.
Demo & Solution
The following error occurs when a configuration attempt is made with a 32-bit binary while updating the local_max_space
parameter for Raft automated snapshots.
Error writing data to sys/storage/raft/snapshot-auto/config/vault-raft-snapshot:
Error making API request.
URL: PUT http://127.0.0.1:8200/v1/sys/storage/raft/snapshot-auto/config/vault-raft-snapshot
Code: 400. Errors: * Field validation failed:
error converting input 50000000000 for field "local_max_space":
cannot parse '' as int: strconv.ParseInt: parsing "50000000000":
value out of range
The above error is resolved by replacing the 32-bit binary with a 64-bit Vault binary, which can handle larger integer values for the local_max_space
parameter via the following command:
$ vault write sys/storage/raft/snapshot-auto/config/vault-raft-snapshot \
interval=1m \
path_prefix=local \
storage_type=local \
local_max_space="50000000000" # Can be any value > currently set value needed during the time of command execution
Success! Data written to: sys/storage/raft/snapshot-auto/config/vault-raft-snapshot
Conclusion
When using an OS (Linux) with a 64-bit architecture, it is advisable to use a 64-bit Vault binary to avoid errors related to large integer values in configuration parameters. This ensures smooth configuration and operation of Raft automated snapshots.
Recommendations
- Verify System Architecture: Ensure your operating system is running a 64-bit architecture.
- Use 64-bit Vault Binary: Always use the 64-bit version of the Vault binary for better compatibility and to avoid issues with large integer values.