Error: Error starting master database on storagenode: database: bandwidth opening file "config/storage/bandwidth.db" failed: file is not a database

so my linux server crashed … i have multiple nodes on it … but i saw 1 node had issues , didn’t show any info on the web interface like traffic, bandwidth etc … stopped the node and tried to start it again and i get this error :
Error: rpc: dial tcp 127.0.0.1:7778: connect: connection refused

from docker logs storagenode i get this :

Error: Error starting master database on storagenode: database: bandwidth opening file “config/storage/bandwidth.db” failed: file is not a database

so yeah i figured bandwidth.db is bad …

root@SERVER1:/mnt/storj1/storage# sqlite3 bandwidth.db “PRAGMA integrity_check;”
Error: file is not a database

dont understand what happend … and dont see what i can do … i tried all ways to fix the database but since sqlite3 doesn’t see it as a database , don’t see a fix here

root@SERVER1:/mnt/storj1/storage# sqlite3 bandwidth.db “PRAGMA integrity_check;”
Error: file is not a database
root@SERVER1:/mnt/storj1/storage# sqlite3 info.db “PRAGMA integrity_check;”
ok
root@SERVER1:/mnt/storj1/storage# sqlite3 orders.db “PRAGMA integrity_check;”
ok
root@SERVER1:/mnt/storj1/storage# sqlite3 piece_expiration.db “PRAGMA integrity_check;”
ok
root@SERVER1:/mnt/storj1/storage# sqlite3 pieceinfo.db “PRAGMA integrity_check;”
ok
root@SERVER1:/mnt/storj1/storage#

Unfortunately that’s a bit of a nasty error. You can recover the function of your node though, but you’ll have lost bandwidth stats on the dashboard and other tools.

See the instructions here on how to recover: https://support.storj.io/hc/en-us/articles/4403032417044-How-to-fix-database-file-is-not-a-database-error

1 Like

tried that already and didn’t work for me

Where did you get stuck?

i just started it somehow … it went up … when i try :
docker exec -it storagenode1 /app/dashboard.sh i still get this error :slight_smile:
Error: rpc: dial tcp 127.0.0.1:7778: connect: connection refused

but the node is up … missing info like what was used this month … but at least its up

i moved all *.db from backup but didnt copy the bandwidth.db witch gave file is not a database error

Not sure from your description whether you did it exactly right. If you follow the steps you essentially move the databases away, so the node recreates them. Then you stop the node and move the correct ones back to the original location (skipping the corrupt bandwidth.db). Essentially this has you end up with the bandwidth.db being replaced by an empty clean one, while keeping all others as is. If you follow these steps, the bandwidth.db issue will be solved. But it’s possible you have other corrupted db’s as well. Did you check them all? You didn’t post a complete list.

yes thats exactly how i did it !

yes just that one was corrupt i pasted up … the others seem fine

Maybe you tried the dashboard too soon. With the new image it takes a bit for the node to be downloaded and started. Is the dashboard still throwing an error?

Please note, that’s not a full list of db’s. It’s fine if you tested them all. Just making sure that’s not the only ones you tested.

no, i did after 2 mins 5 mins … same error … i just restarted the node again and now the dashboard works fine to … beside missing Bandwitdh stats on the dashboard web interface all seems fine

thanks for the help and replies …

1 Like

logs looks good now:

2022-06-27T07:04:44.092Z INFO piecestore downloaded {“Process”: “storagenode”, “Piece ID”: “WOEDHYDTFZAAUDCMV5XQ6PRWDTQO6OXRV3ZHLXEWUBF6LD562M3Q”, “Satellite ID”: “1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE”, “Action”: “GET”}
2022-06-27T07:04:45.256Z INFO piecestore download started {“Process”: “storagenode”, “Piece ID”: “WOEDHYDTFZAAUDCMV5XQ6PRWDTQO6OXRV3ZHLXEWUBF6LD562M3Q”, “Satellite ID”: “1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE”, “Action”: “GET”}
2022-06-27T07:04:46.944Z INFO piecestore download started {“Process”: “storagenode”, “Piece ID”: “TPXYTFBNLVGOVHAKSMFN5DOG5JUKARO7WQKWUU32RRPHO2PV34XQ”, “Satellite ID”: “12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S”, “Action”: “GET”}
2022-06-27T07:04:47.765Z INFO piecestore downloaded {“Process”: “storagenode”, “Piece ID”: “TPXYTFBNLVGOVHAKSMFN5DOG5JUKARO7WQKWUU32RRPHO2PV34XQ”, “Satellite ID”: “12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S”, “Action”: “GET”}
2022-06-27T07:04:48.709Z INFO piecestore downloaded {“Process”: “storagenode”, “Piece ID”: “WOEDHYDTFZAAUDCMV5XQ6PRWDTQO6OXRV3ZHLXEWUBF6LD562M3Q”, “Satellite ID”: “1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE”, “Action”: “GET”}
2022-06-27T07:04:56.474Z INFO piecedeleter delete piece sent to trash {“Process”: “storagenode”, “Satellite ID”: “12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S”, “Piece ID”: “BEYK53M6LG3SYZEW623FGAWHGQYOQ2OHTI6OGPJMAVM6AS2UVCDQ”}
2022-06-27T07:05:07.963Z INFO piecedeleter delete piece sent to trash {“Process”: “storagenode”, “Satellite ID”: “12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S”, “Piece ID”: “4MGAV724R5FFELLUWX3WICFOUC7XL75NEIYDEJXLD3D4LHZSSSUQ”}
2022-06-27T07:05:36.334Z INFO piecestore download started {“Process”: “storagenode”, “Piece ID”: “VM6GTF35SXD3J2LNL6PASQTQEFHAVPDXHSV3SN2VN5AQ7QSV4EUA”, “Satellite ID”: “12L9ZFwhzVpuEKMUNUqkaTLGzwY9G24tbiigLiXpmZWKwmcNDDs”, “Action”: “GET_REPAIR”}