Mostly as a note to myself, but here’s what to do if you’re running linuxserver/syncthing via Docker on Unraid and it keeps saying:
ERR Database error when getting previous version (error="getkv: database disk image is malformed (11)" log.pkg=syncthing)
The problem is that Syncthing’s index has been corrupted. I was able to fix it by getting a shell into the relevant Docker container and moving the index: Syncthing detected it as absent and re-created it, re-indexing everything. Here’s what I did:
docker exec -it syncthing bash
mv /config/index-v2 /config/index-v2-BROKEN
Everything fixed itself immediately and the Docker logs showed the reindex underway.