Error: Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_

Please, stop the node and execute:

sqlite3 piece_expiration.db
drop test_table;
.exit

And try to start the node

Sorry it’s still restarting.
And with the command: “drop test_table;”
I get:
sqlite> drop test_table;
Error: near “test_table”: syntax error

logs:
2020-03-16T23:15:39.097Z INFO version running on version v0.34.6
2020-03-16T23:15:39.176Z INFO db.migration Database Version {“version”: 31}
2020-03-16T23:15:40.761Z INFO Got a signal from the OS: “terminated”
Error: Error during preflight check for storagenode databases: storage node preflight database error: piece_spaced_used: expected schema does not match actual: &dbschema.Schema{
Tables: *dbschema.Table{
&{Name: “piece_space_used”, Columns: *dbschema.Column{&{Name: “content_size”, Type: “INTEGER”}, &{Name: “satellite_id”, Type: “BLOB”, IsNullable: true}, &{Name: “total”, Type: “INTEGER”}}},

  1. Stop the storagenode
  2. execute
sqlite3 piece_space_used.db
drop table test_table;
.exit

Thanks for all your replies but is still not working :frowning:

command:
sqlite> drop table test_table;
Error: no such table: test_table
sqlite> .exit

logs: (much longer this time…??):
2020-03-17T20:14:51.479Z INFO Configuration loaded from: /app/config/config.yaml
2020-03-17T20:14:51.484Z INFO Operator email: ***************
2020-03-17T20:14:51.485Z INFO operator wallet: **************************************
2020-03-17T20:14:52.658Z INFO version running on version v0.34.6
2020-03-17T20:14:52.766Z INFO db.migration Database Version {“version”: 31}
Error: Error during preflight check for storagenode databases: storage node preflight database error: piece_spaced_used: expected schema does not match actual: &dbschema.Schema{
Tables: *dbschema.Table{
&{Name: “piece_space_used”, Columns: *dbschema.Column{&{Name: “content_size”, Type: “INTEGER”}, &{Name: “satellite_id”, Type: “BLOB”, IsNullable: true}, &{Name: “total”, Type: “INTEGER”}}},

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Tables: nil,

Unfortunately this db file is misspelled in the installation. So the command should be.

sqlite3 piece_spaced_used.db
drop table test_table;
.exit

And actually a few more have the same issue.

sqlite3 storage_usage.db
drop table test_table;
.exit
sqlite3 piece_expiration.db
drop table test_table;
.exit
sqlite3 reputation.db
drop table test_table;
.exit

There is an issue with used_serial as well, but I’m not entirely sure what.

I really wonder what happened to this node to have so many different database issues…

Again Thanks for all the help. The node had no problems from sept. 2019
I’ve been on vacation when the node went offline.
Mabybe a power outtage which corrupted my databases? I really do not know…
Is it easier to startup a new node?
Can I use the same identity (email and authorisation code)?
Can I take my reputaion with me?
Thx again!

Commands I tried this time on your request:

pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sqlite3 piece_spaced_used.db SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite> drop table test_table; sqlite> .exit pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sqlite3 storage_usage.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter “.help” for usage hints.
sqlite> drop table test_table;
sqlite> .exit
pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sqlite3 piece_expiration.db SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite> drop table test_table; sqlite> .exit pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sqlite3 reputation.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter “.help” for usage hints.
sqlite> drop table test_table;
sqlite> .exit
pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage $

Status:
pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 500c4f0a40c3 storjlabs/storagenode:beta "/entrypoint" 41 seconds ago Up 6 seconds 0.0.0.0:14002->14002/tcp, 0.0.0.0:28967->28967/tcp storagenode pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b0b2cc04e5e storjlabs/storagenode:beta “/entrypoint” 2 minutes ago Restarting (1) 42 seconds ago storagenode
pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage $

Again lots news in logs:
2020-03-17T22:56:01.326Z INFO Configuration loaded from: /app/config/config.yaml
2020-03-17T22:56:01.331Z INFO Operator email: **************
2020-03-17T22:56:01.331Z INFO operator wallet: ***************************************
2020-03-17T22:56:01.896Z INFO version running on version v0.34.6
2020-03-17T22:56:01.962Z INFO db.migration Database Version {“version”: 31}
Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Tables: nil,
  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
sqlite3 used_serial.db
CREATE TABLE used_serial_ (
                                                satellite_id  BLOB NOT NULL,
                                                serial_number BLOB NOT NULL,
                                                expiration    TIMESTAMP NOT NULL
                                        );
CREATE UNIQUE INDEX pk_used_serial_ ON used_serial_(satellite_id, serial_number);
CREATE INDEX idx_used_serial_ ON used_serial_(expiration);
.exit

Looks like a huge damage to the databases.
Have you had a power outage?

See my previous answer and some questions…

With a new node you will lose the gained reputation and held amount, so better to fix it.

If you want to start over, then you need to generate a new identity, request a new authorization token and start with clean data.

Also satellites.db seems to have this test table as well.

sqlite3 satellites.db
drop table test_table;
.exit

Still restarting…

pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 57b92a269b51 storjlabs/storagenode:beta "/entrypoint" 4 minutes ago Restarting (1) 2 seconds ago storagenode pi@gekkojoris:/mnt/STORJ/_STORJ-DATA/storage

Alle the log errors are now too big for one post, forum says:
Body is limited to 32000 characters; you entered 35311.
So I skipped the last lines…

2020-03-18T18:51:52.059Z INFO Configuration loaded from: /app/config/config.yaml
2020-03-18T18:51:52.064Z INFO Operator email: ***************
2020-03-18T18:51:52.065Z INFO operator wallet: *****************************************
2020-03-18T18:51:53.886Z INFO version running on version v0.34.6
2020-03-18T18:51:53.935Z INFO db.migration Database Version {“version”: 31}
Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

2020-03-18T18:52:25.218Z INFO db.migration Database Version {“version”: 31}
Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: info: expected schema does not match actual: &dbschema.Schema{

  • Tables: nil,
  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "test_table",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "id", Type: "int"},
    
  •   		&{Name: "name", Type: "varchar(30)", IsNullable: true},
    
  •   	},
    
  •   	PrimaryKey: []string{"id"},
    
  •   },
    
  • },
    Indexes: nil,
    }

Error: Error during preflight check for storagenode databases: storage node preflight database error: used_serial: expected schema does not match actual: &dbschema.Schema{

  • Tables: *dbschema.Table{
  •   &{
    
  •   	Name: "used_serial_",
    
  •   	Columns: []*dbschema.Column{
    
  •   		&{Name: "expiration", Type: "TIMESTAMP"},
    
  •   		&{Name: "satellite_id", Type: "BLOB"},
    
  •   		&{Name: "serial_number", Type: "BLOB"},
    
  •   	},
    
  •   },
    
  • },
  • Tables: nil,
  • Indexes: *dbschema.Index{
  •   &{Name: "idx_used_serial_", Table: "used_serial_", Columns: []string{"expiration"}},
    
  •   &{
    
  •   	Name:    "pk_used_serial_",
    
  •   	Table:   "used_serial_",
    
  •   	Columns: []string{"satellite_id", "serial_number"},
    
  •   },
    
  • },
  • Indexes: nil,
    }

Maybe its better to start all over again…?
Too bad for my gained reputation and held amount but repairing isn’t really working is it? ;-(
Or are the error logs really helpful for developing better STORJ software?
If else I can wait some time and maybe in the future there will be an better version or it’s easier to repair the databases when they get corrupted…

sqlite3 info.db
drop table test_table;
.exit

Then this one

1 Like

Sorry for late reply. There where some other things which where more important…
But…
It’s working now :slight_smile:

Thanks a lot!!

2 Likes

I will try adding that table, but there are also errors with ordersdb

ordersdb error: no such table: order_archive_
ordersdb error: no such table: unsent_order

The solution: Error: Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_

Hi All.

Trying to migrate from 1 host to another. I copied the identity folder along with the data but when I try to run on the new host I receive this error in the logs …

2020-09-05T00:42:17.061+0100 FATAL Unrecoverable error {“error”: “Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_\n\tstorj.io/storj/private/migrate.SQL.Run:274\n\tstorj.io/storj/private/migrate.(*Migration).Run.func1:179\n\tstorj.io/storj/private/dbutil/txutil.withTxOnce:75\n\tstorj.io/storj/private/dbutil/txutil.WithTx:36\n\tstorj.io/storj/private/migrate.(*Migration).Run:178\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:386\n\tmain.cmdRun:184\n\tstorj.io/private/process.cleanup.func1.4:353\n\tstorj.io/private/process.cleanup.func1:371\n\tgithub.com/spf13/cobra.(*Command).execute:840\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:945\n\tgithub.com/spf13/cobra.(*Command).Execute:885\n\tstorj.io/private/process.ExecWithCustomConfig:88\n\tstorj.io/private/process.Exec:65\n\tmain.(*service).Execute.func1:66\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57”, “errorVerbose”: “Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_\n\tstorj.io/storj/private/migrate.SQL.Run:274\n\tstorj.io/storj/private/migrate.(*Migration).Run.func1:179\n\tstorj.io/storj/private/dbutil/txutil.withTxOnce:75\n\tstorj.io/storj/private/dbutil/txutil.WithTx:36\n\tstorj.io/storj/private/migrate.(*Migration).Run:178\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:386\n\tmain.cmdRun:184\n\tstorj.io/private/process.cleanup.func1.4:353\n\tstorj.io/private/process.cleanup.func1:371\n\tgithub.com/spf13/cobra.(*Command).execute:840\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:945\n\tgithub.com/spf13/cobra.(*Command).Execute:885\n\tstorj.io/private/process.ExecWithCustomConfig:88\n\tstorj.io/private/process.Exec:65\n\tmain.(*service).Execute.func1:66\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57\n\tmain.cmdRun:186\n\tstorj.io/private/process.cleanup.func1.4:353\n\tstorj.io/private/process.cleanup.func1:371\n\tgithub.com/spf13/cobra.(*Command).execute:840\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:945\n\tgithub.com/spf13/cobra.(*Command).Execute:885\n\tstorj.io/private/process.ExecWithCustomConfig:88\n\tstorj.io/private/process.Exec:65\n\tmain.(*service).Execute.func1:66\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57”}

Any idea what would cause this issue?

Seems when migrated you didn’t run the last rsync with a --delete option when the source node is stopped.
Thus you have had wal files in the destination and they are applied to the databases when you start a new node, now perhaps every single database is corrupted.

  1. Stop the storagenode
  2. Create a backup of orders.db
  3. Delete orders.db
  4. Execute either with a local sqlite3 or with a docker version (you can take a docker version from this guide: https://support.storj.io/hc/en-us/articles/360029309111), replace the /path/to/orders.db to your actual path:
sqlite3 /path/to/orders.db
  1. When you see a sqlite> prompt execute this script:
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

Hi Alexey.

Thanks for the reply. I ran that and all is back working again !

That is strange though as the storage is on a iscsi lun so no data required copying in that sense. I guess the node did not stop cleanly on the old server thus leaving the ‘open’ files on the lun which the new node then didn’t like ?

Thanks.

1 Like

This is happening much often with network connected drives than with local connected. Any lost network packet could corrupt a database. If you want to use an iSCSI, you should have a proper hardware to handle that. The SOHO hardware is not suitable well for such use cases unfortunately, so it’s better to avoid using any network connected drives for storagenode.
The USB should be used only if there is no possibility to connect to SATA directly.