Troubleshooting
Quick guide to diagnosing and fixing common walrust issues.
Exit Codes
Section titled “Exit Codes”Walrust uses structured exit codes for scripting and automation:
| Code | Name | Meaning |
|---|---|---|
| 0 | Success | Operation completed successfully |
| 1 | General | Unknown or uncategorized error |
| 2 | Config | Configuration error (invalid config file, missing CLI args) |
| 3 | Database | Database error (file not found, WAL corruption, SQLite issues) |
| 4 | S3 | S3 error (network, authentication, bucket access) |
| 5 | Integrity | Integrity error (checksum mismatch, LTX verification failed) |
| 6 | Restore | Restore error (no snapshot found, PITR unavailable) |
Use in scripts:
walrust verify mydb -b s3://bucketcase $? in 0) echo "Verification passed" ;; 5) echo "Integrity error - backup may be corrupted" ;; 4) echo "S3 error - check credentials/connectivity" ;; *) echo "Other error: $?" ;;esacConfiguration Errors (Exit Code 2)
Section titled “Configuration Errors (Exit Code 2)”Missing —bucket Argument
Section titled “Missing —bucket Argument”Error:
Error: --bucket is required when no config file is presentSolution: Provide the bucket via CLI or config file:
# CLI optionwalrust watch app.db --bucket my-backups
# Or create walrust.tomlcat > walrust.toml <<EOF[s3]bucket = "s3://my-backups"EOFwalrust watch app.dbInvalid TOML Syntax
Section titled “Invalid TOML Syntax”Error:
Failed to parse walrust.toml: invalid key at line 5Solution: Check for syntax errors in your config file:
# Bad - quotes missingbucket = s3://my-bucket
# Goodbucket = "s3://my-bucket"Invalid Duration Format
Section titled “Invalid Duration Format”Error:
Invalid duration '5x'. Use format like '5s', '5m', '5h', '5d'Solution: Use valid duration suffixes:
[cache]retention = "24h" # hours# retention = "7d" # days# retention = "30m" # minutes# retention = "60s" # secondsDatabase Errors (Exit Code 3)
Section titled “Database Errors (Exit Code 3)”Database File Not Found
Section titled “Database File Not Found”Error:
Database not found: /path/to/app.dbSolution: Verify the database path exists:
ls -la /path/to/app.dbIf using a config file with wildcards, check the pattern:
[[databases]]path = "/data/*.db" # Make sure this matches actual filesWAL Not Enabled
Section titled “WAL Not Enabled”Error:
WAL mode not enabled for databaseSolution: Enable WAL mode on your database:
PRAGMA journal_mode=WAL;Or from the command line:
sqlite3 app.db "PRAGMA journal_mode=WAL;"Invalid Page Size
Section titled “Invalid Page Size”Error:
Invalid page size: 512Solution: SQLite databases must use supported page sizes (512, 1024, 2048, 4096, 8192, 16384, 32768, or 65536 bytes). Most databases use 4096 bytes by default. This error usually indicates a corrupted database.
Verify your database:
sqlite3 app.db "PRAGMA integrity_check;"S3 Errors (Exit Code 4)
Section titled “S3 Errors (Exit Code 4)”Access Denied
Section titled “Access Denied”Error:
AccessDenied: Access to bucket deniedSolution:
- Check your credentials:
echo $AWS_ACCESS_KEY_IDecho $AWS_SECRET_ACCESS_KEY-
Verify bucket permissions (AWS IAM policy needs
s3:PutObject,s3:GetObject,s3:ListBucket) -
For Tigris, ensure you’re using the correct access key format:
export AWS_ACCESS_KEY_ID=tid_xxxxxexport AWS_SECRET_ACCESS_KEY=tsec_xxxxxexport AWS_ENDPOINT_URL_S3=https://fly.storage.tigris.devNo Such Bucket
Section titled “No Such Bucket”Error:
NoSuchBucket: The specified bucket does not existSolution:
- Create the bucket first:
# AWSaws s3 mb s3://my-bucket
# Tigris (via Fly.io)fly storage create- Check bucket name spelling in your config
Connection Timeout
Section titled “Connection Timeout”Error:
Failed to connect to S3: connection timeoutSolution:
- Check network connectivity:
ping fly.storage.tigris.dev# orping s3.amazonaws.com- Verify endpoint URL is correct:
# For Tigrisexport AWS_ENDPOINT_URL_S3=https://fly.storage.tigris.dev
# For AWS (usually not needed)unset AWS_ENDPOINT_URL_S3- Check firewall rules allow outbound HTTPS (port 443)
Integrity Errors (Exit Code 5)
Section titled “Integrity Errors (Exit Code 5)”Checksum Mismatch
Section titled “Checksum Mismatch”Error:
Checksum mismatch: expected 0x123abc, got 0x456defSolution:
- Run verification:
walrust verify mydb --bucket my-backups- If specific files are corrupted, restore from an earlier snapshot:
# List snapshotswalrust list --bucket my-backups
# Restore to specific point in timewalrust restore mydb -o restored.db \ --bucket my-backups \ --point-in-time "2024-01-15T10:00:00Z"- Check S3 storage for corruption (rare but possible)
TXID Continuity Broken
Section titled “TXID Continuity Broken”Error:
TXID continuity broken: gap between file 5 (TXID 100) and file 6 (TXID 110)Solution: This indicates missing LTX files. Possible causes:
- Manual file deletion from S3
- Failed uploads that weren’t retried
- Compaction bug (unlikely)
Recovery: Use point-in-time restore to the last valid TXID:
walrust restore mydb -o restored.db \ --bucket my-backups \ --point-in-time "2024-01-15T09:00:00Z"Restore Errors (Exit Code 6)
Section titled “Restore Errors (Exit Code 6)”No Snapshot Found
Section titled “No Snapshot Found”Error:
No snapshot found for database 'mydb'Solution:
- Check database name:
walrust list --bucket my-backups- Verify S3 prefix:
# If you used a custom prefix in config[[databases]]path = "/data/app.db"prefix = "production" # Use this name for restore
# Restorewalrust restore production -o app.db --bucket my-backupsPITR Unavailable
Section titled “PITR Unavailable”Error:
Point-in-time restore unavailable: no LTX files before 2024-01-15T10:00:00ZSolution: The requested timestamp is before your first snapshot. List available snapshots:
walrust list --bucket my-backupsRestore to the earliest available snapshot instead:
walrust restore mydb -o restored.db --bucket my-backupsPerformance Issues
Section titled “Performance Issues”High CPU Usage
Section titled “High CPU Usage”Symptoms:
- walrust consuming 30%+ CPU continuously
Solutions:
- Increase
monitor_intervalto reduce file watcher checks:
[sync]monitor_interval = 5 # Check every 5 seconds instead of 1- Increase
wal_sync_intervalto batch WAL syncs:
[sync]wal_sync_interval = 5 # Sync every 5 seconds- Check for extremely high write rates (10K+ writes/sec per DB)
High Memory Usage
Section titled “High Memory Usage”Symptoms:
- walrust using more than 50 MB for small databases
Solutions:
- Check for WAL file growth:
ls -lh /data/*.db-walIf WAL files are huge (>100 MB), enable checkpointing:
[sync]checkpoint_interval = 60min_checkpoint_page_count = 1000wal_truncate_threshold_pages = 121359- Reduce snapshot interval for memory relief:
[sync]snapshot_interval = 1800 # 30 minutes instead of 1 hourSlow Uploads
Section titled “Slow Uploads”Symptoms:
- S3 uploads taking several seconds
Solutions:
- Enable local cache for faster encoding:
[cache]enabled = trueretention = "24h"max_size = 5368709120 # 5GB-
Check network bandwidth to S3
-
Consider using a CDN or S3 in a closer region
Getting Help
Section titled “Getting Help”If you’re stuck:
- Enable debug logging:
export RUST_LOG=walrust=debugwalrust watch app.db -b my-bucket 2>&1 | tee walrust.log- Run verify to check backup integrity:
walrust verify mydb --bucket my-backups-
Check recent issues: GitHub Issues
-
Ask for help: Open a new issue with:
- walrust version (
walrust --version) - Operating system
- Full error message
- Relevant config (redact credentials!)
- Debug logs
- walrust version (