Today, my node turned out not to work anymore after restart. Log is showing this:
2024-05-08T06:56:21Z INFO db.migration.26 Add Trash column to pieceExpirationDB {"Process": "storagenode"}
2024-05-08T06:56:21Z ERROR failure during run {"Process": "storagenode", "error": "Error migrating tables for database on storagenode: migrate: v26: duplicate column name: trash\n\tstorj.io/storj/private/migrate.(*Migration).Run:212\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:387\n\tmain.cmdRun:98\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:393\n\tstorj.io/common/process.cleanup.func1:411\n\tgithub.com/spf13/cobra.(*Command).execute:983\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1115\n\tgithub.com/spf13/cobra.(*Command).Execute:1039\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:267", "errorVerbose": "Error migrating tables for database on storagenode: migrate: v26: duplicate column name: trash\n\tstorj.io/storj/private/migrate.(*Migration).Run:212\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:387\n\tmain.cmdRun:98\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:393\n\tstorj.io/common/process.cleanup.func1:411\n\tgithub.com/spf13/cobra.(*Command).execute:983\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1115\n\tgithub.com/spf13/cobra.(*Command).Execute:1039\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:267\n\tmain.cmdRun:100\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:393\n\tstorj.io/common/process.cleanup.func1:411\n\tgithub.com/spf13/cobra.(*Command).execute:983\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1115\n\tgithub.com/spf13/cobra.(*Command).Execute:1039\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:267"}
Error: Error migrating tables for database on storagenode: migrate: v26: duplicate column name: trash
storj.io/storj/private/migrate.(*Migration).Run:212
storj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:387
main.cmdRun:98
main.newRunCmd.func1:33
storj.io/common/process.cleanup.func1.4:393
storj.io/common/process.cleanup.func1:411
github.com/spf13/cobra.(*Command).execute:983
github.com/spf13/cobra.(*Command).ExecuteC:1115
github.com/spf13/cobra.(*Command).Execute:1039
storj.io/common/process.ExecWithCustomOptions:112
main.main:34
runtime.main:267
2024-05-08 06:56:21,181 INFO exited: storagenode (exit status 1; not expected)
This error is as far I can see, is more prevalent lately and seems to happen after recurrent upgrade (I use docker, before this happened the docket container was removed and restarted in an older version) > log also shows a trial of addition of the column.
Interestingly, the database file itself doesn’t seems to be corrupted:
root@STORJ4:/storj/DBs# sqlite3 "piece_expiration.db" 'PRAGMA integrity_check;'
ok
So, this seems to be a bug: it tries to migrate an already migrated DB.
Version:
2024-05-08T06:56:12Z INFO Current binary version {"Process": "storagenode-updater", "Service": "storagenode", "Version": "v1.102.3"}
2024-05-08T06:56:12Z INFO Version is up to date {"Process": "storagenode-updater", "Service": "storagenode"}
2024-05-08T06:56:12Z INFO Current binary version {"Process": "storagenode-updater", "Service": "storagenode-updater", "Version": "v1.102.3"}
2024-05-08T06:56:12Z INFO Version is up to date {"Process": "storagenode-updater", "Service": "storagenode-updater"}
Besides, couldn’t there an option implemented, like: storage.recreateDBOnFailure?
Furthermore, it would be helpful if the reported error mentioned the database which the error pertains to. I now had to read up the log (these rules are extracted from a bigger log): the error is mentioned three times, but the actual filename I had to recover from an INFO-line.