Bandwidthdb error: no such table: bandwidth_usage_rollups

docker pull storjlabs/storagenode

2020-03-24T19:31:35.440+0300 INFO storagenode/peer.go:452 Node 1WGxwSP2bKhpt4KJ3ZcoS6C4JWd9PhT9YjKFA8AK7BdYaJsckw started
2020-03-24T19:31:35.440+0300 INFO storagenode/peer.go:453 Public server started on [::]:28967
2020-03-24T19:31:35.440+0300 INFO storagenode/peer.go:454 Private server started on 127.0.0.1:7778
2020-03-24T19:31:35.441+0300 FATAL process/exec_conf.go:288 Unrecoverable error {“error”: “bandwidthdb error: no such table: bandwidth_usage_rollups”, “errorVerbose”: “bandwidthdb error: no such table: bandwidth_usage_rollups\n\tstorj.io/storj/storagenode/storagenodedb.(*bandwidthDB).Summary:112\n\tstorj.io/storj/storagenode/storagenodedb.(*bandwidthDB).MonthSummary:79\n\tstorj.io/storj/storagenode/monitor.(*Service).usedBandwidth:174\n\tstorj.io/storj/storagenode/monitor.(*Service).Run:83\n\tstorj.io/storj/storagenode.(*Peer).Run.func6:436\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57”}
storj.io/storj/pkg/process.cleanup.func1
/go/src/storj.io/storj/pkg/process/exec_conf.go:288
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
storj.io/storj/pkg/process.Exec
/go/src/storj.io/storj/pkg/process/exec_conf.go:73
main.main
/go/src/storj.io/storj/cmd/storagenode/main.go:296
runtime.main
/usr/local/go/src/runtime/proc.go:203

Can you show your docker run command ? Please remove any personal info from it.

sudo docker run -d --restart unless-stopped -p 28967:28967 -p 14002:14002 -e WALLET=“0xWallet” -e EMAIL="mail@gmail.com" -e ADDRESS=“localhost:28967” -e BANDWIDTH=“20PB” -e STORAGE=“970GB” -v /etc/localtime:/etc/localtime:ro --mount type=bind,source="/home/user/storj",destination=/app/identity --mount type=bind,source="/mnt/disk1/storj",destination=/app/config --name storagenode storjlabs/storagenode
address,wallet,email replace

-e ADDRESS=“localhost:28967”

This should not be “localhost” it should be an external IP address or the DDNS you configured and the port you opened on your router

Please try using this template:

docker run -d --restart unless-stopped --stop-timeout 300 \
-p 28967:28967 \
-p 127.0.0.1:14002:14002 \
-e WALLET="0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-e EMAIL="user@example.com" \
-e ADDRESS="domain.ddns.net:28967" \
-e STORAGE="2TB" \
--mount type=bind,source="<identity-dir>",destination=/app/identity \
--mount type=bind,source="<storage-dir>",destination=/app/config \
--name storagenode storjlabs/storagenode:beta

address,wallet,email replace

  1. Stop the storagenode
  2. Make a backup of bandwidth.db (for example - just copy it to bandwidth.db.bak)
  3. Execute either with a local installed sqlite3 or with a docker container (see https://support.storj.io/hc/en-us/articles/360029309111-How-to-fix-a-database-disk-image-is-malformed- for reference):
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 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 )
                                                                        );
CREATE INDEX idx_bandwidth_usage_satellite ON bandwidth_usage(satellite_id);
CREATE INDEX idx_bandwidth_usage_created   ON bandwidth_usage(created_at);
.exit
  1. Try to start storagenode and take a look into logs.