Open poka-IT opened 8 months ago
Not sure that caused the error, but blocks weren't missed. More looks like there was some issue on the rpc node side due to that it was unable to return new blocks for a certain period of time, and these 8 blocks weren't printed in the logs because only the last block of the batch is printed.
Regarding to the error itself, it seems that there was a fork/rollback, but processor didn't handle it correctly, will investigate.
@belopash is this completed issue link to a MR ?
@belopash is this completed issue link to a MR ?
Is it still relevant?
Perhaps this should be fixed with https://github.com/subsquid/squid-sdk/commit/5b076d9440976e63436e01d3e8a3e42eac397719 https://github.com/subsquid/squid-sdk/commit/fb6f10a5bdb3e617ea105d20e444631e8766c428
Perhaps Didn't throw it again, so let's says it's ok =)
@belopash I just have the same issue again with the processor:
duniter-squid-processor-1 | {"level":2,"time":1720554246107,"ns":"sqd:processor","msg":"2169697 / 2169697, rate: 0 blocks/sec, mapping: 43 blocks/sec, 129 items/sec, eta: 0s"}
duniter-squid-processor-1 | {"level":2,"time":1720554252211,"ns":"sqd:processor","msg":"2169698 / 2169698, rate: 0 blocks/sec, mapping: 43 blocks/sec, 130 items/sec, eta: 0s"}
duniter-squid-processor-1 | {"level":2,"time":1720554264256,"ns":"sqd:processor","msg":"2169699 / 2169699, rate: 0 blocks/sec, mapping: 31 blocks/sec, 93 items/sec, eta: 0s"}
duniter-squid-processor-1 | {"level":2,"time":1720554708561,"ns":"sqd:processor","msg":"2169707 / 2169707, rate: 0 blocks/sec, mapping: 25 blocks/sec, 75 items/sec, eta: 0s"}
duniter-squid-processor-1 | {"level":5,"time":1720554708768,"ns":"sqd:processor","err":{"generatedMessage":true,"code":"ERR_ASSERTION","actual":false,"expected":true,"operator":"==","stack":"AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:\n\n (0, assert_1.default)(head.height >= this.chain[0].height)\n\n at HotProcessor.moveToBlocks (/squid/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:60:30)\n at HotProcessor.goto (/squid/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:38:24)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async RpcDataSource.handleNewHeads (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:213:24)\n at async RpcDataSource.subscription (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:198:25)\n at async RpcDataSource.processHotBlocks (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:113:13)"}}
Nothing happend after this. Zoom on the error:
{
"generatedMessage": true,
"code": "ERR_ASSERTION",
"actual": false,
"expected": true,
"operator": "==",
"stack": "AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:\n\n" +
" (0, assert_1.default)(head.height >= this.chain[0].height)\n\n" +
" at HotProcessor.moveToBlocks (/squid/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:60:30)\n" +
" at HotProcessor.goto (/squid/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:38:24)\n" +
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n" +
" at async RpcDataSource.handleNewHeads (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:213:24)\n" +
" at async RpcDataSource.subscription (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:198:25)\n" +
" at async RpcDataSource.processHotBlocks (/squid/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:113:13)"
}
So this issue is not fixed =)
@poka-IT seems you are still using old packages. This is how the current code looks like, as you can see the assertion is on a different line. I suggest you to delete both lockfile and node_modules/@subsquid folder, and then run reinstall
After an update, getting the same error with assertion on line 62 as on your screenshot.
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
(0, assert_1.default)(head.height >= this.chain[0].height)
at HotProcessor.moveToBlocks (/squid/node_modules/.pnpm/@subsquid+util-internal-ingest-tools@1.1.4_@subsquid+util-internal-archive-client@0.1.2_@subs_pouyxye7trl5ald52mmup34cna/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:62:30)
at HotProcessor.goto (/squid/node_modules/.pnpm/@subsquid+util-internal-ingest-tools@1.1.4_@subsquid+util-internal-archive-client@0.1.2_@subs_pouyxye7trl5ald52mmup34cna/node_modules/@subsquid/util-internal-ingest-tools/lib/hot.js:38:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RpcDataSource.handleNewHeads (/squid/node_modules/.pnpm/@subsquid+substrate-data-raw@1.1.5_@subsquid+logger@1.3.3_@subsquid+rpc-client@4.9.0_@subsqui_vn76oakevpk2lvovyggbaloyyq/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:220:24)
at async RpcDataSource.subscription (/squid/node_modules/.pnpm/@subsquid+substrate-data-raw@1.1.5_@subsquid+logger@1.3.3_@subsquid+rpc-client@4.9.0_@subsqui_vn76oakevpk2lvovyggbaloyyq/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:205:25)
at async RpcDataSource.processHotBlocks (/squid/node_modules/.pnpm/@subsquid+substrate-data-raw@1.1.5_@subsquid+logger@1.3.3_@subsquid+rpc-client@4.9.0_@subsqui_vn76oakevpk2lvovyggbaloyyq/node_modules/@subsquid/substrate-data-raw/lib/datasource.js:120:13)
Here you can see the current version of our dependencies: https://git.duniter.org/nodes/duniter-squid/-/blob/main/package.json?ref_type=heads:
"@subsquid/substrate-data-raw": "^1.2.0",
"@subsquid/substrate-processor": "^8.5.1",
"@subsquid/substrate-runtime": "^2.0.0",
"@subsquid/util-internal": "^3.2.0",
Did it happen again or you are trying to run against the same DB?
Yes, it happened again on a fresh db. Currently our indexer is still moving a lot so we are re-indexing from scratch at every update that touches the db. Multiple instances met the same bug.
@Hugo-Trentesaux Is this endpoint still valid - wss://gdev.p2p.legal/ws? Is it what you use?
Yes, this endpoint is on our current dev network. You can also use:
wss://gdev.coinduf.eu
wss://gdev.gyroi.de
wss://gdev.cgeek.fr
And see other nodes connected to this network on the telemetry: https://telemetry.polkadot.io/#list/0xc184c4ccde8e771483bba7a01533d007a3e19a66d3537c7fd59c5d9e3550b6c3
About the indexers, you can interact with graphql API on :
https://squid.gdev.gyroi.de/v1/graphql
https://squid.gdev.coinduf.eu/v1/graphql
(currently stopped because of this bug)and see latest indexed block with:
query LatestBlock {
block(orderBy: {height: DESC}, limit: 1) {
timestamp
height
hash
}
}
My subsquid node processor crashed with this logs:
Error:
[ERR_ASSERTION]: The expression evaluated to a falsy value:\n\n (0, assert_1.default)(head.height >= this.chain[0].height)
It look likes it missed 8 higher blocks, between
435163
and435172
, which is the cause of this error.This indexer is listening a local duniter v2s archive node.
indexer enpoind:
https://gdev-squid.axiom-team.fr/v1/graphql
duniter endpoint:
wss://gdev.p2p.legal/ws
We observe that the problem occurs exactly at midnight, which would be a strange coincidence:
We also notice a gap of 6 minutes and 48 seconds between block 435163 and 435172, whereas only 48 seconds should have passed.
Disturbingly, the missing blocks in the logs seem to be present in the DB, and correctly dated:
Here a simple processor restart solve the problem, but whatever the cause of the problem, processor should be able to recover using its checkpoints, without manual restart.
Version:
"@subsquid/substrate-processor": "^8.1.1"