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.

Custom RPC triggers a timeout, but works using Curl

See original GitHub issue

Describe the bug I am trying to use a network called Neon Devnet. I initialize the provider properly using StaticJsonRpcProvider with the right provider name and chainId, but no calls or transaction pass. I always get a timeout. We could think that it’s network related, but the same call works on Curl.

Reproduction steps

Initializing the provider:

  const provider = new ethers.providers.StaticJsonRpcProvider('https://proxy.devnet.neonlabs.org/solana', { name: 'Neon', chainId: 245022926 });

So far so good. But once I try to shout this:

  provider.getBlockNumber()

I get this raised: Uncaught Error: timeout (requestBody="{\"method\":\"eth_blockNumber\",\"params\":[],\"id\":44,\"jsonrpc\":\"2.0\"}", requestMethod="POST", timeout=120000, url="https://proxy.devnet.neonlabs.org/solana", code=TIMEOUT, version=web/5.5.0)

image

Extracting the parameters from the exception : {"method":"eth_blockNumber","params":[],"id":44,"jsonrpc":"2.0"}

Crafting a Curl command:

curl -X POST --data '{"method":"eth_blockNumber","params":[],"id":44,"jsonrpc":"2.0"}' https://proxy.devnet.neonlabs.org/solana

The Curl command works properly:

{"jsonrpc": "2.0", "id": 44, "result": "0x5d31cef"}

Difficult to know what is going wrong , why do I keep having a timeout using the ethers.js library. Thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Nov 30, 2021

I’m not at a computer so I haven’t been able to try curl yet. I’ll look more into this later today too.

It could still be a proxy or server configuration, but I’ll need to look more into it.

0reactions
shideneyucommented, Nov 30, 2021

thank you !

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the curl error 52 "empty reply from server"?
I have a cron job setup on one server to run a backup script in PHP that is hosted on another server. The...
Read more >
How to set a timeout for a Curl request? - ReqBin
The waiting time is called a timeout. Curl sends requests works over a network connection. The first step in getting a resource from...
Read more >
curl (52) empty reply from server - Different causes and fixes
curl (52) empty reply from server occurs when the libcurl didn't receive any response from the server after it sent off its request....
Read more >
How to recover from curl: (56) Send failure: Connection was ...
curl by default does not retry on all errors, even with --retry . So either use --retry-all-errors (since curl 7.71.0), or use wget...
Read more >
RPC timeout traces | CDP Private Cloud
Cloudera uses cookies to improve site services. By using this site, you consent to our use of cookies. Accept cookies. 7.1.
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