metamask-extension
metamask-extension copied to clipboard
MetaMask - RPC Error: header not found
I don't launched a project for a 5 days and everything works fine. But now the calls like web3.eth.getBalance or contract methods returns:
{code: -32000, message: "header not found"}
Does anything changed during this period, what the header means? Will appreciate your help, thanks in advance.
Please provide additional information that could help reproduce your issue. For example code snippets, browser/OS versions, and console/network logs could help explain your issue.
I was able to reproduce this bug. It appears to fail intermittently. This us to a bug with Infura (apparently related to load balancing) - they have a fix in development, but it's still broken in prod at the moment.
In the meantime I'd suggest retrying any requests that fail with this error
im also seeing this issue today. was there ever another ticket created with infura for this?
This issue has been causing us some trouble for the past couple of days. Can someone prioritize it ?
what is happening? seems this error code -32000 is
"-32000": {
standard: "EIP 1474",
message: "Invalid input."
},
more about the error https://github.com/ethereum/EIPs/issues/136
code description meaning -32000 INVALID_VALUE parameter contains invalid value INVALID_VALUE 0 invalid input, e.g. missing mandatory input
Maybe something about the new version of metamask dropping support for web3
related https://github.com/MetaMask/metamask-extension/issues/7708

Do you get this a lot? @owocki @peculiarity
Solved it! I was on mainnet and the web3 was set to rinkeby instead so it gave this error!
@x5engine Could you explain a bit more what you mean by solved?
I am also getting the same error, It would be great if there was some sort of explanation in the error of what is happening and what the error is.

@crazyrabbitLTC not solved. It's still happening with regularity on mainnet. Appears to be a bug with infura as @Gudahtt mentioned, but I don't know more than that.
any update on this issue? We are also experiencing this bug regularly.
the bug happens when you use something not on mainnet To be honest....
The bug is still happening. Working on Ropsten testnet. Haven't tested on main net, but will do and let you guys know.
@01fbk let me know! I am waiting!
FYI for anyone facing the same issue. I was facing the similar issue on ropsten network I changed my network to mainnet and back to ropsten everything started to work fine.
This error seems to mean that the specified block number is not on geth.
@karankiri this solved it for me, thank you. I was getting this error when connected to a localnet and needed to switch to mainnet and back for this error to stop throwing.
I am getting this error. Does anybody have a solution. Thanks in advance.
Error to read Metamask ERC balance: {"code":-32000,"message":"header not found"}
Bump; the error still happens when using getBalance()
Error still comes quite often any idea how to solve it?
Also seeing this problem often
currently getting this error frequently too, has something happened recently to cause this?
issue now appears to have resolved itself, perhaps it was an issue with the rpc node metamask was using...
This error code is something I have come across frequently in the past and has cropped up again for a project my team is working on. Our current solution is to drop using the MM provider for reading data from ethereum and use a dedicated endpoint directly to infura/alchemy. The issue we experience is that these errors coincide with data not being fetched when connected through the MM provider and using the same address. It does not seem to matter whether it is kovan or mainnet.
In more detail, the issue we are experiencing populates our logs as many have indicated further up the thread. The trace indicates it comes from inpage.js, a file part of the metamask extension and the error code, after trawling through the minified code in the extension indicates these requests providing invalidInput

For reference the json-rpc specification reserves -32000 for implementation defined errors

This invalidInput could mean potentially a few things but one thing to rule out is that from rigorous testing it is not caused by incorrect input to contract calls and must be resulting between MM and the infura connection it uses.
I don't have any conclusive idea as to what is causing this but I have a gut feeling that it could be throttling. I say this as I have been able monitor the network traffic of the MM extension and the requests are being made to infura and responding without error as shown below.

The project does make a relatively large amount of requests, ~1000/min which in our experience has caused the issue to surface quickly compared to other projects.
MM must have some form of backend which monitors the transaction data so that it can validate txs failing or not, I'm sure many who have used MM have observed this before signing. The question is that is there an intermediary backend between client & node which is used to monitor data fetches or at least throttles after heavy usage? One interesting observation is that while receiving these -32000 errors and potentially being throttled, switching to another address in the same extension worked without issue. Switching back to the first address resulted in the errors again.
It would be appreciated if someone from MM could comment on the issue as it has been over 2 years since this issue has been flagged with little to no response
We recently launched on BSC and we have this error showing up often as well.
Clients have this issue with the https://ethereumico.io/multisend/ service.
I'm also experiencing this error on BSC.
Looks like this fixed this problem in my case: address = web3.utils.toChecksumAddress(address.replace("0X", "0x"))
Switching networks back and forth in Metamask makes the error disappear !!! I got this error when I was resetting the blockchain and trying to reconnect with the same settings.
I'm having the same problem here.
Commenting on this bug for every project we encounter it on. Second project this week. Had to introduce artificial delays to the promises calling the contract read functions in order to get around it. Please fix this its really bad.
What's worse is it only seems to present itself on mainnet in my experience.
For others hitting this issue we worked around it by introducing a 100ms delay between RPC requests.
On my private clique network, the issue was popping up every time.
Geth was running with --miner.gasprice 1
This made Metamask to use scientific notation in the Send screen as far as gas price was concerned. I started Geth with --miner.gasprice 10000000 and the issue automagically went away.
Hope it fixes it for someone out there.