graphprotocol / graphprotocol/indexer

Failed graphql query reported as successful

Open
#629 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
262
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Our indexer was returning errors for some networks:

http post http://host1/subgraphs/id/QmQohvyxLZLpwouzPF61kTzmLjgawmt6qDWZrPndz1M9EQ Host:graph-mainnet.ellipfra.net Authorization:'XXXXX' query='query MyQuery { _meta { block { number } } }'

HTTP/1.1 200 OK { "graphQLResponse": "{\"errors\":[{\"message\":\"Store error: database unavailable\"}]}" }

The graph-service logs are not hinting of any problem:
{"level":30,"time":1679489726789,"pid":1,"hostname":"indexer-service-6fc7bb878c-ljnmg","name":"IndexerService","indexer":"0x62A0BD1d110FF4E5b793119e95Fc07C9d1Fc8c4a","operator":"0x4ecB19A2aC49C5DecFa5E65B6669C7e7fab5da9D","indexer":"0x62A0BD1d110FF4E5b793119e95Fc07C9d1Fc8c4a","operator":"0x4ecB19A2aC49C5DecFa5E65B6669C7e7fab5da9D","component":"Server","deployment":{"bytes32":"0x24a5b2e65c85a2debf7d9dd783f9c0bc1df52620039e94a2d60cee560834f969","ipfsHash":"QmQohvyxLZLpwouzPF61kTzmLjgawmt6qDWZrPndz1M9EQ"},"msg":"Received free query"} {"level":20,"time":1679489726795,"pid":1,"hostname":"indexer-service-6fc7bb878c-ljnmg","name":"IndexerService","indexer":"0x62A0BD1d110FF4E5b793119e95Fc07C9d1Fc8c4a","operator":"0x4ecB19A2aC49C5DecFa5E65B6669C7e7fab5da9D","indexer":"0x62A0BD1d110FF4E5b793119e95Fc07C9d1Fc8c4a","operator":"0x4ecB19A2aC49C5DecFa5E65B6669C7e7fab5da9D","component":"Server","msg":"POST /subgraphs/id/QmQohvyxLZLpwouzPF61kTzmLjgawmt6qDWZrPndz1M9EQ 200 88 - 6.101 ms"}

The prometheus endpoint is reporting that the query is successful.

graph-indexer v0.20.11

This lack of error reporting is preventing indexers from detecting production issues, as in this situation the problem was only apparent from the gateways.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the graph-service handling of POST /subgraphs/id/... and the Prometheus query-success reporting described in the issue. Reproduce the response containing a GraphQL errors array, then trace how the HTTP result and metric are classified; done means this failure is reported as unsuccessful and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.