A few days ago I restarted Storj from Services and it failed with the error 1067 (unexpected stuff happened, the service failed to start). Checking the logs revealed that one or more of the .db files are malformed. I took it to support, where they lead me to a page explaining how to fix malformed disk images.
Researching a lot to make those linux commands work under Windows I made a little script which goes through all the .db files, with a tutorial to go with it for people like me who has to google everything.
Download the script here: https://1drv.ms/u/s!Ai6u_MiN3ypLm-IvXPXFEwa_5ydSNg?e=fHr1a9
This will work on any Windows 10 GUI or Docker installation.
Here is a quick step by step guide on how to use it:
- Stop Storj.
- Unpack “Fix databases.bat” and “sqlitecommands.txt” to any folder on your PC.
- Run a disk check to make sure everything is in order on your storage medium. Run “chkdsk z: /f /r /x” where “z” is your Storj drive letter. (You may need to restart your PC for this), make sure Storj is stopped after your PC started back up.
- Download Cygwin (needed for linux commands to work under Windows): https ://www.cygwin.com/setup-x86_64.exe
- Install Cygwin (select all options) to C:\cygwin
- Download sqlite3 (needed to work with databases): https ://sqlite.org/2020/sqlite-tools-win32-x86-3310100.zip
- Unpack and copy sqlite3.exe to C:\sqlite3
- Add “C:\cygwin” and “C:\sqlite3” to PATH (needed for cmd to know where to look for the commands). If you don’t know how to do this look here: https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
- a) If Storj stores data in Z:\storage on your computer, proceed to step 10.
b) If Z:\storage is not where Storj stores your .db files, modify your drive letter to Z: and make sure you have all the .db files in Z:\storage.
c) If Z:\storage is not where Storj stores your .db files, you can open and modify “Fix databases.bat” and “sqlitecommands.txt” and wherever you see “Z:/storage” modify it to your Storj storage location, where the .db files are. Open them in notepad, press CTRL+H and change EVERY occurance of “Z:/storage” to whatever your location is.
- If you only want to repair a few given .db files, feel free to modify “Fix databases.bat” to only have the files you want to repair.
- Run “Fix databases.bat” and grab some food, this will take a while.
If you found this helpful drop a thanks to 0xFB2E3e1D409fd44465D6F82cB3A0162ddcd7E6b5 with some Storj tokens if you feel like it