trufflesuite / truffle-hdwallet-provider

HD Wallet-enabled Web3 provider
MIT License
399 stars 167 forks source link

Error: Invalid JSON RPC response: "" #45

Open Topema opened 6 years ago

Topema commented 6 years ago

Hello everyone.

I am developing an API using truffle-hdwallet-provider. The fact is that when I make calls to the API, most of the times it works, buteven if ti works, is very common for me to get error and the times it comes out, sometimes it works and sometimes it does not.

Error: Invalid JSON RPC response: ""

 at Object.InvalidResponse (/var/www/html/wu_smartcontract_web/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
  at XMLHttpRequest.request.onreadystatechange (/var/www/html/wu_smartcontract_web/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
  at XMLHttpRequestEventTarget.dispatchEvent (/var/www/html/wu_smartcontract_web/node_modules/xhr2/lib/xhr2.js:64:18)
  at XMLHttpRequest._setReadyState (/var/www/html/wu_smartcontract_web/node_modules/xhr2/lib/xhr2.js:354:12)
 at XMLHttpRequest._onHttpRequestError (/var/www/html/wu_smartcontract_web/node_modules/xhr2/lib/xhr2.js:544:12)
 at ClientRequest.<anonymous> (/var/www/html/wu_smartcontract_web/node_modules/xhr2/lib/xhr2.js:414:24)
 at emitOne (events.js:116:13)
 at ClientRequest.emit (events.js:211:7)
 at TLSSocket.socketErrorListener (_http_client.js:387:9)
 at emitOne (events.js:116:13)
 at TLSSocket.emit (events.js:211:7)
 at emitErrorNT (internal/streams/destroy.js:64:8)
 at _combinedTickCallback (internal/process/next_tick.js:138:11)
 at process._tickCallback (internal/process/next_tick.js:180:9)

I am working with the rinkeby testnet, I have been

Estoy interactuando con rinkeby, I've been trying to fix this problem for a couple of days, but I can not find a solution anywhere

Thank you so much in advance for your help!!

xinbenlv commented 6 years ago

same here for me

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/xxx/ws/boba/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/Users/xxx/ws/boba/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/xxx/ws/boba/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/Users/zzn/ws/boba/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/Users/xxx/ws/boba/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/Users/xxx/ws/boba/node_modules/xhr2/lib/xhr2.js:414:24)
    at ClientRequest.emit (events.js:159:13)
    at TLSSocket.socketErrorListener (_http_client.js:389:9)
    at TLSSocket.emit (events.js:159:13)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:152:19)
xinbenlv commented 6 years ago

Also mentioned in #43

DavidVotrubec commented 6 years ago

Same here for me

SandeepThakare commented 6 years ago

did anyone solve this issue?

hubiierik commented 6 years ago

Not a solution, but a tip: XMLHttpRequest has a weakness in it's implementation that it strips off error information when ready state is set. For whoever is inclined it is possible to see that information if the app is run in a debugger and breakpoint put inside XMLHttpRequest._onHttpRequestError(). The error parameter of that function should give a hint of what is going on.

podgostar commented 5 years ago

Any updates on this?

theone3nu commented 5 years ago

I am also facing this issue especially if the smart contract is returning array of uints of length more than 1000. Some times it works some times it doesnt works. Any update on this issue.

dalechyn commented 2 years ago

Almost 3 years passed, the issue still exists...