Trace's methods are intermittent

As the title says, I’m attempting to use the trace methods (specifically trace_block). Everything is good with the response when it works normally. The only problem I face is intermittent: sometimes it works, other times it responds saying “the method does not exist or is not available.”

cURL:

curl --location --request POST 'https://mainnet.infura.io/v3/API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "trace_block",
    "params": [
        "0x132fed1"
    ],
    "id": 4
}'

Expected result:
Given the same request, receive the same response

Steps to reproduce:
Call the trace_block method on Ethereum mainnet repeatedly without modifying any parameters from the initial ones.

Obtained result:
Sometimes you will obtain the normal results, while other times you will receive an error (-32601) implying the method does not exist

{
    "jsonrpc": "2.0",
    "id": 4,
    "error": {
        "code": -32601,
        "message": "The method trace_block does not exist/is not available"
    }
}

Hey @FLiotta ,

The trace methods are available only to our paying customers. This response is expected if you’re using our Core Free account. I can’t reproduce the behaviour on my end. The response I am getting on my free account is the same as yours but consistent with each attempt.
Would mind sharing:

  • your email account + API key you’re using;
  • a request/response sample that worked;

Emil

Hello @epop,

API Keys are not meant to be shared.

According to the Infura documentation about JSON-RPC errors, the error -32601 indicates a method that does not exist or cannot be found. If the method does exist, but the problem is related to my account plan, it should respond with a different error code (e.g., -32005). This would save many headaches during development.

Infura JSON-RPC Errors Documentation

Greetings.

Hello @FLiotta ,

Yes, you’re correct. I shouldn’t have asked for the API key. It looks like I built this reflex while working on our TS requests in Zendesk. I appreciate you reminded me.
And I see your point concerning the error message. It could be phrased better.
The -32005 error code, though, is linked to exceeding the account request limit: " The request exceeds your request limit. For more information, refer to [Avoid rate limiting (Avoid rate limiting | INFURA)."
I don’t see it as a better fit for the situation raised here. Until this part receives an update, the error codes will remain as they are. Should you encounter something like this again in the future, please feel free to reach out. We’re more than happy to assist in any way we can.

Regards,
Emil