I use Web3 to connect to my remote server.

10.xxx.xxx.xxxis ip address of a remote server.

First I start the server with this command : parity --chain frontier.json --rpcapi="eth,net,web3,personal,web3" --rpc --rpcaddr 10.xxx.xxx.xxx --rpcport 8545 --rpccorsdomain "*" --author 0x...

And after I run a python script :

from web3 import Web3, KeepAliveRPCProvider web3 = Web3(KeepAliveRPCProvider(host="163.xxx.xxx.xxx", port="8545")) web3.eth.coinbase

But I've this error : ValueError: No JSON object could be decoded

If I remplace host by 10.xxx.xxx.xxx I've socket.timeout: timed out error

Moreover, if I install python and web3 on the remote server and run this command :

from web3 import Web3, KeepAliveRPCProvider web3 = Web3(KeepAliveRPCProvider(host="10.xxx.xxx.xxx", port="8545")) web3.eth.syncing I don't have any error

But if I run this command on an other server I've the same error : socket.timeout: timed out

How can I resolve this error?


First double check that IP addresses are correct in your scripts.

Then use telnet command to ensure that you can connect to RPC port from the client computer:

 telnet 163.xxx.xxx.xxx 8545

You should see raw HTTP output and it should give you a hint of what could be wrong.

If this doesn't connect then fix whatever network/firewall/etc. issues you have between the computers.

  • Yes in fact, wwhen I do telnet 8545 I can see that I 'm connect. – wxcvbn Jan 17 '17 at 7:52
  • ValueError: No JSON object could be decoded usually indicates that the server running in the destination is returning HTML payload. Are you sure you are connected to correct geth? You can also try to peek into raw network traffic and HTTP response what geth is returning. – Mikko Ohtamaa Jan 17 '17 at 7:55
  • How can I check if I'm connect to the correct geth? I run parity with the command write into my post. I don't know if it's a problem but I jsut can run this command with 10.xxx.xxx.xxx witch is the private ip address. With the is the public ip this command give me an error. – wxcvbn Jan 17 '17 at 7:59
  • Sorry I was meaning parity. – Mikko Ohtamaa Jan 17 '17 at 8:08
  • Try send a JSON-RPC directly from the command line using curl. github.com/ethereum/wiki/wiki/JSON-RPC#web3_clientversion – Mikko Ohtamaa Jan 17 '17 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.