Unhandled promise rejections en masse
See original GitHub issueWe’re seeing a ton of unhandled promise rejections using ethers 5.0.12:
Error: timeout (requestBody="{\"method\":\"eth_blockNumber\",\"params\":[],\"id\":52,\"jsonrpc\":\"2.0\"}", requestMethod="POST", timeout=120000, url="...snip...", code=TIMEOUT, version=web/5.0.11)
at Logger.makeError (/opt/indexer/node_modules/@ethersproject/logger/lib/index.js:179:21)
at Timeout._onTimeout (/opt/indexer/node_modules/@ethersproject/web/lib/index.js:148:35)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
The setup is as follows. After creating the Ethereum provider, we use it to make a number of contract calls and create transactions (as you would).
const ethereum = new providers.StaticJsonRpcProvider(
{
url: ...,
user: ...,
password: ...,
allowInsecureAuthentication: true,
},
"mainnet"
)
ethereum.pollingInterval = 4000
ethereum.on('debug', info => { ... })
ethereum.on('network', (newNetwork, oldNetwork) => {
logger.trace('Ethereum network change', {
oldNetwork: oldNetwork,
newNetwork: newNetwork,
})
})
logger.info(`Connected to Ethereum`, {
pollingInterval: ethereum.pollingInterval,
network: await ethereum.detectNetwork(),
})
We have tested custom Ethereum nodes, Alchemy, Infura — the behavior is the same across all of them. I’m not entirely sure what leads to the eth_blockNumber
calls, why they happen so frequently and why they all time out.
I’d be happy to provide more details if needed though.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (7 by maintainers)
Top Results From Across the Web
What is an unhandled promise rejection? - Stack Overflow
A rejected promise is like an exception that bubbles up towards the application entry point and causes the root error handler to produce...
Read more >Node.js Process unhandledPromiseRejection Event
The unhandledRejection event is emitted whenever a promise rejection is not handled. NodeJS warns the console about ...
Read more >How to solve "Unhandled Promise Rejection Warning" in my ...
I am following a youtube tutorial. I want to register a user and save their data in mysql database. It worked for the...
Read more >Tracking Unhandled Promise Rejections - TrackJS
When a promise is rejected, it looks for a rejection handler. If it finds one, like in the example above, it calls the...
Read more >Window: unhandledrejection event - Web APIs | MDN
The unhandledrejection event is sent to the global scope of a script when a JavaScript Promise that has no rejection handler is rejected; ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be addressed in 5.0.26. Please try it out and let me know. 😃
@ricmoo All good now thanks