Introduction
Vault has a safety feature that blocks all requests when audit logging fails. If the audit log destination -- typically a file on disk -- runs out of space, Vault cannot write audit entries and refuses to process any API requests. This design ensures compliance but creates a total service outage that requires immediate disk space recovery.
Symptoms
- All Vault API requests fail with
500 Internal Server Error - Vault logs show
audit backend failed to writeordisk full vault statusmay still show healthy but all operations fail- Applications cannot authenticate or retrieve secrets
- Error message:
error writing audit log: write /var/log/vault/audit.log: no space left on device
Common Causes
- Audit log file growing unbounded without log rotation
- Disk partition for audit logs undersized for the audit log volume
- Log rotation not configured or failing silently
- Vault audit log in JSON format without compression, growing rapidly
- Other processes consuming disk space on the same partition
Step-by-Step Fix
- 1.Confirm the audit log disk is full: Check disk usage.
- 2.```bash
- 3.df -h /var/log/vault
- 4.du -sh /var/log/vault/*
- 5.
` - 6.Free disk space by rotating or truncating old audit logs: Make space available immediately.
- 7.```bash
- 8.# Compress old audit logs
- 9.gzip /var/log/vault/audit.log.1
- 10.# Or truncate the current log (preserves the file)
- 11.truncate -s 0 /var/log/vault/audit.log
- 12.
` - 13.Configure log rotation for the audit log file: Prevent future disk exhaustion.
- 14.```bash
- 15.# /etc/logrotate.d/vault-audit
- 16./var/log/vault/audit.log {
- 17.daily
- 18.rotate 30
- 19.compress
- 20.delaycompress
- 21.missingok
- 22.notifempty
- 23.create 0640 vault vault
- 24.postrotate
- 25.systemctl reload vault
- 26.endscript
- 27.}
- 28.
` - 29.Verify Vault resumes operations: Check that requests succeed again.
- 30.```bash
- 31.vault status
- 32.vault kv get secret/my-app/config
- 33.
` - 34.Consider adding a secondary audit backend: Use syslog or socket for redundancy.
- 35.```bash
- 36.vault audit enable syslog tag=vault
- 37.# Or file-based with rotation
- 38.vault audit enable file file_path=/var/log/vault/audit.log
- 39.
`
Prevention
- Configure logrotate for all Vault audit log files with appropriate retention and compression
- Mount audit logs on a dedicated partition with monitoring and alerts at 80% capacity
- Use multiple audit backends (file + syslog) for redundancy
- Monitor Vault audit log write errors and alert on any audit backend failures
- Set up automated disk space monitoring for the audit log partition
- Use Vault Enterprise's audit log forwarding to external systems (Splunk, Elastic) for long-term retention