Auto tasks suddenly started throwing error on each smart contract method execution

i've previously created an Autotask connected to a relayer to process my meta transactions.
It was working properly for around 2 to 3 months than suddenly it started producing errors on each Smart contract method call.

async function relay(forwarder, request, signature) {
    console.log('--- Relay started ---');
    try {
        console.log('relay validation request and sign ', request, signature);
        const valid = await forwarder.verify(request, signature);
        if (!valid) throw new Error(`Invalid request`);
        const gasLimit = (parseInt(request.gas) + 50000).toString();
        const tx = await forwarder.execute(request, signature, { gasLimit });
        console.log('relay validation success with tx hash', tx.hash);
        return tx;
    } catch (error) {
        console.log('Error in relay: ', error);
        throw new Error('Failed to relay transaction');
    }
}

In this snippet above, it is throwing an error on this line of code

  const valid = await forwarder.verify(request, signature);

The error says:

Error: Unhandled
    at DefenderRelayProvider.send (/opt/nodejs/node_modules/defender-relay-client/lib/ethers/provider.js:58:31)

It was working very fine until suddenly this error pops out !!

Any help please !!!

1 Like

Hey @Chady_Badour

Thanks for reporting. We took a look and traced this error back to a provider not being available at the moment of your requests. This only happened for AVAX and we already enabled a new provider.

There should be no unexpected errors from now on, but please let us know if this keeps happening.

Best

@ernestognw Thank you it is working now

1 Like