graphprotocol / mission-control-indexer

Technical indexer documentation and infrastructure templates for the Mission Control testnet
21 stars 4 forks source link

Failed to allocate #272

Closed suntzu93 closed 3 years ago

suntzu93 commented 3 years ago
  1. I re-allocate and my transaction close was success https://etherscan.io/tx/0x9013714ec729d29897c5919eff025badd30940681eb7d75aef91982f5e353fcf

Indexer-agent still show pending transaction while it's finished so I restarted agent and no error log also does not report the transaction is completed.

  1. I set rule to always and update allocationAmount, restart agent again and got error Failed to allocate

Cause : It did not update my available stake tokens even though the transaction close was successful.

My Available Stake : https://oracleminer.com/graph/indexer/0x4167eb613d784c910f5dc0f3f0515d61ec6ec8df


I check code and saw this error come from the line :

https://github.com/graphprotocol/indexer/blob/ab34268709111ed013cac9f0a65d2cc9745428cd/packages/indexer-agent/src/network.ts#L598

getIndexerCapacity of contract < amount .

output of getIndexerCapacity is 985862.873458854496543856 base on log error indexer only has a free stake amount of 985862.873458854496543856 GRT different with getIndexerCapacity on contract:

https://etherscan.io/address/0xf55041e37e12cd407ad00ce2910b8269b01263b9#readProxyContract

respone:

[ getIndexerCapacity method Response ] uint256 : 13693468552946382928962456

It could be with cache or something that doesn't get the latest data.


LOG:

2|start_in | {"level":50,"time":1609654557972,"pid":2499433,"hostname":"suntzu-server","name":"IndexerAgent","component":"Network","indexer":"0x4167EB613d784C910f5dc0F3f0515D61Ec6EC8DF","operator":"0xD96d4B52CAb35cF3DF1d58765bD2eA7cb1Fb6016","deployment":{"bytes32":"0x31edcacc9a53bc8ab4be2eeb0d873409da4c4228cb2d60e4243bd3b4e8af7500","ipfsHash":"QmRhYzT8HEZ9LziQhP6JfNfd4co9A7muUYQhPMJsMUojSF"},"amount":"13690000.0","err":{"type":"IndexerError","message":"Failed to allocate: insufficient free stake","stack":"IndexerError: Failed to allocate: insufficient free stake\n at Object.indexerError (/usr/local/lib/node_modules/@graphprotocol/indexer-agent/node_modules/@graphprotocol/indexer-common/dist/errors.js:97:12)\n at Network.<anonymous> (/usr/local/lib/node_modules/@graphprotocol/indexer-agent/dist/network.js:422:44)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/lib/node_modules/@graphprotocol/indexer-agent/dist/network.js:24:58)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)","code":"IE013","explanation":"https://github.com/graphprotocol/indexer/blob/master/docs/errors.md#ie013","cause":{"type":"Error","message":"Unable to allocate 13690000.0 GRT: indexer only has a free stake amount of 985862.873458854496543856 GRT","stack":"Error: Unable to allocate 13690000.0 GRT: indexer only has a free stake amount of 985862.873458854496543856 GRT\n at Network.<anonymous> (/usr/local/lib/node_modules/@graphprotocol/indexer-agent/dist/network.js:422:98)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/lib/node_modules/@graphprotocol/indexer-agent/dist/network.js:24:58)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)"}},"msg":"Failed to allocate"}

suntzu93 commented 3 years ago

My OE node got stuck, that's reason for this issue. Fixed after OE node full sync.