Orders Database - File is Not in Database Error

Got this weird error this morning. Perhaps someone can offer some assistance:

ERROR piecestore failed to add order {“error”: “ordersdb error: file is not a database”,

Just to make things more interesting, now I’ve got another error:

Error creating tables for master database on storagenode: migrate: no such table: main.order_archive

And just a bit more:

2020-02-22T22:37:23.249Z DEBUG Unrecoverable error {“error”: “Error during preflight check for storagenode databases: storage node preflight database error: file is not a database\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema.func1:35\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema:53\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).Preflight:283\n\tmain.cmdRun:198\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”, “errorVerbose”: “Error during preflight check for storagenode databases: storage node preflight database error: file is not a database\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema.func1:35\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema:53\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).Preflight:283\n\tmain.cmdRun:198\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203\n\tmain.cmdRun:200\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”}
Error: Error during preflight check for storagenode databases: storage node preflight database error: file is not a database
storj.io/storj/private/dbutil/sqliteutil.QuerySchema.func1:35
storj.io/storj/private/dbutil/sqliteutil.QuerySchema:53
storj.io/storj/storagenode/storagenodedb.(*DB).Preflight:283
main.cmdRun:198
storj.io/storj/pkg/process.cleanup.func1.2:307
storj.io/storj/pkg/process.cleanup.func1:325
github.com/spf13/cobra.(*Command).execute:826
github.com/spf13/cobra.(*Command).ExecuteC:914
github.com/spf13/cobra.(*Command).Execute:864
storj.io/storj/pkg/process.ExecWithCustomConfig:84
storj.io/storj/pkg/process.ExecCustomDebug:66
main.main:328
runtime.main:203

This is the second time you got this issue. Could you figure out what caused it this time ?

I have absolutely no idea why my node is experiencing this problem. I made zero configuration changes and have not lost power or internet connectivity.

Then it must be hardware issue. What’s the make of your HDD ? How old is your HDD?

My 8TB hard drive is less than one year old. I am not having any other troubles with it. I can view all of the files on the hard drive with no problem.

Let me try a complete system reboot and see if that does the trick.

Yea, that didn’t work either. Seems like the storagenode is in an endless cycle of trying to restart itself. Seems like one of the database files is not being recognized as a “database file” for some reason…but the error message doesn’t say which one.

DEBUG Unrecoverable error {“error”: “Error during preflight check for storagenode databases: storage node preflight database error: file is not a database\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema.func1:35\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema:53\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).Preflight:283\n\tmain.cmdRun:198\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”, “errorVerbose”: “Error during preflight check for storagenode databases: storage node preflight database error: file is not a database\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema.func1:35\n\tstorj.io/storj/private/dbutil/sqliteutil.QuerySchema:53\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).Preflight:283\n\tmain.cmdRun:198\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203\n\tmain.cmdRun:200\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”}
Error: Error during preflight check for storagenode databases: storage node preflight database error: file is not a database

PS C:\Windows\system32> docker exec -it storagenode /app/dashboard.sh
Error response from daemon: Container 2f13e0c45725d206ad335285a78490c4fe35bb1058de84e283df0d7d199fbc6b is restarting, wait until the container is running

This is terribly disappointing. I’m 80% close to quitting STORJ all together. Seems like there is a database malfunction every month or so. I can’t even do a graceful exit to recover my escrowed funding. …and I’ve been on board for 8 or 9 months now.

One last try before I completely give up:

DEBUG Unrecoverable error {“error”: “Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_\n\tstorj.io/storj/private/dbutil/txutil.WithTx:44\n\tstorj.io/storj/private/migrate.(*Migration).Run:170\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).CreateTables:275\n\tmain.cmdRun:188\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”, “errorVerbose”: “Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_\n\tstorj.io/storj/private/dbutil/txutil.WithTx:44\n\tstorj.io/storj/private/migrate.(*Migration).Run:170\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).CreateTables:275\n\tmain.cmdRun:188\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203\n\tmain.cmdRun:190\n\tstorj.io/storj/pkg/process.cleanup.func1.2:307\n\tstorj.io/storj/pkg/process.cleanup.func1:325\n\tgithub.com/spf13/cobra.(*Command).execute:826\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:914\n\tgithub.com/spf13/cobra.(*Command).Execute:864\n\tstorj.io/storj/pkg/process.ExecWithCustomConfig:84\n\tstorj.io/storj/pkg/process.ExecCustomDebug:66\n\tmain.main:328\n\truntime.main:203”}

How is your HDD connected ?

First, thanks for helping out. I appreciate it.

My hard drive is connected directly to the motherboard via eSATA.

I am simply paying it forward.

Have you tried the steps from your earlier topic ?

So, I followed the instructions at

and I ran an integrity check on EVERY SINGLE DATABASE FILE.

Found that the orders.db file was a complete mess.

I’m continuing with the instructions and right now, the system is RE-building the orders.db file for me. It’s gonna take forever. Hopefully, this might make things right.

1 Like

One interesting find was that I got the following response when I ran the integrity check.

used_serial.db is not a database

That’s a weird one. Any idea on that one?

Did you happen to check to see if the hard drive had any bad sectors?

@deathlessdd I did. The check found no errors.

However, this one still concerns me:
docker run --rm -it --mount type=bind,source=d:\data\storage\used_serial.db,destination=/used_serial.db sstc/sqlite3 sqlite3 /used_serial.db “PRAGMA integrity_check;”
Error: file is not a database

I am thinking that this may have been the original source of the whole problem.

Hold on your using docker still on windows? I feel like if you had the same issue twice with docker, You should probably move to the GUI in windows instead since docker is very unstable in windows.

1 Like