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

issue with websocket connection to infura #1646

Closed
cmaliwal opened this issue May 21, 2018 · 9 comments
Closed

issue with websocket connection to infura #1646

cmaliwal opened this issue May 21, 2018 · 9 comments
Assignees
Labels
1.x 1.0 related issues Enhancement Includes improvements or optimizations

Comments

@cmaliwal
Copy link

I use websocket (ws) coneection to Infura node

web3 = new Web3(new Web3.providers.WebsocketProvider("wss://ropsten.infura.io/ws"));

sometimes it's works fine or sometimes it give error on console :

Error: CONNECTION ERROR: Couldn't connect to node on WS.

Uncaught (in promise) Error: CONNECTION ERROR: Couldn't connect to node on WS.

I am not getting why its happening.

@nivida nivida self-assigned this Aug 10, 2018
@nivida
Copy link
Contributor

nivida commented Aug 10, 2018

Can you determine when exactly this is happening? It's a bit hard to reproduce it this way.

@nivida nivida added the Enhancement Includes improvements or optimizations label Aug 10, 2018
@minhtruong92
Copy link

I got the same issue, my code works with provider: "wss://ropsten.infura.io/ws" (testnet), but it doesn't work with "wss://mainnet.infura.io/ws".
I use the code in introduction page https://infura.io/docs/wss/introduction

@ryokomy
Copy link

ryokomy commented Sep 27, 2018

I also had the same issue with "wss://rinkeby.infura.io/ws".

@sanaterrae
Copy link

sanaterrae commented Oct 13, 2018

added some other details for same issue found here at INFURA/infura#140

@hrharder
Copy link

I'm having the same issue (using Kovan WS endpoint). It's extremely sporatic... About 25% of the time it works fine, and the other 75% it throws the CONNECTION ERROR.

I'll run my program once and it will fail, and then again with no changes and it will fail.

Hard to see if this is an issue with Infura, or somewhere lower in the stack like the WS driver.

@jamesmorgan
Copy link

I also get this almost exclusive failing with the latest version of web3 1.0.37 - originally I thought it was an issue with Infura but then found this issue, any ideas on the solution - this is the ticket I raised with Infura https://community.infura.io/t/ropsten-connection-error-couldnt-connect-to-node-on-ws/272/5

@jamesmorgan
Copy link

I have also found that adding this config fixed it - taken direct from #1217

{
  clientConfig: {
    maxReceivedFrameSize: 100000000,
    maxReceivedMessageSize: 100000000,
  }
}

@nivida
Copy link
Contributor

nivida commented Jan 25, 2019

@jamesmorgan I've refactored the web3 providers and especially the WebsocketProvider (PR #2000). I will release this PR within the next days and probably this issue got fixed with it. I can't see anything that Web3.js is doing which could have an impact on establishing a connection.

@nivida nivida added the 1.x 1.0 related issues label Jun 20, 2019
This was referenced Nov 21, 2019
@holgerd77
Copy link
Collaborator

No further issue mentions for over a year, will close for now. Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

8 participants