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

getPastEvents does not work anymore #54

Closed
CineTek opened this issue Jan 12, 2018 · 11 comments
Closed

getPastEvents does not work anymore #54

CineTek opened this issue Jan 12, 2018 · 11 comments

Comments

@CineTek
Copy link

CineTek commented Jan 12, 2018

For the last few days and weeks getPastEvents worked like a charm, but starting today we were not able to retrieve any events/logs from infura - has something changed with the way the node works?

@eccheung4
Copy link

Also have this problem and seeing this error:

Error: CONNECTION ERROR: Couldn't connect to node on IPC.
    at Object.InvalidConnection (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-core-helpers/src/errors.js:35:16)
    at WebsocketProvider._timeout (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-providers-ws/src/index.js:192:48)
    at W3CWebSocket.connection.onclose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/web3-providers-ws/src/index.js:96:15)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onClose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/W3CWebSocket.js:228:10)
    at WebSocketConnection.<anonymous> (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/W3CWebSocket.js:201:17)
    at emitTwo (events.js:125:13)
    at WebSocketConnection.emit (events.js:213:7)
    at WebSocketConnection.handleSocketClose (/Users/eccheung4/Documents/Business/metax/adchain-registry-events-db/node_modules/websocket/lib/WebSocketConnection.js:382:14)
    at emitOne (events.js:120:20)
    at TLSSocket.emit (events.js:210:7)
    at _handle.close (net.js:547:12)
    at TCP.done [as _onclose] (_tls_wrap.js:356:7)

@ec2
Copy link

ec2 commented Jan 13, 2018

@CineTek @eccheung4 Can you provide more information? Such as the requests you are making

@CineTek
Copy link
Author

CineTek commented Jan 13, 2018

Looks like the problem is that Infura updates Geth which has this bug: ethereum/go-ethereum#15871

@eccheung4
Copy link

nice find @CineTek thanks!

@tueric I have code that does something like this:

  const provider = `wss://rinkeby.infura.io/ws`
  let web3 = new Web3(new Web3.providers.WebsocketProvider(provider))
  let contract = new web3.eth.Contract(contractAbi, contractAddress);

  contract.getPastEvents('allEvents',
    {fromBlock: 0,  toBlock: 'latest'},
    (error, logs) => {
    if (error) console.error(error);
    logs.forEach(log => {
    	// Do something with log
    })
  })

@CineTek
Copy link
Author

CineTek commented Jan 13, 2018

Same code except issue on Ropsten using https instead of websockets. Everything worked like a charm and then suddenly stopped working yesterday morning

@CineTek
Copy link
Author

CineTek commented Jan 13, 2018

Looks like geth has been updated by infura, everything working fine for me again 👍

@StarNeit
Copy link

StarNeit commented Feb 13, 2018

Error: CONNECTION ERROR: Couldn't connect to node on IPC.
at Object.InvalidConnection (/Volumes/Works/BlockChain/Bwcoin/Project/bwcoin/node_modules/web3-core-helpers/src/errors.js:35:16)
at WebsocketProvider._timeout (/Volumes/Works/BlockChain/Bwcoin/Project/bwcoin/node_modules/web3-providers-ws/src/index.js:192:48)
at W3CWebSocket.connection.onclose (/Volumes/Works/BlockChain/Bwcoin/Project/bwcoin/node_modules/web3-providers-ws/src/index.js:96:15)
at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Volumes/Works/BlockChain/Bwcoin/Project/bwcoin/node_modules/yaeti/lib/EventTarget.js:107:17)

I also getting connection error too.
Is there any solution to overcome this?

@StarNeit
Copy link

Anybody here?

@johanherman
Copy link

Hey @StarNeit. Judging by your later comment in #29 I take it that you got it resolved?

@StarNeit
Copy link

Hi @johanherman , it was solved, thank you.

@jtakalai
Copy link

I'm getting this suddenly today. Could it be related to response size from getPastEvents? Something like that is suggested in #75

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

No branches or pull requests

6 participants