database disk image is malformed
Looks like sqlite + unclean system shutdown corrupted the db
2 Replies
Important Information
Thank you for getting in touch with your support request. To expedite a swift resolution, could you kindly provide the following information? Rest assured, we will respond promptly, and we greatly appreciate your patience. While you wait, please check the links below to see if this issue has been previously addressed. If you have managed to resolve it, please use run the command
/resolve
or press the green resolve button below.Log Files
If you possess any log files that you believe could be beneficial, please include them at this time. By default, CrowdSec logs to /var/log/, where you will discover a corresponding log file for each component.
Guide Followed (CrowdSec Official)
If you have diligently followed one of our guides and hit a roadblock, please share the guide with us. This will help us assess if any adjustments are necessary to assist you further.
Screenshots
Please forward any screenshots depicting errors you encounter. Your visuals will provide us with a clear view of the issues you are facing.
© Created By WhyAydan for CrowdSec ❤️
fix:
1. disable crowdsec namespace auto-sync if you use for example argocd
2. scale down crowdsec lapi to 0
kubectl -n crowdsec scale deployment --replicas 0 crowdsec-lapi
3. make a backup fot he PVC
4. spawn helper pod to mount crowdsec db pvc and run command inside of it:
sqlite3 crowdsec.db .recover >crowdsec.sql && rm -f crowdsec.db && sqlite3 crowdsec.db <crowdsec.sql
5. terminate helper pod
6. scale back crowdsec lapi:
kubectl -n crowdsec scale deployment --replicas 1 crowdsec-lapi
7. resume namespace auto-sync if you use for example argocd