Storage node preflight database error: file is not a database

Then

  1. Stop the storagenode
  2. Check disk
  3. Remove the bandwidth.db if it’s still zero
  4. Execute (replace the /path/to/the/data/storage with your actual path to the databases):
docker run -it --rm --mount type=bind,source=/path/to/the/data/storage,destination=/data sstc/sqlite3 sqlite3 bandwidth.db
CREATE TABLE bandwidth_usage (
                                                satellite_id  BLOB    NOT NULL,
                                                action        INTEGER NOT NULL,
                                                amount        BIGINT  NOT NULL,
                                                created_at    TIMESTAMP NOT NULL
                                        );
CREATE INDEX idx_bandwidth_usage_satellite ON bandwidth_usage(satellite_id);
CREATE INDEX idx_bandwidth_usage_created   ON bandwidth_usage(created_at);
CREATE TABLE bandwidth_usage_rollups (
                                                                                interval_start  TIMESTAMP NOT NULL,
                                                                                satellite_id    BLOB    NOT NULL,
                                                                                action          INTEGER NOT NULL,
                                                                                amount          BIGINT  NOT NULL,
                                                                                PRIMARY KEY ( interval_start, satellite_id, action )
                                                                        );
.exit
  1. Try to start the node