hedera-hashgraphhashgraph

max attempts of 10 was reached for request with last error being: RECEIPT_NOT_FOUND


I've upgraded my sdk to v2.20.0-beta.4, and I am receiving this error when submitting transactions.

I expect the transactions to succeed. They will if I downgrade the sdk to a stable release, so I am guessing this is a bug in beta which happens, but Im more interested in what it means


Solution

  • It means the sdk tried to get a receipt for your transaction 10 times and eventually gave up trying, this could be for a number of reasons

    Given earlier versions of the SDK work fine, it's probably a bug, I'd encourage you to file an issue on the SDK with your findings.

    While asking for a receipt is usually successful (even if the transaction failed), there are edge cases where a successful transaction will not be followed by a successful receipt request (for the reasons above). Those are not necessarily Hedera's fault, you could send a tx from a mobile device, loose network connectivity and then fail to fetch a receipt when you regain connectivity.

    The belts and braces approach is to log the transaction ids in a persisted list, remove from the list when a receipt is obtained and in the event a receipt cannot be obtained, check with a mirror node whether any transactions in the list have succeeded (or not). If a transaction in the list is more than 3 minutes old and there is no record of it on a mirror node, it hasn't and will never be processed.