Colm3na / polkastats-backend-v3

polkastats.io backend repository
Apache License 2.0
17 stars 15 forks source link

Bug in chain crawler #152

Closed mariopino closed 4 years ago

mariopino commented 4 years ago

Describe the bug

Seems there is a problem with chain crawler, several errors at startup:

postgres_1        | 2020-05-08 21:18:25.071 UTC [152] ERROR:  duplicate key value violates unique constraint "chain_pkey"
postgres_1        | 2020-05-08 21:18:25.071 UTC [152] DETAIL:  Key (block_height)=(2224337) already exists.
postgres_1        | 2020-05-08 21:18:25.071 UTC [152] STATEMENT:  INSERT INTO chain (
postgres_1        |           block_height,
postgres_1        |           session_index,
postgres_1        |           total_issuance,
postgres_1        |           active_accounts,
postgres_1        |           timestamp
postgres_1        |         ) VALUES (
postgres_1        |           '2224337',
postgres_1        |           '3891',
postgres_1        |           '8945698603970340803',
postgres_1        |           '8986',
postgres_1        |           '1588972705067'
postgres_1        |         );
postgres_1        | 2020-05-08 21:18:25.072 UTC [138] ERROR:  duplicate key value violates unique constraint "chain_pkey"
postgres_1        | 2020-05-08 21:18:25.072 UTC [138] DETAIL:  Key (block_height)=(2224335) already exists.
postgres_1        | 2020-05-08 21:18:25.072 UTC [138] STATEMENT:  INSERT INTO chain (
postgres_1        |           block_height,
postgres_1        |           session_index,
postgres_1        |           total_issuance,
postgres_1        |           active_accounts,
postgres_1        |           timestamp
postgres_1        |         ) VALUES (
postgres_1        |           '2224335',
postgres_1        |           '3891',
postgres_1        |           '8945698603970340803',
postgres_1        |           '8986',
postgres_1        |           '1588972705067'
postgres_1        |         );
substrate-node_1  | 2020-05-08 21:18:29 💤 Idle (23 peers), best: #2224341 (0x71c1…9a6a), finalized #2224338 (0x9955…f492), ⬇ 24.9kiB/s ⬆ 14.2kiB/s
substrate-node_1  | 2020-05-08 21:18:31 ✨ Imported #2224342 (0xc194…012a)
crawler_1         | {"level":30,"time":1588972711116,"pid":18,"hostname":"6f4de7d81887","msg":"Updating chain info"}
crawler_1         | {"level":30,"time":1588972711117,"pid":18,"hostname":"6f4de7d81887","msg":"Updating chain info"}
crawler_1         | {"level":50,"time":1588972711117,"pid":18,"hostname":"6f4de7d81887","msg":"Error updating chain info"}
crawler_1         | {"level":50,"time":1588972711117,"pid":18,"hostname":"6f4de7d81887","msg":"Error updating chain info"}
crawler_1         | {"level":30,"time":1588972711118,"pid":18,"hostname":"6f4de7d81887","msg":"Updating chain info"}