I have been able to successfully deploy contracts on the ethereumjs testrpc with truffle without any issues. Now I wanted to do the same on a remote node running geth 1.6.1 but it gives me a JSON RPC error every time i try to run truffle migrate. There are no issues with ports and all ports are open. Tried setting up a fresh data directory , but same issue persists

command used in starting the geth client :-

geth --datadir /home/ubuntu/privatenet/test1 --networkid "1234" --rpcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3,web3_extended" --rpc --port 30310 --rpcaddr "" --rpcport 8110 --rpccorsdomain="*" --nat "any" --unlock '0,1' console 2>> /home/ubuntu/privatenet/test1/eth8.log

my truffle.js file is as follows:-

module.exports = {
  networks: {
    development: {
      host: 'localhost',
      port: 8545,
      network_id: '*' // Match any network id
    geth: {
      host: '',
      port: 8110,
      network_id: '1234', // Match network id
      from: '0x7824b8756cfa5131ead88e190e8adb10546fefaf' // account 0 
        (default account which has been already unlocked)

command used: truffle migrate --network geth


Compiling .\contracts\ UtilityEVEC.sol...
Compiling .\contracts\TokenWallet.sol...
Compiling .\contracts\contractContainer.sol...
Writing artifacts to .\build\contracts

Using network 'geth'.

    Running migration: 1_initial_migration.js
    Error: Invalid JSON RPC response: ""
        at Object.InvalidResponse (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\node_modu
    at XMLHttpRequest.request.onreadystatechange (C:\Users\Administrator\AppData\Roaming\npm\node_module
        at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\Administrator\AppData\Roaming\npm\node_modules\
        at XMLHttpRequest._setReadyState (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\no
        at XMLHttpRequest._onHttpRequestError (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truff
    at ClientRequest.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\node_m
        at emitOne (events.js:96:13)
        at ClientRequest.emit (events.js:188:7)
        at Socket.socketErrorListener (_http_client.js:310:9)
        at emitOne (events.js:96:13)
  • Did you try removing datadir and instantiating the genesis block once again? These are the steps to set up privatenet from scratch - ethereum.stackexchange.com/questions/125/… Also, check if port 8110 is open at your remote machine.
    – Sanchit
    May 23, 2017 at 18:40
  • Yea tried doing that today .. set it up from scratch , but still getting the same error. There are no issues with ports. Can't really find a reason why this is happening. May 25, 2017 at 10:34
  • --rpcaddr "" just noticed this, I guess you should change this with
    – Sanchit
    Jun 3, 2017 at 20:58

1 Answer 1


I had the same error which was due to a wrong IP in host parameter. This error is apparently throw when truffle is unable to establish the connection to the network node.

In your truffle.js configuration you should only set the hostname, not the protocol. Ie:

You should have "" instead of ''

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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