- Stop the storagenode
docker stop storagenode
- run the sqlite3 container (replace the
/mnt/storagenode
to your path to the data):
docker run --rm -it -v /mnt/storagenode/storage/info.db:/data/info.db sstc/sqlite3 sqlite3 ./info.db`
And execute this SQL script:
SELECT datetime(strftime('%Y-%m-%dT%H:00:00', created_at)) created, bu.satellite_id sat_id, bu.action act , SUM(bu.amount) amt
FROM bandwidth_usage bu, bandwidth_usage_rollups bur
WHERE datetime(created_at) < datetime(CURRENT_TIMESTAMP)
AND bur.interval_start = created
AND bur.satellite_id = sat_id
AND bur.action = act
GROUP BY created, sat_id, act;
- Exit from the sqlite3:
.exit
- Post the result
- Also, better to have an exact date, when your storagenode has been updated.
For the watchtower:docker logs watchtower 2>&1 | grep -A 3 -B 3 Found
The temporary solution is to delete the duplicated rows. You should take a date from the result of the query and insert it to the query below:
Replace the path to yours.
docker stop -t 300 storagenode
docker run --rm -it -v /disk2/storj/storage/info.db:/data/info.db sstc/sqlite3 sqlite3 ./info.db
delete from bandwidth_usage_rollups where interval_start = 'put-the-date-with-time-here';
for example: delete from bandwidth_usage_rollups where interval_start = '2019-07-24 15:00:00'; replace the date to your result!!!
3. .exit
4. docker start storagenode