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

[v1.2.1] Connection not Open. #3092

Closed
NakOh opened this issue Oct 2, 2019 · 6 comments
Closed

[v1.2.1] Connection not Open. #3092

NakOh opened this issue Oct 2, 2019 · 6 comments
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@NakOh
Copy link

NakOh commented Oct 2, 2019

Description

스크린샷 2019-10-02 오후 5 54 53

Expected behavior

I get an error periodically.

maybe

web3.eth.getBalance or web.eth.getBlock .. etc

Actual behavior

Steps to reproduce the behavior

@cgewecke cgewecke added the 1.x 1.0 related issues label Oct 4, 2019
@nivida
Copy link
Contributor

nivida commented Oct 8, 2019

Thanks for opening this issue! Could you provide an explicit example setup to reproduce this issue?

@NakOh
Copy link
Author

NakOh commented Oct 10, 2019

It's so simple.

just

const web3 = new Web3('ws://' + serverList[0].host + ":" + serverList[0].port);
web3.setProvider('ws://' + serverList[0].host + ":" + serverList[0].port);

connect Socket.

		var endBlockNumber = await web3.eth.getBlockNumber();

or

	var amounts = await web3.eth.getBalance('MyAddress');

Call Web.eth function.

Somtimes I got 'Connection not Open Error' !!!

i'm going crazy..

It happens only occasionally, so it's going crazy.

@nivida
Copy link
Contributor

nivida commented Oct 10, 2019

Thanks. This got fixed in the 2.x branch and will be back-ported asap.

@nivida nivida added Bug Addressing a bug and removed more information needed labels Oct 10, 2019
@nivida nivida mentioned this issue Nov 21, 2019
7 tasks
@fengyh13
Copy link

I got this error too. It happens only occasionally! And eth.subscribe('newBlockHeaders') cannot get data anymore

@nivida
Copy link
Contributor

nivida commented Jan 13, 2020

@fengyh13 Thanks for letting us know about! We do currently improve the WebsocketProvider and the handling of providers in web3.js with PR #3190 and will release the changes as soon as anything is ready.

@ryanio ryanio mentioned this issue Apr 15, 2020
13 tasks
@cgewecke
Copy link
Collaborator

cgewecke commented Jun 9, 2020

This should be resolved with the recent Websockets upgrade. You can configure the provider to automatically reconnect if your connection is unstable.

Relevant docs

@cgewecke cgewecke closed this as completed Jun 9, 2020
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 Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants