Storj log states order.db is not a database file, node won't start

Initially I thought the install of the node software that runs the Windows service was damaged and the service was not running for some reason. I uninstalled and reinstalled Storj several times and each time provided the backed-up identity, payout address and email address, then provided the shared storage location. The node would not come back up.

I then checked the log file and found an error stating that a file was not a database. I have tried to follow the instructions on repairing the one database that is affected. Only one file is apparently malformed and that’s orders.db. I followed the Windows Power Shell commands right up to repopulating the new file but it errored leaving the new orders.db file at zero length. Is there any hope for this node? Can anyone help me reconstruct the order.db file please? Is this file able to be replaced and regenerated by Storj node service somehow?

Hello @Rapturoso,
Welcome to the forum!

The orders.db is not a database file cannot be fixed with a How to fix a “database disk image is malformed” guide.

  1. Please, stop the storagenode service from the elevated PowerShell:
Stop-Service storagenode
  1. Remove the corrupted orders.db file
  2. Execute either with a local installed sqlite3 or a docker version from the mentioned guide (replace the path “/path/to/storage/with/orders.db” to the right one):
sqlite3 /path/to/storage/with/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
  1. Start the storagenode
  2. Check your logs
2 Likes

I could started my node too.