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

More information with invalid response - 0 #608

Closed
mrwillis opened this issue Sep 20, 2019 · 7 comments
Closed

More information with invalid response - 0 #608

mrwillis opened this issue Sep 20, 2019 · 7 comments
Labels
discussion Questions, feedback and general information.

Comments

@mrwillis
Copy link

Hi there,

Seem to be getting

2019-09-20 13:41:54 error: Error: invalid response - 0 at exports.XMLHttpRequest.request.onreadystatechange (/var/app/current/node_modules/ethers/utils/web.js:84:29) at exports.XMLHttpRequest.dispatchEvent (/var/app/current/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25) at setState (/var/app/current/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14) at exports.XMLHttpRequest.handleError (/var/app/current/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5) at ClientRequest.errorHandler (/var/app/current/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14) at ClientRequest.emit (events.js:182:13) at ClientRequest.EventEmitter.emit (domain.js:442:20) at Socket.socketErrorListener (_http_client.js:391:9) at Socket.emit (events.js:182:13) at Socket.EventEmitter.emit (domain.js:442:20) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) at process._tickCallback (internal/process/next_tick.js:63:19)

a lot recently with some providers. I know it is a provider issue and not with ethers, but is there a flag that can be set to get the full response back so it can be more easily debugged?

Thanks

@ricmoo
Copy link
Member

ricmoo commented Sep 20, 2019

You can try provider.on(“debug”, ...). I’m not sure how much it gives back in v4, but in v5 it should give you the response data.

Please let me know if you find anything. At the very least, I’d like to fix that to at least give a better error on what went wrong. :)

@mrwillis
Copy link
Author

Ok will do thanks. Is it just called with single argument?

provider.on("debug", (data: any) => console.log(data))

Is there a changelist for V5? Would be happy to beta it. Even some hack docs would be useful.

@ricmoo
Copy link
Member

ricmoo commented Sep 20, 2019

There are changelogs for both v4 and v5 now. :)

The v5 changelog is managed automatically by the admin scripts (although does not go back to the beginning of v5, but most of those were still fairly early changes), the v4 were generated by a one-off script I wrote yesterday.

Yes, I think it returns just one item, but to be safe you can use (..args: Array<any>)... But I should go through and make sure each only passes in a single item, as well as document what items it includes. :)

@ricmoo ricmoo added the discussion Questions, feedback and general information. label Sep 20, 2019
@ricmoo
Copy link
Member

ricmoo commented Oct 19, 2019

Did you ever find out more about this?

@mrwillis
Copy link
Author

hi @ricmoo. I did find the actual error, and it seems to be a provider thing. I logged the request from XMLHttpRequest:

responseText: 'Error: read ECONNRESET\n    at TCP.onread (net.js:656:25)',
  responseXML: '',
  status: 0,
  statusText:
   { Error: read ECONNRESET
       at TCP.onread (net.js:656:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' },
With request: {"method":"eth_call","params":[{"to":"0xa434f87D40E7b183FF22fCE219D0c971BE43a44a","data":"0...", ,"latest"],"id":299,"jsonrpc":"2.0"}

@jemmyzheng
Copy link

hi @ricmoo. I did find the actual error, and it seems to be a provider thing. I logged the request from XMLHttpRequest:

responseText: 'Error: read ECONNRESET\n    at TCP.onread (net.js:656:25)',
  responseXML: '',
  status: 0,
  statusText:
   { Error: read ECONNRESET
       at TCP.onread (net.js:656:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' },
With request: {"method":"eth_call","params":[{"to":"0xa434f87D40E7b183FF22fCE219D0c971BE43a44a","data":"0...", ,"latest"],"id":299,"jsonrpc":"2.0"}

so did u fix it? I use etherscan provider got this error too

@ricmoo
Copy link
Member

ricmoo commented Sep 5, 2020

I think this issue is stale as ethers no longer uses XMLHttpRequest, so I'm going to close it. If you still have this issue though, please re-open it.

Thanks! :)

@ricmoo ricmoo closed this as completed Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Questions, feedback and general information.
Projects
None yet
Development

No branches or pull requests

3 participants