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

368 Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

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

  • The transactionId you're asking a receipt for doesn't actually exist
  • The node the receipt query goes to has never seen that transaction
  • The communication between you and the node you're asking the receipt from is broken
  • You're asking for a receipt for a transaction that's more than 3 minutes old

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.

0
On

Took me 4 days to realize why the copy paste code from the Hedera Developer documentation was not working.

Almost drove me crazy!

Where ever you see code formated like this

//Create a new account with 1,000 tinybar starting balance
const newAccount = await new AccountCreateTransaction()
    .setKey(newAccountPublicKey)
    .setInitialBalance(Hbar.fromTinybars(1000))
    .execute(client);

DONT use it as is! I know thats how it is in the Website but it does not work like that. MAKE SURE ITS IN THE SAME LINE - DONT USE LINE BREAKS!

const newAccount = await new AccountCreateTransaction().setKey(newAccountPublicKey).setInitialBalance(Hbar.fromTinybars(1000)).execute(client);

This fixed it for me when getting the

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

I hope it fixes it for you as well

Here is a link to a repo of my code to make a simple hedera account in the testnet