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.

I am using 1.1.1, installed as per documentation.

storjlabs/storagenode:beta

The newer version is without the :beta, but if i install it and start it I am given errors

2020-04-25T19:50:02.387Z 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](https://tstorj.io/storj/storagenode/storagenodedb.(*bandwidthDB)).Summary:112\n\[tstorj.io/storj/storagenode/storagenodedb.(*bandwidthDB](https://tstorj.io/storj/storagenode/storagenodedb.(*bandwidthDB)).MonthSummary:79\n\[tstorj.io/storj/storagenode/monitor.(*Service](https://tstorj.io/storj/storagenode/monitor.(*Service)).usedBandwidth:174\n\[tstorj.io/storj/storagenode/monitor.(*Service](https://tstorj.io/storj/storagenode/monitor.(*Service)).Run:83\n\[tstorj.io/storj/storagenode.(*Peer](https://tstorj.io/storj/storagenode.(*Peer)).Run.func6:436\n\[tgolang.org/x/sync/errgroup.(*Group](https://tgolang.org/x/sync/errgroup.(*Group)).Go.func1:57"}

tried renaming bandwidth.db, no go. Cant updated. I am afraid of changing anything else in case I corrupt data.

golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:57
2020-04-25T19:54:53.159Z        ERROR   orders  orders/service.go:139   cleaning archive        {"error": "ordersdb error: no such table: order_archive_", "errorVerbose": "ordersdb error: no such table: order_archive_\n\tstorj.io/storj/storagenode/storagenodedb.(*ordersDB).CleanArchive:326\n\tstorj.io/storj/storagenode/orders.(*Service).cleanArchive:137\n\tstorj.io/storj/internal/sync2.(*Cycle).Run:87\n\tstorj.io/storj/internal/sync2.(*Cycle).Start.func1:68\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57"}
storj.io/storj/storagenode/orders.(*Service).cleanArchive
        /go/src/storj.io/storj/storagenode/orders/service.go:139
storj.io/storj/internal/sync2.(*Cycle).Run
        /go/src/storj.io/storj/internal/sync2/cycle.go:87
storj.io/storj/internal/sync2.(*Cycle).Start.func1
        /go/src/storj.io/storj/internal/sync2/cycle.go:68
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:57
2020-04-25T19:54:53.158Z        ERROR   orders  orders/service.go:156   listing orders  {"error": "ordersdb error: no such table: unsent_order", "errorVerbose": "ordersdb error: no such table: unsent_order\n\tstorj.io/storj/storagenode/storagenodedb.(*ordersDB).ListUnsentBySatellite:140\n\tstorj.io/storj/storagenode/orders.(*Service).sendOrders:153\n\tstorj.io/storj/internal/sync2.(*Cycle).Run:87\n\tstorj.io/storj/internal/sync2.(*Cycle).Start.func1:68\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57"}
storj.io/storj/storagenode/orders.(*Service).sendOrders
        /go/src/storj.io/storj/storagenode/orders/service.go:156
storj.io/storj/internal/sync2.(*Cycle).Run
        /go/src/storj.io/storj/internal/sync2/cycle.go:87
storj.io/storj/internal/sync2.(*Cycle).Start.func1
        /go/src/storj.io/storj/internal/sync2/cycle.go:68
golang.org/x/sync/errgroup.(*Group).Go.func1
        /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:57
2020-04-25T19:54:53.159Z        ERROR   piecestore:cacheUpdate  pieces/cache.go:69      error persisting cache totals to the database:  {"error": "piece space used error: context canceled", "errorVerbose": "piece space used error: context canceled\n\tstorj.io/storj/storagenode/storagenodedb.(*pieceSpaceUsedDB).UpdateTotal:121\n\tstorj.io/storj/storagenode/pieces.(*CacheService).PersistCacheTotals:82\n\tstorj.io/storj/storagenode/pieces.(*CacheService).Run.func1:68\n\tstorj.io/storj/internal/sync2.(*Cycle).Run:87\n\tstorj.io/storj/storagenode/pieces.(*CacheService).Run:63\n\tstorj.io/storj/storagenode.(*Peer).Run.func7:439\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57"}
storj.io/storj/storagenode/pieces.(*CacheService).Run.func1
        /go/src/storj.io/storj/storagenode/pieces/cache.go:69
storj.io/storj/internal/sync2.(*Cycle).Run
        /go/src/storj.io/storj/internal/sync2/cycle.go:87
storj.io/storj/storagenode/pieces.(*CacheService).Run
        /go/src/storj.io/storj/storagenode/pieces/cache.go:63
storj.io/storj/storagenode.(*Peer).Run.func7
        /go/src/storj.io/storj/storagenode/peer.go:439
golang.org/x/sync/errgroup.(*Group).Go.func1```

Hello @NtTestAlert,
Welcome to the forum!

The fix for this error is posted above: Bandwidthdb error: no such table: bandwidth_usage_rollups

A post was merged into an existing topic: Error: Error creating tables for master database on storagenode: migrate: no such table: main.order_archive_

Hello,

I have the same issue with the bandwidth_usage_rollups table when I attempt to use the latest version (1.3.3). The beta version (1.1.1) works perfectly without issues.

The sqlite3 fix posted above did not work for me. sqlite3 says that the table already exists. I also backed up bandwidth.db and opened it with DB Browser and found the table. I also tried to use the latest version with a fresh node. Same issue.

I’m afraid version 1.1.1 won’t be supported anymore and my nodes might stop.

Help is much appreciated

1 Like

I am in the same situation, also tried the sqlite commands above and also had the output show tables already exist. Trying to start node (i.e. without ‘:beta’) results in constant restarting.

Welcome to the forum @whiterock!

Why would you do that ?

Why I want to start the node? I am not sure I see what you mean, I wanted to upgrade from 1.1.1 to 1.3.3 and faced the issue that my node kept restarting because of this bandwidth_usage_rollups table missing issue as is outlined in previous posts. Thus I followed the advice in https://forum.storj.io/t/bandwidthdb-error-no-such-table-bandwidth-usage-rollups/5397/6?u=whiterock precisely but the error persists and I had to the downgrade again to 1.1.1, i.e. storjlabs/storagenode:beta to keep my node alive, passing ping checks, earning money etc.

Don’t mess with the tags unless you want to ruin your node.

You can’t yet. The docker image isn’t yet available.
image

Don’t deviate from the documentation. Using anything but the :beta tag can damage your node databases and make the node unable to run even with the current version.

1 Like

Ah, thank you so much! This was exactly the information I needed and was not able to find it anywhere :slight_smile: