I did some basic searching throughout the forums and eventually found the support document regarding malformed database files, but the problem is that when I scan the .db files in a row, it outputs the following
bandwidth.db ok
heldamount.db ok
info.db ok
notifications.db ok
Error: file is not a database
orders.db
pieceinfo.db ok
piece_expiration.db ok
piece_spaced_used.db ok
pricing.db ok
reputation.db ok
satellites.db ok
storage_usage.db ok
used_serial.db ok
and when I scan them individually it outputs the following
PS G:\Storj\storage> sqlite3 /bandwidth.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /heldamount.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /info.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /notifications.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /orders.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /pieceinfo.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /piece_expiration.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /piece_spaced_used.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /pricing.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /reputation.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /satellites.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /storage_used.db “PRAGMA integrity_check;”
ok
PS G:\Storj\storage> sqlite3 /used_serial.db “PRAGMA integrity_check;”
ok
Either there’s a hidden database file I’m not finding, or something’s very screwy with sqlite3. Any assistance anyone can give would be greatly appreciated.
P.S. Already ran a chkdsk, came back clean. Although I will state upfront that I did have a problem with the disk yesterday that was since resolved (orphaned file, returned to original database)
Thank you for reminding me that sqlite3 was written for cmd not powershell (forgot to remove the /). I’m now able to identify that the issue is with the orders.db file. I’ll be doing further investigation regarding how to repair that.
Just in case this helps further, here’s the output you asked for.
PS G:\Storj> ls
Directory: G:\Storj
Mode LastWriteTime Length Name
d----- 7/14/2020 10:11 AM blobs
d----- 7/14/2020 10:11 AM garbage
d----- 7/31/2020 1:48 PM storage
d----- 1/21/2020 6:50 PM storagenode
d----- 7/14/2020 10:11 AM temp
d----- 7/14/2020 10:11 AM trash
-a---- 7/14/2020 10:28 AM 32768 bandwidth.db
-a---- 6/26/2020 5:37 PM 6932 config.yaml
-a---- 1/21/2020 6:54 PM 6934 config_old.yaml
-a---- 7/14/2020 10:28 AM 24576 heldamount.db
-a---- 7/14/2020 10:28 AM 16384 info.db
-a---- 10/3/2019 4:57 PM 131072 kademlia
-a---- 7/14/2020 10:28 AM 24576 notifications.db
-a---- 7/14/2020 10:28 AM 32768 orders.db
-a---- 7/14/2020 10:28 AM 24576 pieceinfo.db
-a---- 7/14/2020 10:28 AM 36864 piece_expiration.db
-a---- 7/14/2020 10:28 AM 24576 piece_spaced_used.db
-a---- 7/14/2020 10:28 AM 24576 pricing.db
-a---- 7/14/2020 10:28 AM 24576 reputation.db
-a---- 7/14/2020 8:02 AM 32768 revocations.db
-a---- 7/14/2020 10:28 AM 32768 satellites.db
-a---- 7/14/2020 10:28 AM 20480 storage_usage.db
-a---- 7/14/2020 8:02 AM 1430 trust-cache.json
-a---- 7/14/2020 10:28 AM 20480 used_serial.db
PS G:\Storj\storage> ls
Directory: G:\Storj\storage
Mode LastWriteTime Length Name
d----- 4/27/2020 8:30 PM blobs
d----- 7/31/2020 9:51 AM db_backups
d----- 7/31/2020 9:38 AM garbage
d----- 7/31/2020 9:38 AM temp
d----- 5/11/2020 4:27 PM trash
-a---- 7/31/2020 1:49 AM 16089088 bandwidth.db
-a---- 7/31/2020 9:53 AM 53248 heldamount.db
-a---- 7/31/2020 9:38 AM 16384 info.db
-a---- 7/31/2020 9:53 AM 24576 notifications.db
-a---- 7/31/2020 7:53 AM 529207296 orders.db
-a---- 7/31/2020 9:53 AM 24576 pieceinfo.db
-a---- 7/31/2020 9:53 AM 147456 piece_expiration.db
-a---- 7/31/2020 9:53 AM 24576 piece_spaced_used.db
-a---- 7/31/2020 9:53 AM 24576 pricing.db
-a---- 7/31/2020 9:53 AM 24576 reputation.db
-a---- 7/31/2020 9:53 AM 32768 satellites.db
-a---- 7/31/2020 9:53 AM 286720 storage_usage.db
-a---- 7/31/2020 9:53 AM 50450432 used_serial.db
You have two collections of storagenode’s data. If you migrated recently, you could be disqualified as soon as you bring it online. G:\Storj\ looks like a Windows GUI path, the G:\Storj\storage looks like a docker path.
What is your current version?
Hm maybe even three version. I see the G:\Storj\storagenode too
Please, show the result of the PowerShell command:
I did the migration from docker to GUI quite a bit ago, although I recently had to reset my machine due to bluescreens so everything might not be in the right place.
Okay, as an update, I was able to follow the directions within the support document for malformed database files, sqlite3 basically results in the same error that the storagenode was running into, when attempting to dump it just says it’s not a database file. Is there anything I can do to rebuild this file?
We will fix the database later, but first we need to fix a probably wrong path.
Do you run the same identity as for a docker node?
What was your docker run command?
Ok, but from where is G:\Storj\blobs and database files in the G:\Storj\?
To fix the orders.db:
Stop the storagenode
Remove the G:\Storj\storage\orders.db
Execute
sqlite3 G:\Storj\storage\orders.db
CREATE TABLE unsent_order (
satellite_id BLOB NOT NULL,
serial_number BLOB NOT NULL,
order_limit_serialized BLOB NOT NULL, -- serialized pb.OrderLimit
order_serialized BLOB NOT NULL, -- serialized pb.Order
order_limit_expiration TIMESTAMP NOT NULL, -- when is the deadline for sending it
uplink_cert_id INTEGER NOT NULL,
FOREIGN KEY(uplink_cert_id) REFERENCES certificate(cert_id)
);
CREATE TABLE order_archive_ (
satellite_id BLOB NOT NULL,
serial_number BLOB NOT NULL,
order_limit_serialized BLOB NOT NULL,
order_serialized BLOB NOT NULL,
uplink_cert_id INTEGER NOT NULL,
status INTEGER NOT NULL,
archived_at TIMESTAMP NOT NULL,
FOREIGN KEY(uplink_cert_id) REFERENCES certificate(cert_id)
);
CREATE UNIQUE INDEX idx_orders ON unsent_order(satellite_id, serial_number);
CREATE TABLE versions (version int, commited_at text);
.exit
I checked Storj/blobs and it looks like that folder is empty currently while storj/storage/blobs has 6 folders.
I ran what you typed in and it encountered errors at order_serialized BLOB NOT NULL, – serialized pb.Order during unsent_order:
At line:4 char:91
+ ... order_limit_serialized BLOB NOT NULL, -- seri ...
+ ~
Missing expression after ',' in pipeline element.
At line:4 char:119
+ ... rder_limit_serialized BLOB NOT NULL, -- serialized pb.OrderLimit
+ ~
Missing closing ')' in expression.
At line:5 char:91
+ ... order_serialized BLOB NOT NULL, -- seri ...
+ ~
Missing expression after ',' in pipeline element.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpression
Seems to be running fine now after doing that, here’s the output from the log.
2020-08-01T13:22:57.379-0500 INFO Telemetry enabled
2020-08-01T13:22:57.386-0500 INFO db.migration.27 Add index archived_at to ordersDB
2020-08-01T13:22:57.424-0500 INFO db.migration Database Version {"version": 43}
2020-08-01T13:22:58.386-0500 INFO preflight:localtime start checking local system clock with trusted satellites' system clock.
2020-08-01T13:22:59.255-0500 INFO preflight:localtime local system clock is in sync with trusted satellites' system clock.
2020-08-01T13:22:59.256-0500 INFO bandwidth Performing bandwidth usage rollups
2020-08-01T13:22:59.257-0500 INFO Node 12CMjYzRsLfx6GAjMTPg9JQ8sJWwpTuDNmVUEMR1Kavd77pgMpv started
2020-08-01T13:22:59.257-0500 INFO Public server started on [::]:28967
2020-08-01T13:22:59.257-0500 INFO Private server started on 127.0.0.1:7778
2020-08-01T13:22:59.259-0500 INFO trust Scheduling next refresh {"after": "3h40m56.956315756s"}
Based on the total disk space module on the dashboard, it seems to be successfully grabbing everything correctly.