graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.89k stars 961 forks source link

subgraph deployment error: Fulltext search not yet deterministic #3355

Open dimitar-petrov opened 2 years ago

dimitar-petrov commented 2 years ago

Do you want to request a feature or report a bug? Reporting a bug.

What is the current behavior? Local deployment of dex pair indexing subgraph is failing.

❯ graph deploy --debug --node http://localhost:8020/ --ipfs http://localhost:5001 ps-pair
✔ Version Label (e.g. v0.0.1) · 
  Skip migration: Bump mapping apiVersion from 0.0.1 to 0.0.2
  Skip migration: Bump mapping apiVersion from 0.0.2 to 0.0.3
  Skip migration: Bump mapping apiVersion from 0.0.3 to 0.0.4
  Skip migration: Bump mapping apiVersion from 0.0.4 to 0.0.5
  Skip migration: Bump mapping specVersion from 0.0.1 to 0.0.2
✔ Apply migrations
✔ Load subgraph from subgraph.yaml
  Compile data source: Factory => build/Factory/Factory.wasm
✔ Compile subgraph
  Copy schema file build/schema.graphql
  Write subgraph file build/Factory/abis/Factory.json
  Write subgraph file build/Factory/abis/ERC20.json
  Write subgraph manifest build/subgraph.yaml
✔ Write compiled subgraph to build/
  Add file to IPFS build/schema.graphql
                .. QmPa8A3m9ppCExVRPvbaaq2QKvKNbVpzW4K8p8s5Sutm9A
  Add file to IPFS build/Factory/abis/Factory.json
                .. QmYXuAc7pZU85eNsRHenbBV7Ct41owmmWE2mKR9QRQfJ36
  Add file to IPFS build/Factory/abis/ERC20.json
                .. QmSonEhKzLZuq2FoRx8AxYb1aFKSj8xTuYsuMabF3Fe7JJ
  Add file to IPFS build/Factory/Factory.wasm
                .. QmNx7wgHKW5bxZta1FdixWxGyQYBGzCBPAywBj23gvZ8CK
✔ Upload subgraph to IPFS

Build completed: Qmcrcj7oHuAqxSh1eCKaX6yvnqD8DK6ee5fnjkcDbBRvZH

✖ Failed to deploy to Graph node http://localhost:8020/: subgraph deployment error: Fulltext search not yet deterministic

Here is the error from graph-node:

docker-graph-node-1  | Mar 12 10:57:58.450 ERRO subgraph_deploy failed, params: SubgraphDeployParams { name: SubgraphName("ps-pair"), ipfs_hash: DeploymentHash("Qmcrcj7oHuAqxSh1eCKaX6yvnqD8DK6ee5fnjkcDbBRvZH"), node_id: None }, erro
r: SubgraphDeploymentError(FulltextSearchNonDeterministic), component: JsonRpcServer

Can someone point me where to look for issue given this error message. Thanks.

leoyvens commented 2 years ago

You need to set the GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH environment variable.

aliassan commented 2 years ago

You need to set the GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH environment variable.

How do you set the environment variable?

aliassan commented 2 years ago

You need to set the GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH environment variable.

How do you set the environment variable?

Okay, I finally figured it out, I thought there was a config file or something. You simply set it on your system. In Linux Ubuntu that would be:

export GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH=true

That solved it for me.

dimitar-petrov commented 2 years ago

@aliassan,

That variable made the trick. I had to add it to docker-compose.yml

Thanks a lot.

Andrewjeska commented 2 years ago

What are the consequences of non-deterministic search?

schmidsi commented 1 year ago

I'm reopening this issue to make sure this env-var is documented in https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md