Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getLogs Error: failed to meet quorum #841

Closed
lastmjs opened this issue May 20, 2020 · 31 comments
Closed

getLogs Error: failed to meet quorum #841

lastmjs opened this issue May 20, 2020 · 31 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@lastmjs
Copy link

lastmjs commented May 20, 2020

I can't seem to find much information about this error on the internets, but when I run getLogs I very often receive this error:

(node:4431) UnhandledPromiseRejectionWarning: Error: failed to meet quorum (method="getLogs", params={"filter":{"fromBlock":"0x98ee95","address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000"]}}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1589994809982,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":44,"_internalBlockNumber":{},"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"start":1589994809978,"error":{"reason":"processing response error","code":"SERVER_ERROR","body":{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":43},"error":{"code":-32601}}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994814252,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{},"_poller":null,"_bootstrapPoll":null},"weight":1,"start":1589994809979,"error":{}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994815808,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":44,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"start":1589994810730,"error":{}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994815430,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":44,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"start":1589994810730,"error":{}}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1589994809978,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994815430,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":44,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994814252,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{},"_poller":null,"_bootstrapPoll":null},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":10104063,"_events":[],"_pollingInterval":4000,"_emitted":{"block":10104063},"_fastQueryDate":1589994815808,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":44,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10104063,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1589994809982,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":44,"_internalBlockNumber":{},"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":2,"_highestBlockNumber":10104063,"_internalBlockNumber":{},"_fastBlockNumber":10104063,"_fastBlockNumberPromise":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.167)
    at Logger.makeError (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/logger/lib/index.js:178:21)
    at Logger.throwError (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/logger/lib/index.js:187:20)
    at FallbackProvider.<anonymous> (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/providers/lib/fallback-provider.js:626:54)
    at step (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/providers/lib/fallback-provider.js:46:23)
    at Object.next (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/providers/lib/fallback-provider.js:27:53)
    at fulfilled (/home/lastmjs/development/btc-on-ethereum/node_modules/@ethersproject/providers/lib/fallback-provider.js:18:58)

What I'm trying to do is filter through ERC20 transactions from the 0 address, to get mints. This does work, but this error is thrown so often it's not very usable.

I'm using ethers v5.0.0-beta.187

@ricmoo ricmoo added the investigate Under investigation and may be a bug. label May 20, 2020
@ricmoo
Copy link
Member

ricmoo commented May 20, 2020

Can you provide an example query you are using?

This error happens when the backends disagree on the result. I may have to relax the response fuzzy matching for something in getLogs I'm not currently taking into account.

This is something I likely need to address, but if you'd like more background, here are the docs. Any example you can provide that occasionally trigger this would be useful.

@ricmoo
Copy link
Member

ricmoo commented May 20, 2020

Oh, never mind. I see your filter is present in the error. :)

@ricmoo
Copy link
Member

ricmoo commented May 20, 2020

I found the bug. It has nothing to do with the fuzzy matching logic. I'll fix it asap.

@ricmoo ricmoo added bug Verified to be an issue. next version (v5) on-deck This Enhancement or Bug is currently being worked on. and removed investigate Under investigation and may be a bug. labels May 20, 2020
@lastmjs
Copy link
Author

lastmjs commented May 20, 2020

Oh nice, I was afraid it was a problem with infura. Thanks for the speedy response, this is why I love ethers!!! Seriously, I really appreciate it

@ricmoo
Copy link
Member

ricmoo commented May 21, 2020

The has been fixed in 5.0.0-beta.188. Please try it out and let me know if you have any problems.

I've also added stricter typing to the related utility function, so the compiler should catch these bugs in the future.

Thanks! :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels May 21, 2020
@lastmjs
Copy link
Author

lastmjs commented May 21, 2020

I'm trying it out, seems to be good so far. I'll monitor it throughout the day and if everything looks good I'll consider this fixed

@lastmjs
Copy link
Author

lastmjs commented May 22, 2020

Working great for me all day

@lastmjs lastmjs closed this as completed May 22, 2020
@lastmjs lastmjs reopened this May 22, 2020
@lastmjs
Copy link
Author

lastmjs commented May 22, 2020

Actually, I just ran into it again. It's been working like a champ all day. When this happened, I was refreshing the page I was working on a lot, which was pulling data from infura quite a bit:

Uncaught (in promise) Error: failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113361,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734401,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":43,"_internalBlockNumber":{},"_fastBlockNumber":10113361,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118734292,"result":10113361},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734458,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118734292,"result":10113366},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113365,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736415,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10113365,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118735368,"result":10113365},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736761,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118735368,"result":10113366}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734458,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113365,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736415,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10113365,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736761,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113361,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734401,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":43,"_internalBlockNumber":{},"_fastBlockNumber":10113361,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":2,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.168)
    at Logger.makeError (ethers.esm.js:260)
    at Logger.throwError (ethers.esm.js:260)
    at FallbackProvider.<anonymous> (ethers.esm.js:1359)
    at Generator.next (<anonymous>)
    at fulfilled (ethers.esm.js:1308)

@Mrtenz
Copy link

Mrtenz commented Jun 1, 2020

I'm running into the same issue. Calling provider.getTransaction(transactionHash); fails with either

Uncaught (in promise) Error: missing response (serverError={}, url="https://api.etherscan.io/api", code=SERVER_ERROR, version=web/5.0.0-beta.141)
    at Logger.makeError (index.js:165)
    at Logger.throwError (index.js:174)
    at index.js:100
    at Generator.throw (<anonymous>)
    at rejected (index.js:6)

when using a JsonRpcProvider, or

Uncaught (in promise) Error: failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"start":1591012792483,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"}}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":0.5,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.170)
    at Logger.makeError (index.js:165)
    at Logger.throwError (index.js:174)
    at FallbackProvider.<anonymous> (fallback-provider.js:517)
    at Generator.next (<anonymous>)
    at fulfilled (fallback-provider.js:5)

when using getDefaultProvider() or a FallbackProvider with the default Infura/Etherscan or own JSONRPC provider.

I'm using:

    "@ethersproject/abi": "^5.0.0-beta.155",
    "@ethersproject/providers": "^5.0.0-beta.170",

@EvilJordan
Copy link

EvilJordan commented Jul 14, 2020

Seeing this failure as well when calling estimateGas

"ethers": "^5.0.4",
"@ethersproject/experimental": "^5.0.0"

Edit: Apologies. This was my fault... My ABI was incorrect, which causes the error. Leaving for posterity.

@lastmjs
Copy link
Author

lastmjs commented Jul 31, 2020

This issue has come back, and it's relentless now

@ricmoo
Copy link
Member

ricmoo commented Jul 31, 2020

What version are you running?

If you don’t mind reducing security, you can reduce the quorum. By default, the mainnet quorum is 50% of the number of backends (i.e. 2 of 4). But if you reduce that to 1, you should pretty much never see this. It does mean that if a backend is out of sync, you may get out-is-sync responses.

@lastmjs
Copy link
Author

lastmjs commented Jul 31, 2020

I am using 5.0.0-beta.188

@ricmoo
Copy link
Member

ricmoo commented Jul 31, 2020

Try upgrading to the latest version. That one is quite old and still beta. There have been a lot of provider improvements added. :)

@lastmjs
Copy link
Author

lastmjs commented Aug 1, 2020

Just upgraded to 5.0.7, same issues:

(node:4610) UnhandledPromiseRejectionWarning: Error: failed to meet quorum (method="getLogs", params={"filter":{"fromBlock":"0xa09622","toBlock":"0xa161d2","address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885"]}}, results=[{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":10576339},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576339,"_lastBlockNumber":10576339,"_pollingInterval":4000,"_fastQueryDate":1596317455997,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":50,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10576339,"_fastBlockNumberPromise":{}},"weight":1,"start":1596317430097,"error":{"reason":"processing response error","code":"SERVER_ERROR","body":{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request. Requested data is older than 128 blocks."},"id":49},"error":{"code":-32600},"requestBody":"{\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0xa09622\",\"toBlock\":\"0xa161d2\",\"address\":\"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\",\"topics\":[\"0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885\"]}],\"id\":49,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://cloudflare-eth.com/"}},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576338,"_lastBlockNumber":-2,"_pollingInterval":4000,"_fastQueryDate":1596317430098,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10576338,"_fastBlockNumberPromise":{}},"weight":1,"start":1596317430097,"error":{"reason":"invalid BigNumber string","code":"INVALID_ARGUMENT","argument":"value","value":"0x","checkKey":"logIndex","checkValue":"0x"}},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":10576339},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576339,"_lastBlockNumber":10576339,"_pollingInterval":4000,"_fastQueryDate":1596317435231,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":45,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10576339,"_fastBlockNumberPromise":{}},"weight":1,"start":1596317430847,"result":[{"blockNumber":10536917,"blockHash":"0xd1a04abb94bb2445a30f20948b308783751e2968b9edf400f334be441981228a","transactionIndex":21,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x000000000000000000000000000000000000000000000000000000024dac44b0","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x0000000000000000000000000967aea99754974a4cc4dbf29009155a49588171"],"transactionHash":"0x7606ccfc3295c82a4cd800de18e190bbe0f66337e4d633b7f301b2be8d230e85","logIndex":28},{"blockNumber":10539026,"blockHash":"0xd1dfd87e17b7b731cc7ebe1886cca96fd87633df1505be3c800825942343ae48","transactionIndex":1,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x000000000000000000000000000000000000000000000000000000024dac44b0","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x0000000000000000000000000967aea99754974a4cc4dbf29009155a49588171"],"transactionHash":"0xe767b40d5bdfb644de5871c0033ba08954f95a5aacab473d6025bc69a71b7e85","logIndex":0},{"blockNumber":10539158,"blockHash":"0xf2afc140ada5d6faa4fce7640c8d178f9d7cb946b3001cd0e79c5e29b26e7bed","transactionIndex":92,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x000000000000000000000000000000000000000000000000000000037d719e60","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x0000000000000000000000000967aea99754974a4cc4dbf29009155a49588171"],"transactionHash":"0x1a4aa9941b224a259f59dbc75f3d35d7a91bbb6745be9595cf3252d081a66b59","logIndex":210},{"blockNumber":10549609,"blockHash":"0x72a1db4c3a7365767a51325910bdab562763078d29ebd314d13adb4ee153602f","transactionIndex":4,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x00000000000000000000000000000000000000000000000000000004a7422880","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x0000000000000000000000000967aea99754974a4cc4dbf29009155a49588171"],"transactionHash":"0x0d29cb67c77c7c2de981562a2f1a636f54da936bb51fb7af2de89df7423601ea","logIndex":1},{"blockNumber":10552515,"blockHash":"0x6b882b10f13d669aa1fdb9a1ee57b361f96e24f6b0b2cacbacabdcb204901439","transactionIndex":8,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x0000000000000000000000000000000000000000000000000000000000079d38","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x000000000000000000000000808e4981f6287b13711b78de9d7c169e5d180643"],"transactionHash":"0xe94b97078e3f625d1f2d5fad6997f03351118cc31cb66d9bd1de904beaeec5fb","logIndex":20},{"blockNumber":10556670,"blockHash":"0xe31a5b603117feb125f007e8367c4f36739adf0d1508209f3d52dada5e2fc505","transactionIndex":89,"removed":false,"address":"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","data":"0x00000000000000000000000000000000000000000000000000000000000137e0","topics":["0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885","0x0000000000000000000000009ba1014bd2e50f4fb601ca178416e76aca8d2810"],"transactionHash":"0x01aa66fe1dbd6c886e06e618f4cf6f9a082033ed9b445a2fc65b5a6a7a5f4958","logIndex":80}]},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576338,"_lastBlockNumber":-2,"_pollingInterval":4000,"_fastQueryDate":1596317430851,"connection":{"url":"https://eth-mainnet.alchemyapi.io/v2/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":44,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10576338,"_fastBlockNumberPromise":{}},"weight":1,"start":1596317430848,"error":{"reason":"processing response error","code":"SERVER_ERROR","body":{"jsonrpc":"2.0","id":43,"error":{"code":-32600,"message":"Requested block range for eth_getLogs is greater than the limit of 1000 blocks. Please reduce range and retry."}},"error":{"code":-32600},"requestBody":"{\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0xa09622\",\"toBlock\":\"0xa161d2\",\"address\":\"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599\",\"topics\":[\"0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885\"]}],\"id\":43,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://eth-mainnet.alchemyapi.io/v2/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"}}], provider={"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576338,"_lastBlockNumber":-2,"_pollingInterval":4000,"_fastQueryDate":1596317430033,"providerConfigs":[{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":10576339},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576339,"_lastBlockNumber":10576339,"_pollingInterval":4000,"_fastQueryDate":1596317435231,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":45,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10576339,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576338,"_lastBlockNumber":-2,"_pollingInterval":4000,"_fastQueryDate":1596317430098,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10576338,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576338,"_lastBlockNumber":-2,"_pollingInterval":4000,"_fastQueryDate":1596317430851,"connection":{"url":"https://eth-mainnet.alchemyapi.io/v2/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":44,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10576338,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"_events":[],"_emitted":{"block":10576339},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10576339,"_lastBlockNumber":10576339,"_pollingInterval":4000,"_fastQueryDate":1596317455997,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":50,"_internalBlockNumber":{},"_poller":null,"_bootstrapPoll":null,"_fastBlockNumber":10576339,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":2,"_highestBlockNumber":10576338,"_internalBlockNumber":{},"_fastBlockNumber":10576338,"_fastBlockNumberPromise":{}}, code=SERVER_ERROR, version=providers/5.0.5)

@lastmjs
Copy link
Author

lastmjs commented Aug 1, 2020

If I reduce the quorum to 1, will I always get an out of sync error if the blocks are out of sync? Or is there a likely possibility of actually getting incorrect block information?

@AugustoL
Copy link

AugustoL commented Aug 7, 2020

Having the same issue:

error: Error: failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"start":1596814734802,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://api-kovan.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"start":1596814735552,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"start":1596814736302,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"}}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":1,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.165) at Logger.makeError (http://localhost:3000/static/js/6.chunk.js:53513:19) at Logger.throwError (http://localhost:3000/static/js/6.chunk.js:53523:16) at FallbackProvider.<anonymous> (http://localhost:3000/static/js/6.chunk.js:56540:21) at Generator.next (<anonymous>) at fulfilled (http://localhost:3000/static/js/6.chunk.js:55889:24)
code: "SERVER_ERROR"
method: "getBlockNumber"
params: {}
provider: FallbackProvider {_isProvider: true, formatter: Formatter, _network: {…}, _maxInternalBlockNumber: -1024, _lastBlockNumber: -2, …}
reason: "failed to meet quorum"
results: Array(3)
0: {provider: EtherscanProvider, weight: 1, start: 1596814734802, error: Error: missing response (serverError={}, url="https://api-kovan.etherscan.io/api?module=proxy&actio…}
1: {provider: AlchemyProvider, weight: 1, start: 1596814735552, error: Error: missing response (serverError={}, url="https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBs…}
2: {provider: InfuraProvider, weight: 1, start: 1596814736302, error: Error: missing response (serverError={}, url="https://kovan.infura.io/v3/84842078b09946638c03157f83…}
length: 3
__proto__: Array(0)
message: "failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"start":1596814734802,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://api-kovan.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"start":1596814735552,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"start":1596814736302,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"}}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":1,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.165)"
stack: "Error: failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"start":1596814734802,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://api-kovan.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"start":1596814735552,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"}},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"start":1596814736302,"error":{"reason":"missing response","code":"SERVER_ERROR","serverError":{},"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"}}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://kovan.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"baseUrl":"https://api-kovan.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"kovan","chainId":42,"ensAddress":null},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"connection":{"url":"https://eth-kovan.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":1,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.165)↵    at Logger.makeError (http://localhost:3000/static/js/6.chunk.js:53513:19)↵    at Logger.throwError (http://localhost:3000/static/js/6.chunk.js:53523:16)↵    at FallbackProvider.<anonymous> (http://localhost:3000/static/js/6.chunk.js:56540:21)↵    at Generator.next (<anonymous>)↵    at fulfilled (http://localhost:3000/static/js/6.chunk.js:55889:24)"
__proto__: Object
loading: false

Using quorum value of 1

@zemse
Copy link
Collaborator

zemse commented Aug 7, 2020

In the logs given by @AugustoL, looks like using a fallback provider with three providers (probably getDefaultProvider) and error for each of them is Error: missing response as in the logs. Even I'm seeing this for both infura as well as my private openethereum node!

Actually I saw this while solving an issue for my colleague who is working on a block explorer that queries blocks, transactions, receipts in a serial fashion. In a while, first 8-10 requests success, then boom. All following request error with missing response. I'm not sure if this is ethers issue or something about network, could be parity/openethereum issue. This probably is not a rate limiting issue, since my private ethereum node shouldn't rate limit me. But I'm gonna debug this tomorrow to understand what's the scene.

@zemse
Copy link
Collaborator

zemse commented Aug 7, 2020

@lastmjs, I just scrolled to the right in your logs, and I saw this text Invalid Request. Requested data is older than 128 blocks.

@ricmoo
Copy link
Member

ricmoo commented Aug 7, 2020

@zemse Oh. That is good to know. Was that from the AlchemyProvider? They told me they were making some changes to their log ranges. I may have to add custom logic to the FallbackProvider to be more lenient on getLogs when the range is beyond their range...

@zemse
Copy link
Collaborator

zemse commented Aug 10, 2020

I'm having a hard time debugging the missing response problem I'm facing.

if (response == null) {
runningTimeout.cancel();
logger.throwError("missing response", Logger.errors.SERVER_ERROR, {

I'm really surprised that the RPC response can be null! I am very much interested in reproducing this issue with an external RPC trial (using for e.g. curl) but all my attempts have failed :'( I always get proper RPC response from a node while the app (using ethers.js) occasionally throws missing response (most times it works but sometimes this error comes). I've even executed a loop of 500 async raw calls all resolved in about 14-15 secs with proper RPC response on our private node, which confirms that there isn't any rate limiting.

Just someone created an issue #993 as well as #841 (comment). This shows that people are experiencing the missing response error, that too, recently. This wasn't happening before. Any suggestions for more debugging?

@ricmoo Is there any chance that the response is incorrectly parsed as null when received by ethers.js? Though I understand an RPC response would definitely help to answer this question. Is there any debug mode which can be useful to console log the actual response that was received by ethers.js?

@zemse
Copy link
Collaborator

zemse commented Aug 10, 2020

(node:18497) UnhandledPromiseRejectionWarning: Error: missing response (requestBody=
{"0":123,"1":34,"2":109,"3":101,"4":116,"5":104,"6":111,"7":100,"8":34,"9":58,"10":34,"11":101,"12":116,"13":104,"14":95,"15":98,"1
6":108,"17":111,"18":99,"19":107,"20":78,"21":117,"22":109,"23":98,"24":101,"25":114,"26":34,"27":44,"28":34,"29":112,"30":97,"3
1":114,"32":97,"33":109,"34":115,"35":34,"36":58,"37":91,"38":93,"39":44,"40":34,"41":105,"42":100,"43":34,"44":58,"45":51,"46
":49,"47":55,"48":44,"49":34,"50":106,"51":115,"52":111,"53":110,"54":114,"55":112,"56":99,"57":34,"58":58,"59":34,"60":50,"61"
:46,"62":48,"63":34,"64":125}, requestMethod="POST", serverError=
{"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"mainnet.infura.io"}, 
url="https://mainnet.infura.io/v3/84842078b09946638c03157f83405213", code=SERVER_ERROR, version=web/5.0.3)

Does this request body look like a Uint8Array of a signature?

I was calling block number repeatedly in an async.

const provider = new InfuraProvider();
for (let i = 0; i < 500; i++) {
    provider.getBlockNumber().then(console.log);
}

The above code also gives one or two missing response errors for private eth nodes (parity).

@ricmoo
Copy link
Member

ricmoo commented Aug 10, 2020

What URL are you hitting? This usually means the fetch failed. This can happen when a backend service (like Etherscan behind Cloudflare) is throttles (in this example, by Cloudflare), in which case it returns a 403, but without any CORS headers, which means it fails very far up the stack; so far there is no way to detect what happens, fetch just rejects with a TypeError and zero additional info. If you use the karma test cases you can toggle some of the flags in the config to make chrome great CORS differently, which at least provides the content of the 403, which is sometimes quite useful. :)

Try matching your curl user agent to that of the browser you are using and you might have better luck reproducing it. I have spent days with these sorts of errors to reproduce, only to find out Cloudflare had expanded the list of user-agents they more aggressively throttle (but not with a 429, but with a non-CORS 403).

This is just an example, but it may help you with your null responses. :(

@ricmoo
Copy link
Member

ricmoo commented Aug 10, 2020

(this can probably happen even on a private parity, if you are hitting it harder than it responds and it hiccups in its server event loop)

@ricmoo
Copy link
Member

ricmoo commented Aug 10, 2020

I’m not at a computer right now, but that definitely looks like a Uint8array filled with plain text data (all the values are less than 128), so if you try using toUtf8String on it, you might get something useful. :)

@zemse
Copy link
Collaborator

zemse commented Aug 10, 2020

The request body was containing a simple json rpc request.

I narrowed this down to these errors (by console.logging inside ethers.js dist codes):

Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}
Error: Client network socket disconnected before secure TLS connection was established
    at connResetException (internal/errors.js:609:14)
    at TLSSocket.onConnectEnd (_tls_wrap.js:1552:19)
    at Object.onceWrapper (events.js:421:28)
    at TLSSocket.emit (events.js:327:22)
    at TLSSocket.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1221:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'ECONNRESET',
  path: null,
  host: 'testnet.eraswap.network',
  port: 443,
  localAddress: undefined
}

These two errors (sometimes one, sometimes the other) causes the response variable to be set as null, which ends up into a missing response error. Do you know what this means? I tried to google, and got to know this is related to node.js. Until then I'll try to look more into this and update if got any lead.

Edit: In case of infura, I found these errors that make response null:

Error: getaddrinfo ENOTFOUND mainnet.infura.io
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'mainnet.infura.io'
}

Edit: Also these errors came while high rate RPC shooting, might not represent actual thing. Maybe I should put this console.log in the server to see the actual error that causes missing response in our server (which I currently don't have access to, so I'll do it tom with my colleague).

@zemse
Copy link
Collaborator

zemse commented Aug 13, 2020

Hi @ricmoo, Is it possible for ethers.js to include actual error with the missing response error?

@ricmoo
Copy link
Member

ricmoo commented Oct 7, 2020

This should be fixed now, in the sense that errors are more readable. I'm going to close this now to help clean up some older stale issues, but please re-open if this is still an issue.

Thanks! :)

@ricmoo ricmoo closed this as completed Oct 7, 2020
@ghost
Copy link

ghost commented Dec 30, 2020

@ricmoo
I'm facing similar issue on react-native mobile app.
Here's the error log.

[Error: missing response (requestBody=null, requestMethod="GET", serverError={"line":33519,"column":24,"sourceURL":"http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false"}, url="https://api-kovan.etherscan.io/api?module=account&action=balance&address=0x8C61D335519CF8C4D917cc75bBE3fC6ba4312863&tag=latest&apikey=9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB", code=SERVER_ERROR, version=web/5.0.11)]

The problem is that https://api-kovan.etherscan.io/api?module=account&action=balance&address=0x8C61D335519CF8C4D917cc75bBE3fC6ba4312863 itself is returning correct response.

Is react-native not supported by ethers.js?

@ricmoo
Copy link
Member

ricmoo commented Dec 30, 2020

@ppianist are you including the react-native shims? The RN platform is missing important functionality that is shimmed by them.

See: https://docs.ethers.io/v5/cookbook/react-native/

Let me know if that helps. :)

@ghost
Copy link

ghost commented Dec 30, 2020

@ricmoo Thanks! It works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

6 participants