[Bug] Rewinding a subgraph causes a constraint violation in graph-node that in turn causes indexer-agent to crashloop
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- postgresql, rust
- Domain
- backend, databases, distributed-systems
Research direction
Start by reviewing the graph-node and indexer-agent log output, especially packages/indexer-common/dist/graph-node.js and packages/indexer-common/dist/errors.js, then investigate the rewind and indexing-status path around the entityCount constraint. Reproduce the graphman rewind or drop scenario and confirm that graph-node resumes syncing and indexer-agent no longer crashloops.
Written by the indexing model from the issue text.
Description
Bug report
graph-node:v0.34.1
indexer-agent:v0.20.22
Activities that were undertaken before observing this bug:
- Cleared call_cache for Arbitrum as part of a complex subgraph sync performance troubleshooting exercise via psql
- Rewound a specific problematic subgraph, Silo Finance Arbitrum,
QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhWto block 1 usinggraphman - Observed the above subgraph syncing to ~130m blocks, then stalled.
- Checked graph-node logs and found related error (see log output)
- Observed indexer-agent complaining about same issue and crash looping - cannot use the agent at all right now to manage subgraphs (see log output)
IMPACT: Production Indexer at risk; we cannot manage our online and offline allocations while we have this issue - ideally need a temp fix for the specific symptoms. Would graphman drop resolve the issue? Would the graph-node and indexer-agent be able to handle that and start syncing the sub again from scratch given this is a subgraph in flight with live allocations?
Relevant log output
----- GRAPH-NODE
Apr 04 13:24:34.037 ERRO Subgraph instance failed to run: internal constraint violated: Subgraph writer for QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW[sgd622] is not running, sgd: 622, subgraph_id: QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW, component: SubgraphInstanceManager
Apr 04 13:48:18.741 WARN Price provider Removed: 0x8dca64a43865454f41aa1a3cf0140eb89f2c08aa53871235ecbe46b6a309a1e3, data_source: PriceProvidersRepository, sgd: 622, subgraph_id: QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW, component: SubgraphInstanceManager > UserMapping
Apr 04 13:48:18.742 ERRO Oracle was not found when trying to remove it at txn: 0x8dca64a43865454f41aa1a3cf0140eb89f2c08aa53871235ecbe46b6a309a1e3, data_source: PriceProvidersRepository, sgd: 622, subgraph_id: QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW, component: SubgraphInstanceManager > UserMapping
----- INDEXER-AGENT
{"level":50,"time":1712241706593,"pid":1,"hostname":"268ad9e1400b","name":"IndexerAgent","component":"GraphNode","err":{"type":"IndexerError","message":"Failed to query indexing status API","stack":"IndexerError: Failed to query indexing status API\n at indexerError (/opt/indexer/packages/indexer-common/dist/errors.js:173:12)\n at GraphNode.<anonymous> (/opt/indexer/packages/indexer-common/dist/graph-node.js:146:55)\n at Generator.next (<anonymous>)\n at fulfilled (/opt/indexer/packages/indexer-common/dist/graph-node.js:5:58)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":"IE018","explanation":"https://github.com/graphprotocol/indexer/blob/main/docs/errors.md#ie018","cause":{"type":"CombinedError","message":"[GraphQL] Store error: internal constraint violated: the entityCount for QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW is not representable as a u64","name":"CombinedError","graphQLErrors":[{"message":"Store error: internal constraint violated: the entityCount for QmTMKqty5yZvZtB3SwzXUG92aZUH1YQw3VjByGw4wgaMhW is not representable as a u64"}],"response":{"size":0,"timeout":0}}},"msg":"Failed to query indexing status API"}
IPFS hash
No response
Subgraph name or link to explorer
Some information to help us out
- Tick this box if this bug is caused by a regression found in the latest release.
- Tick this box if this bug is specific to the hosted service.
- I have searched the issue tracker to make sure this issue is not a duplicate.
OS information
Linux
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphprotocol/graph-node#6719 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
graphprotocol/graph-node#6673 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
graphprotocol/graph-node#6650 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
graphprotocol/graph-node#6722 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
graphprotocol/graph-node#6721 ·
All issues in graphprotocol/graph-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100