Skip to content

Commit

Permalink
indexer-common: shorten failure reason
Browse files Browse the repository at this point in the history
  • Loading branch information
hopey1118@gmail.com committed Aug 11, 2022
1 parent 5d19483 commit 894521a
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 108 deletions.
202 changes: 197 additions & 5 deletions docs/errors.md
Expand Up @@ -608,7 +608,7 @@ See also: [#IE041](#ie041).

**Summary**

TODO
Failed to collect query fees on chain.

**Solution**

Expand All @@ -618,7 +618,7 @@ TODO

**Summary**

TODO
Failed to queue transfers for resolving.

**Solution**

Expand All @@ -628,7 +628,7 @@ TODO

**Summary**

TODO
Failed to resolve transfer.

**Solution**

Expand All @@ -638,7 +638,7 @@ TODO

**Summary**

TODO
Failed to mark transfer as failed.

**Solution**

Expand All @@ -648,7 +648,7 @@ TODO

**Summary**

TODO
Failed to withdraw query fees for allocation.

**Solution**

Expand All @@ -658,8 +658,200 @@ TODO

**Summary**

Failed to clean up transfers for allocation.

**Solution**

TODO

## IE050

**Summary**

Transaction reverted due to gas limit being hit.

**Solution**

TODO

## IE051

**Summary**

Transaction reverted for unknown reason.

**Solution**

TODO

## IE052

**Summary**

Transaction aborted: maximum configured gas price reached.

**Solution**

TODO

## IE053

**Summary**

Failed to queue receipts for collecting.

**Solution**

TODO

## IE054

**Summary**

Failed to collect receipts in exchange for query fee voucher.

**Solution**

TODO

## IE055

**Summary**

Failed to redeem query fee voucher.

**Solution**

TODO

## IE056

**Summary**

Failed to remember allocation for collecting receipts later.

**Solution**

TODO

## IE057

**Summary**

Transaction reverted due to failing assertion in contract.

**Solution**

TODO

## IE058

**Summary**

Transaction failed because nonce has already been used.

**Solution**

TODO

## IE059

**Summary**

Failed to check latest operator ETH balance.

**Solution**

TODO

## IE060

**Summary**

Failed to allocate: subgraph is already allocated to.

**Solution**

The Indexer has an active allocation on the subgraph so a new one cannot be created. If you are sure to create a new allocation, either `reallocate` instead or `unallocate` the active allocation before `allocate`. Make sure the existing active allocation is closed and this error should resolve.

## IE061

**Summary**

Failed to allocate: Invalid allocation amount provided.

**Solution**

Indexer have to allocate a nonnegative amount of GRT. (At the moment, 0GRT allocation is not accepted neither). If allocation has been set to an invalid amount, update the amount that is positive, nonzero, and within the indexer free stake, and then this error should resolve.

## IE062

**Summary**

Did not receive contract receipt.

**Solution**

Cannot confirm `allocateFrom`, `closeAllocation`, `closeAndAllocate` transactions. Indexer should check if indexer operator is authorized and if network is not paused. Make sure indexer can make calls to the network contracts and indexer operator is authorized, then this error should resolve.

## IE063

**Summary**

Failed to unallocate: No active allocation with provided id found.

**Solution**

The Indexer must have an active allocation on the subgraph before the indexer can unallocate. Make sure the correct allocation id is provided and the error should resolve.

## IE064

**Summary**

Failed to unallocate: Allocations cannot be closed during this epoch as it was created in this epoch.

**Solution**

Allocations cannot be closed within the same epoch that it was created in. Wait until the next epoch and this error should resolve automatically.

## IE065

**Summary**

Failed to unallocate: Allocation has already been closed.

**Solution**

Check the allocation ID and network sync status. If the allocation ID is correct and allocation is closed, then there's nothing to be done.

## IE066

**Summary**

Allocation not created: Allocation ID already exist.

**Solution**

Cannot create a new allocation. The created allocation ID already exist on-chain. Check the network sync status, if status is caught up and an allocation still needs to be opened, agent will create a new unique allocation ID and try again.

## IE067

**Summary**

Failed to resolve POI: POI not available for deployment at current epoch start block.

**Solution**

Check sync and health status of the subgraph to access the issue. Might need to wait index node the sync up and is able to generate the current epoch start block POI.

## IE068

**Summary**

Failed to resolve POI: User provided POI does not match reference fetched from the graph-node.

**Solution**

Check sync and health status of the subgraph to access the issue. If needed, provide a POI or use `--force` to bypass POI checks.


18 changes: 18 additions & 0 deletions packages/indexer-common/src/errors.ts
Expand Up @@ -70,6 +70,15 @@ export enum IndexerErrorCode {
IE057 = 'IE057',
IE058 = 'IE058',
IE059 = 'IE059',
IE060 = 'IE060',
IE061 = 'IE061',
IE062 = 'IE062',
IE063 = 'IE063',
IE064 = 'IE064',
IE065 = 'IE065',
IE066 = 'IE066',
IE067 = 'IE067',
IE068 = 'IE068',
}

export const INDEXER_ERROR_MESSAGES: Record<IndexerErrorCode, string> = {
Expand Down Expand Up @@ -132,6 +141,15 @@ export const INDEXER_ERROR_MESSAGES: Record<IndexerErrorCode, string> = {
IE057: 'Transaction reverted due to failing assertion in contract',
IE058: 'Transaction failed because nonce has already been used',
IE059: 'Failed to check latest operator ETH balance',
IE060: 'Failed to allocate: Already allocating to the subgraph deployment',
IE061: 'Failed to allocate: Invalid allocation amount provided.',
IE062: 'Did not receive tx receipt, not authorized or network paused.',
IE063: 'No active allocation with provided id found.',
IE064: 'Failed to unallocate: Allocations cannot be closed in this epoch.',
IE065: 'Failed to unallocate: Allocation has already been closed.',
IE066: 'Failed to allocate: allocation ID already exist on chain',
IE067: 'Failed to query POI for current epoch start block',
IE068: 'User-provided POI did not match with reference POI from graph-node.',
}

export type IndexerErrorCause = unknown
Expand Down

0 comments on commit 894521a

Please sign in to comment.