I’ve found a few posts about this and similar db errors and I’ve tried:
restarting the daemon - no effect
running sqlite3’s PRAGMA integrity_check; (sqlite version 3.31.1) on all databases and restarting - all are ok, service started with same error
removing storage_usage.db and restarting the daemon - a new file is created and the same error is displayed. restoring the original file afterward has no effect.
removing all .db files, starting the node, stopping the node, restoring the original .db files - same error
A few posts recommend recreating the schema but they’re dated and I’m guessing the schema has changed since then.
You need to recreate this database following this instruction:
Only deleting this database will not trigger its creation, you need to move all databases to a backup folder, then start the node. Then stop the node when all databases will be re-created, now you may move back (with replace) all databases from the backup but this database.
I removed every .db file, not just storage_usage. The node started and created new, empty databases. I stopped it, restored the original .db files (I tried with and without storage_usage.db), and started storj. I tried this twice yesterday and 3 times today. The node still raises the same error. Am I missing something?
Did you restore databases when the node is stopped?
Please note, the databases are located in the storage subfolder of the data location.
I cannot reproduce it.
Yes, the node was stopped when I moved the databases.
With the exception of renaming the broken storage_usage.db after moving the files, I believe my process is the same. The only thing I’m not sure about is this:
wait until all databases are created and node updated to the actual version
I waited until the dashboard would load, plus a few seconds; was that sufficient? All databases appeared to have been created and the node was logging messages that didn’t appear to be part of the startup routine.
You may check logs to see when databases are created and the node is updated. If it said that there is no new version and db migration is finished, then you may stop and remove the container to move to the next step.
However, I would recommend to check your backup folder to do not have this database there, thus why I recommended to rename a database, this will make a backup copy and will prevent the accidental recover of the broken version after databases creation.