Error: Error migrating tables for database on storagenode: migrate: v29: no such table: piece_space_used

Hello,
I have one Node that keeps struggling with Correct Disk space used after migrating to hashstore. It constantly shows 500Gb overused despide it haven 58% Disk usage.
So i decided that i want to recreate the usage Databases but not the other ones, so i can keep my stats. Now my Node is in a crashing loop, because the Database is missing. I thougt it will recreate itif missing?

025-03-29T15:26:38Z    INFO    db.migration.29 Migrate piece_space_used to add total column    {"Process": "storagenode"}
2025-03-29T15:26:38Z    ERROR   failure during run      {"Process": "storagenode", "error": "Error migrating tables for database on storagenode: migrate: v29: no such table: piece_space_used\n\tstorj.io/storj/private/migrate.(*Migration).Run:221\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:415\n\tmain.cmdRun:100\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:392\n\tstorj.io/common/process.cleanup.func1:410\n\tgithub.com/spf13/cobra.(*Command).execute:985\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1117\n\tgithub.com/spf13/cobra.(*Command).Execute:1041\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:272", "errorVerbose": "Error migrating tables for database on storagenode: migrate: v29: no such table: piece_space_used\n\tstorj.io/storj/private/migrate.(*Migration).Run:221\n\tstorj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:415\n\tmain.cmdRun:100\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:392\n\tstorj.io/common/process.cleanup.func1:410\n\tgithub.com/spf13/cobra.(*Command).execute:985\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1117\n\tgithub.com/spf13/cobra.(*Command).Execute:1041\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:272\n\tmain.cmdRun:102\n\tmain.newRunCmd.func1:33\n\tstorj.io/common/process.cleanup.func1.4:392\n\tstorj.io/common/process.cleanup.func1:410\n\tgithub.com/spf13/cobra.(*Command).execute:985\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:1117\n\tgithub.com/spf13/cobra.(*Command).Execute:1041\n\tstorj.io/common/process.ExecWithCustomOptions:112\n\tmain.main:34\n\truntime.main:272"}
Error: Error migrating tables for database on storagenode: migrate: v29: no such table: piece_space_used
        storj.io/storj/private/migrate.(*Migration).Run:221
        storj.io/storj/storagenode/storagenodedb.(*DB).MigrateToLatest:415
        main.cmdRun:100
        main.newRunCmd.func1:33
        storj.io/common/process.cleanup.func1.4:392
        storj.io/common/process.cleanup.func1:410
        github.com/spf13/cobra.(*Command).execute:985
        github.com/spf13/cobra.(*Command).ExecuteC:1117
        github.com/spf13/cobra.(*Command).Execute:1041
        storj.io/common/process.ExecWithCustomOptions:112
        main.main:34
        runtime.main:272

I have a copy of this DB but i dont want to use it, because my node thinks its full and Average Disk space is dropping fast.
How can i get the node to recreate the DB and to keep my Monthly Stats and Bandwith Data?

Thank you in advance
Marvi

Ps: Cause i forgot, those are my current files

Not what you want to hear… but any time I see a .db error… I just delete all the .db files and let the node start fresh. It’s only the stats in the UI, and doesn’t affect payouts: so they’re safe to toss overboard.

Now’s a good time: since it will start new graphs in a couple days anyways.

3 Likes

delete just used_space_per_prefix.db

And i wanted to keep all stats :cry: But thanks anyways for the help. Nothing else helped and i had to do a full db wipe

Another Question: If i delete all DBs, do i have to create a new key for the Multinode Dashboard?

Edit: was able to recover it by copying the secret.db

Then you can use this guide:

It will allow you to recreate only this database.

Thanks for the link, but unfortunately it didn’t work. I moved all databases to an new location and restarted the node. Then moved all I wanted back to the node. But the node wouldn’t take the new ones. Either spitting out errors or not taking them.
The DBs are definitely good, cause if I move all back the stats are back to normal.
I proceeded with the unwanted way: Delete all DBs and loose all stats.
(Maybe I can edit the DBs by hand to add old records back🤔)

The node should be stopped when you move databases back. Also you need to remove a broken database(s) and move all remaining to the temp dir, start the node, wait until all databases are created back and all migrations are applied, then stop the node and move previous ones back to there.

If it throws an error on these old databases then perhaps you have several broken databases.

Also, please check - maybe you have moved databases to SSD, but now you are trying to restore databases in the old location.

Please also note that the node will re-create all databases only if there is no one remained. It is not able to create only missing ones.