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

Error when when connection close while getting logs #2614

Closed
vshab opened this issue Mar 29, 2019 · 1 comment · Fixed by #2625
Closed

Error when when connection close while getting logs #2614

vshab opened this issue Mar 29, 2019 · 1 comment · Fixed by #2625
Labels
Bug Addressing a bug

Comments

@vshab
Copy link

vshab commented Mar 29, 2019

Description

Infura can close websocket connection when request takes a lot of time, for example query past events starting block 0 on mainnet. In this case web3 produce this error in console:

web3-providers.umd.js:293 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined
    at WebsocketProvider._callee2$ (web3-providers.umd.js:293)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:264)
    at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/static/js/0.chunk.js:112974:21)
    at asyncGeneratorStep (asyncToGenerator.js:3)
    at _next (asyncToGenerator.js:25)

https://github.com/ethereum/web3.js/blob/1.0/packages/web3-providers/lib/providers/AbstractSocketProvider.js#L195 is the location in file where the error occurs.

Screenshot from debugger:
Screenshot 2019-03-30 at 02 19 32

Steps to reproduce the behavior

  1. Connect to mainnet with Infura websocket provider
  2. query past events from 0 to latest block several times in parallel (3 in my case)
  3. Infura will close the connection with some probability and the error will be shown

Versions

  • web3.js: 1.0.0-beta.51
  • browser: Chrome 71
  • ethereum node: Mainnet Infura WebSocket
@nivida nivida added the Bug Addressing a bug label Mar 29, 2019
@nivida
Copy link
Contributor

nivida commented Mar 29, 2019

Thanks for opening this issue! I'll test and fix it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants