Troubleshooting¶
This guide helps diagnose and fix common grite issues.
Quick Diagnostics¶
Start with a health check:
Check for errors:
Common Issues¶
Database Busy (DbBusy)¶
Symptom:
Causes:
- Daemon is running
- Another grite process has the lock
- Stale lock file
Solutions:
-
Route through daemon:
-
Stop the daemon:
-
Skip daemon:
-
Remove stale lock (if process crashed):
Issue Not Found¶
Symptom:
Causes:
- Issue ID is wrong
- Issue not synced yet
- Database needs rebuild
Solutions:
-
Check available issues:
-
Sync from remote:
-
Rebuild database:
Sync Conflicts¶
Symptom:
Causes:
- Remote has newer commits
- Normal during concurrent work
Solution:
Use full sync (auto-rebases):
WAL Corruption¶
Symptom:
Causes:
- Interrupted write
- Git corruption
- Disk error
Solutions:
-
Try syncing from remote:
-
Verify git integrity:
-
Re-clone if necessary:
IPC Errors¶
Symptom:
Causes:
- Daemon crashed
- Socket file missing
- Permission issues
Solutions:
-
Restart daemon:
-
Check daemon status:
-
Use local execution:
-
Remove stale daemon lock:
Signature Verification Failed¶
Symptom:
Causes:
- Signing key changed
- Event tampered with
- Wrong public key
Solutions:
-
Check verification policy:
-
Set policy to
warnto continue: -
Verify specific events:
Slow Performance¶
Symptom:
- Commands take a long time
- List queries are slow
Causes:
- Database needs rebuild
- No daemon running
- Large WAL without snapshots
Solutions:
-
Check database stats:
-
Rebuild if recommended:
-
Create snapshots:
-
Use daemon for repeated commands:
Out of Disk Space¶
Symptom:
Solutions:
-
Clean up snapshots:
-
Clean expired locks:
-
Rebuild to compact:
Actor Configuration Missing¶
Symptom:
Solutions:
-
Create a new actor:
-
Check existing actors:
-
Re-initialize grite:
Diagnostic Commands¶
Check Health¶
Database Statistics¶
Verify Integrity¶
Daemon Status¶
Lock Status¶
Current Actor¶
Debug Logging¶
Enable verbose logging:
More specific:
Recovery Procedures¶
Full Reset¶
If all else fails:
# Stop daemon
grite daemon stop
# Backup current state
grite export --format json
cp .grite/export.json ~/backup-$(date +%Y%m%d).json
# Remove local state
rm -rf .git/grite/actors/<actor_id>/sled
rm -f .git/grite/actors/<actor_id>/*.lock
# Sync and rebuild
grite sync --pull
grite rebuild
Re-clone Repository¶
For severe corruption:
# In a different directory
git clone <remote> fresh-repo
cd fresh-repo
grite init
grite sync --pull
grite rebuild
Restore from Export¶
If you have a JSON export:
Getting Help¶
If these steps don't resolve your issue:
- Check the GitHub Issues
- Enable debug logging and capture output
- Report the issue with:
- grite version (
grite --version) - Error message
- Debug log output
- Steps to reproduce
Next Steps¶
- Health Checks - Regular diagnostics
- Rebuilding - Database recovery
- CLI Reference - Command details