account-indexer icon indicating copy to clipboard operation
account-indexer copied to clipboard

Cannot get transaction receipt

Open twoeths opened this issue 6 years ago • 8 comments
trafficstars

Getting this error in mainnet:

2019/03/02 12:08:03 Indexer: realtimeIndex - received BlockDetail 7290108 blockTime: 2019-03-02 12:07:59 +0000 UTC
2019/03/02 12:08:08 ChainFetch: getTransactionDetail cannot get receipt for transaction 0x01fc989d7ac9ba1610f9a5a32616ac314b2caa094843f85861d978c2b16f1f00, error=not found
2019/03/02 12:08:08 ChainFetch: RealtimeFetch Cannot get block detail for block 7290109
2019/03/02 12:08:08 ChainFetch: Stopped RealtimeFetch
2019/03/02 12:08:08 Indexer: Stopping realtimeIndex, ipc is switched?
2019/03/02 12:08:08 Indexer: Stopped realtimeIndex
2019/03/02 12:08:08 IpcManager: Cannot switch IPC, number of IPC = 1
blockform@mainindex2:~/go/src/github.com/WeTrustPlatform/account-indexer/cmd/indexer$

twoeths avatar Mar 02 '19 13:03 twoeths

I can get receipt for that same transaction some minutes later with the same node

twoeths avatar Mar 04 '19 02:03 twoeths

New log:

2019/03/09 09:13:32 Indexer: realtimeIndex - received BlockDetail 7334145 blockTime: 2019-03-09 09:13:08 +0000 UTC
2019/03/09 09:13:44 ChainFetch: getTransactionDetail cannot get receipt for transaction 0x69bf268e6a9e6f742bdf69c289ee14715df19cbaf90e5711cabf37956814632e, error=not found
2019/03/09 09:13:44 ChainFetch: RealtimeFetch Cannot get block detail for block 7334146
2019/03/09 09:13:44 ChainFetch: Stopped RealtimeFetch
2019/03/09 09:13:44 IpcManager: Cannot switch IPC, number of IPC = 1
2019/03/09 09:13:44 Indexer: Stopping realtimeIndex, ipc is switched?
2019/03/09 09:13:44 Indexer: Stopped realtimeIndex

From etherscan, transaction 0x69bf268e6a9e6f742bdf69c289ee14715df19cbaf90e5711cabf37956814632e belongs to block 7334147 not 7334146

twoeths avatar Mar 09 '19 09:03 twoeths

Need to test more ...

twoeths avatar Mar 09 '19 09:03 twoeths

2 root causes for this bug found until now:

  • The use of goroutine variables inside for loop is incorrect
  • During realtime fetch, blockNumber pointer is changed. Fixed that by using int64 in FetchABlock() instead of a pointer

twoeths avatar Mar 09 '19 09:03 twoeths

Get this again after 4 hours:

2019/03/09 14:10:07 Indexer: realtimeIndex - received BlockDetail 7335463 blockTime: 2019-03-09 14:09:56 +0000 UTC
2019/03/09 14:10:10 ChainFetch: getTransactionDetail cannot get receipt for transaction 0x665317b458cd8536d5378010735fa80c3c66e09d6adc97b69be552f10d44400a, error=not found
2019/03/09 14:10:10 ChainFetch: RealtimeFetch Cannot get block detail for block 7335464
2019/03/09 14:10:10 ChainFetch: Stopped RealtimeFetch
2019/03/09 14:10:10 IpcManager: Cannot switch IPC, number of IPC = 1
2019/03/09 14:10:10 Indexer: Stopping realtimeIndex, ipc is switched?
2019/03/09 14:10:10 Indexer: Stopped realtimeIndex

twoeths avatar Mar 09 '19 14:03 twoeths

More logs added, this is what I get:

2019/03/10 03:52:34 Indexer: realtimeIndex - received BlockDetail 7339148 blockTime: 2019-03-10 03:52:08 +0000 UTC
2019/03/10 03:53:06 Indexer: realtimeIndex - received BlockDetail 7339149 blockTime: 2019-03-10 03:52:31 +0000 UTC
2019/03/10 03:53:07 Indexer: realtimeIndex - received BlockDetail 7339150 blockTime: 2019-03-10 03:53:04 +0000 UTC
2019/03/10 03:53:15 Indexer: realtimeIndex - received BlockDetail 7339151 blockTime: 2019-03-10 03:53:06 +0000 UTC
2019/03/10 03:53:15 ChainFetch: getTransactionDetail cannot get receipt for transaction 0xb637af8b8a666ea56590aa7c7f5107038ed8db770601e1730eb443b3975867c5, index=0, blockHash=0xd7964529e6ab6957212e56371646782caee44266e212982f57d69b9c6e56a235 error=not found
2019/03/10 03:53:15 ChainFetch: RealtimeFetch Cannot get block detail for block 7339151

twoeths avatar Mar 10 '19 04:03 twoeths

Either the transaction or the index is not correct. Maybe the transaction is not correct because we still use pointer. Fixed it that way and tried again.

twoeths avatar Mar 10 '19 08:03 twoeths

Faced this issue again:

2019/03/10 13:08:26 Indexer: realtimeIndex - received BlockDetail 7341574 blockTime: 2019-03-10 13:07:58 +0000 UTC
2019/03/10 13:08:36 Indexer: realtimeIndex - received BlockDetail 7341575 blockTime: 2019-03-10 13:08:25 +0000 UTC
2019/03/10 13:08:55 Indexer: realtimeIndex - received BlockDetail 7341576 blockTime: 2019-03-10 13:08:32 +0000 UTC
2019/03/10 13:08:59 ChainFetch: getTransactionDetail cannot get receipt for transaction 0x5bc61c11027aa933ce9a8dfda50bba211427a4f7b3094d1f7ea0048192d3ff28, index=13, blockHash=0x30da95d69f1783b7ebf0692338d4c911b39dcf5af10539075591f93403979ce3 error=not found
2019/03/10 13:08:59 ChainFetch: RealtimeFetch Cannot get block detail for block 7341577
2019/03/10 13:08:59 ChainFetch: Stopped RealtimeFetch
2019/03/10 13:08:59 Indexer: Stopping realtimeIndex, ipc is switched?
2019/03/10 13:08:59 Indexer: Stopped realtimeIndex
2019/03/10 13:08:59 IpcManager: Cannot switch IPC, number of IPC = 1

All logged information is correct. Probably node did not download transaction receipts quick enough in realtime fetch.

twoeths avatar Mar 16 '19 08:03 twoeths