Storj v3 Storage Node service not starting

You should specify the path to the database. It is placed in the storage folder, not in the installation dir.
So, something like

C:\Program Files\Storj\Storage Node>sqlite3 "X:\storagenode\storage\pieceinfo.db" "PRAGMA integrity_check;"

Because if the database doesn’t exist, the sqlite3 will create an empty one, and of course it will not being corrupted :slight_smile:
In you command the sqlite3 did exactly that - it created an empty database in your installation dir and successfully checked it :slight_smile:

To see, where your databases, you should check the storage folder

dir X:\storagenode

In the Windows GUI installation the databases are placed in the storage location.

Replace X:\storagenode or X:\storagenode\storage to your path

1 Like

D:\Storj\data\storage>sqlite3 orders.db “PRAGMA integrity_check;”
Error: file is not a database

Tried to fix the db file, but service still wouldn’t start

“File is not a database” can’t be fixed by article for malformed database

  1. Stop the storagenode
  2. Remove orders.db file
  3. Execute
sqlite3 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);
CREATE INDEX idx_order_archived_at ON order_archive_(archived_at);
.exit
  1. Start the storagenode
  2. Check logs

Thanks!

That got it running

1 Like

@snowsnail and @thev
Could you check is it still happening?

Hi Alexey. i think i have this same problem - my node wont start and i dont have the orders.db file anywhere - but i dont really understand the command and how to excecute it? whould it still work today?

No, it will not. Especially after the orders.db DB were converted to a plain text files more than a year ago.

Your storage must not be in %AppData% by the way, looks like you looking into a wrong location. It likely were created by wrongly issued setup command from the command line - without specify the config location, identity location and at least a storage location.

The setup step usually performed when you install storagenode with installation wizard.

yea i used the “program” to run my first node. ¨
But when i launch from the “correct” folder the node runs just fine - has been for 8 hours now. But it will not start automatically with windows.

This should be the correct folder.
So what do i do with alle the stuff in %appdata%?


As you can see i ofc. have my identity folders - that fine - but i also have the buttom folder “storagenode” in appdata

I think we solved an issue with service not starting here:

And now only cleanup. You can remove this %AppData%\Storj\Storagenode folder If you merged blobs folder to the blobs folder in the correct location, and the orders folder to the orders folder in your installation location (by default it’s "C:\Program Files\Storj\Storage Node\"), but you seems installed it to the "C:\Storj", so the orders folder should be there.
Just do not overwrite existing files during the merge, thus only new files will be added to the correct location.
This should prevent from disqualification for losing a new pieces while your node were running with a wrong config file.

Got it - thanks alot.
:smiley:

1 Like