question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

provider stops/hangs for no reason

See original GitHub issue

Ethers Version

5.6.1

Search Terms

hangs,provider,block

Describe the Problem

I use the following code with AlchemyWebsocket provider.

provider.on('block', async (blockNumber: number) => {
      const logs = await provider.getLogs(someFilter);
      // process logic
}

I run this in ECR container on AWS. Ideally, this should run continuously to listen to every block. The problem is that after some random hours it hangs and stops listening.

It doesn’t even log any errors. And it doesn’t seem like something to do with container memories etc. What’s interesting is that the health check endpoint that is exposed returns 200 OK responses, even after the provider stops listening - which means the docker container is still running.

It normally happens after 5-6 hours but in general, the timing is more or less random.

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

node.js (older than v12)

Environment (Other)

docker, docker compose, AWS ECR

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
varunsrincommented, Jun 7, 2022

@ricmoo we’re running into this issue as well when using alchemy. the proximate cause is that their server fails for some reason, which i’m investigating with them.

but the underlying problem is that there is something in the getLogs call to a websocket provider that causes the process to hang and increase memory consumption constantly.

0reactions
mrunbankedcommented, Jul 7, 2022

Is it possible to implement some kind of reconnect logic upon timeout if the socket hangs?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Black Screen and System Restart with Even ID 41
Hi Guyz , My system suddenly stops / hangs and goes black and restarts . I updated driver / OS . Still my...
Read more >
Can My Doctor Stop Treating Me For No Reason?
Yes, your doctor can stop treating you for any non-discriminatory reason. However…(there's always conditions), there is a protocol that should be followed ...
Read more >
Unable to install RHEL 8 - Red Hat Customer Portal
I just tried both DVD iso and boot ISO. Boot iso is not connecting to wifi just staying on connecting (forever).
Read more >
3G connection frequently stops/hangs | Page 3 | XDA Forums
the reason we cannot stay on hsdpa and are transfered to 3g is because providers don't want idle connections clogging up their fast...
Read more >
Unable to Perform a System Update - Soporte de Nintendo
The system update stops, hangs, or freezes. ... Wireless interference can cause your Wii U Internet connection to time out during the update....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found