dcrdata: About to connect the wrong block

Hi,

When i launch dcrdata, with the command ./dcrdata, I am getting a panic of about to connect the wrong block. See the logs.

2019-09-29 14:12:38.440 [INF] DATD: Log folder:  /home/kingmoses/.dcrdata/logs/mainnet
2019-09-29 14:12:38.440 [INF] DATD: Config file: /home/kingmoses/.dcrdata/dcrdata.conf
2019-09-29 14:12:38.441 [INF] DATD: dcrdata version 5.2.0-pre+dev (Go version go1.12.9)
2019-09-29 14:12:38.473 [INF] RPCC: Established connection to RPC server localhost:9109
2019-09-29 14:12:38.474 [INF] DATD: Connected to dcrd (JSON-RPC API v6.1.0) on MainNet
2019-09-29 14:12:38.474 [INF] SKDB: Loading ticket pool DB. This may take a minute...
2019-09-29 14:12:38.558 [INF] SKDB: badger: All 1 tables opened in 83ms
2019-09-29 14:12:38.561 [INF] SKDB: Loading all ticket pool diffs...
2019-09-29 14:12:55.277 [INF] SKDB: Successfully loaded 383908 ticket pool diffs
2019-09-29 14:12:55.390 [INF] SKDB: Advancing ticket pool DB to tip via diffs...
2019-09-29 14:12:55.828 [INF] SKDB: Pre-populating live ticket cache and computing pool value...
2019-09-29 14:12:59.121 [INF] DATD: Loaded StakeDatabase at height 383907
2019-09-29 14:12:59.122 [INF] DATD: Setting up the Politeia's proposals clone repository. Please wait...
2019-09-29 14:13:00.819 [INF] DATD: Address cache capacity: 986895 rows, 134217728 bytes
2019-09-29 14:13:00.826 [INF] PSQL: Switching PostgreSQL time zone to UTC for this session.
2019-09-29 14:13:00.828 [INF] PSQL: PostgreSQL 11.5 (Debian 11.5-2+b1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 9.2.1-8) 9.2.1 20190909, 64-bit
2019-09-29 14:13:00.837 [INF] PSQL: DB schema version 1.2.0
2019-09-29 14:13:02.161 [INF] PSQL: Pre-loading unspent ticket info for InsertVote optimization.
2019-09-29 14:13:02.442 [INF] PSQL: Storing data for 43413 unspent tickets in cache.
2019-09-29 14:13:02.451 [INF] PSQL: Setting PostgreSQL DB statement timeout to 1h0m0s.
2019-09-29 14:13:02.675 [INF] EXPR: Mean Voting Blocks calculated: 7860
2019-09-29 14:13:02.708 [INF] EXPR: Starting WebsocketHub run loop.
2019-09-29 14:13:02.711 [INF] PUBS: Starting WebsocketHub run loop.
2019-09-29 14:13:02.724 [INF] IAPI: Started Insight socket.io server for up to 16384 clients.
2019-09-29 14:13:02.726 [INF] DATD: Now serving the explorer and APIs on http://127.0.0.1:7777/
2019-09-29 14:13:02.976 [INF] DATD: Starting blockchain sync...
2019-09-29 14:13:02.977 [INF] PSQL: Current best block (dcrd):        383910
2019-09-29 14:13:02.977 [INF] PSQL: Current best block (primary db):  383908
2019-09-29 14:13:02.977 [INF] PSQL: Current best block (stakedb):     383907
2019-09-29 14:13:02.977 [INF] PSQL: Processing blocks 383909 to 383910...
panic: about to connect the wrong block: 383909, 383907

goroutine 383963 [running]:
github.com/decred/dcrdata/db/dcrpg/v4.(*ChainDB).SyncChainDB(0xc00037a2c0, 0x12fd500, 0xc00007bf00, 0x130c420, 0xc001839280, 0xc00a880000, 0x0, 0xc001d1f0e0, 0x0, 0x0, ...)
	/home/kingmoses/go/src/github.com/decred/dcrdata/db/dcrpg/sync.go:414 +0x4905
github.com/decred/dcrdata/db/dcrpg/v4.(*ChainDB).SyncChainDBAsync(0xc00037a2c0, 0x12fd500, 0xc00007bf00, 0xc001842660, 0x130c420, 0xc001839280, 0x0, 0x0, 0xc001d1f0e0)
	/home/kingmoses/go/src/github.com/decred/dcrdata/db/dcrpg/sync.go:112 +0xaf
created by main._main.func10
	/home/kingmoses/go/src/github.com/decred/dcrdata/main.go:812 +0x23f

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 32 (32 by maintainers)

Most upvoted comments

testnet

2022-02-06 22:08:39.126 [INF] PSQL: Processing blocks 870501 to 871000...
2022-02-06 22:08:46.132 [INF] PSQL: ( 42 blk/s,  691 tx/s, 4080 vin/sec, 4828 vout/s)
2022-02-06 22:08:51.330 [INF] PSQL: Processing blocks 871001 to 871106...
2022-02-06 22:08:53.892 [INF] PSQL: Avg. speed: 961 tx/s, 4721 vout/s
2022-02-06 22:08:53.892 [INF] PSQL: Block import elapsed: 223.13 minutes, 871107 blocks (65.07 blocks/s)
2022-02-06 22:08:53.893 [INF] PSQL: Beginning SYNC STAGE 2 of 5 (duplicate row removal).
...
2022-02-06 22:15:37.713 [INF] PSQL: Beginning SYNC STAGE 3 of 5 (table indexing and analyzing).
...
2022-02-06 22:24:56.163 [INF] PSQL: Beginning SYNC STAGE 4 of 5 (deep database ANALYZE).
2022-02-06 22:26:11.787 [INF] PSQL: Beginning SYNC STAGE 5 of 5 (setting spending info in addresses table). This will take a while.
2022-02-06 22:26:11.794 [INF] PSQL: Updating address rows for blocks [0,9999]...
2022-02-06 22:26:33.473 [INF] PSQL: Updating address rows for blocks [10000,19999]...
...
2022-02-06 22:55:34.173 [INF] PSQL: Updating address rows for blocks [870000,871106]...
2022-02-06 22:55:38.609 [INF] PSQL: Updated 43088652 rows of addresses table.
2022-02-06 22:55:38.609 [INF] PSQL: Indexing addresses table on matching_tx_hash...
2022-02-06 22:57:45.107 [INF] PSQL: Performing an ANALYZE(600) on addresses table...
2022-02-06 22:57:52.259 [INF] PSQL: Catching up with network at block height 871135 from 871106...
2022-02-06 22:57:54.661 [INF] PSQL: SYNC COMPLETED at height 871135. Delta:
			    871136 blocks
			  12866327 transactions
			  48427059 ins
			  63206847 outs
			  91843276 addresses

fresh mainnet sync stage 1 passed:

2022-02-06 17:44:07.553 [INF] PSQL: Processing blocks 631001 to 631317...
2022-02-06 17:44:15.453 [INF] PSQL: ( 40 blk/s,  725 tx/s, 4134 vin/sec, 4953 vout/s)
2022-02-06 17:44:15.887 [INF] PSQL: Avg. speed: 1145 tx/s, 5152 vout/s
2022-02-06 17:44:15.887 [INF] PSQL: Block import elapsed: 162.01 minutes, 631318 blocks (64.95 blocks/s)
2022-02-06 17:44:15.887 [INF] PSQL: Beginning SYNC STAGE 2 of 5 (duplicate row removal).
...
2022-02-06 17:49:23.124 [INF] PSQL: Beginning SYNC STAGE 3 of 5 (table indexing and analyzing).
...
2022-02-06 17:56:38.334 [INF] PSQL: Beginning SYNC STAGE 4 of 5 (deep database ANALYZE).
2022-02-06 17:57:38.349 [INF] PSQL: Beginning SYNC STAGE 5 of 5 (setting spending info in addresses table). This will take a while.
2022-02-06 17:57:38.351 [INF] PSQL: Updating address rows for blocks [0,9999]...
2022-02-06 17:57:52.104 [INF] PSQL: Updating address rows for blocks [10000,19999]...
...
2022-02-06 18:17:49.033 [INF] PSQL: Updating address rows for blocks [630000,631317]...
2022-02-06 18:17:52.871 [INF] PSQL: Updated 33460663 rows of addresses table.
2022-02-06 18:17:52.872 [INF] PSQL: Indexing addresses table on matching_tx_hash...
2022-02-06 18:19:16.418 [INF] PSQL: Performing an ANALYZE(600) on addresses table...
2022-02-06 18:19:19.576 [INF] PSQL: Catching up with network at block height 631326 from 631317...
2022-02-06 18:19:20.610 [INF] PSQL: SYNC COMPLETED at height 631326. Delta:
			    631327 blocks
			  11138463 transactions
			  37259547 ins
			  50082487 outs
			  72150839 addresses

will update when I do testnet3

OK I’m going to run a fresh sync on both mainnet and testnet. The fast forward loop is not a solution though. We need to get to the root cause.