cubedro / eth-net-intelligence-api

Ethereum Network Intelligence API
http://tinyurl.com/ofndjbo
GNU General Public License v3.0
324 stars 345 forks source link

Web3 connection attempt failed #226

Open 5chdn opened 8 years ago

5chdn commented 8 years ago

Hi, i keep getting (error.log):

2016-01-16 20:58 +01:00: [eth] =✘= Web3 connection attempt #17 failed
2016-01-16 20:58 +01:00: [eth] =✘= Trying again in 9000 ms
2016-01-16 20:58 +01:00: [eth] =✘= Web3 connection attempt #18 failed
2016-01-16 20:58 +01:00: [eth] =✘= Trying again in 9500 ms
2016-01-16 20:59 +01:00: [eth] =✘= Web3 connection attempt #19 failed
2016-01-16 20:59 +01:00: [eth] =✘= Trying again in 10000 ms

I run geth with the following parameters:

geth --verbosity 3 --rpc=true --rpcport 13337 --rpccorsdomain '"*"' --etherbase '0x22a0fbf89ad1362d74f626436d8c4fc6dc4f0679' --extradata '06957e1269ca4519a181f24cbee8bf91' console 2>> /tmp/eth.log

This is my app.json:

[
  {
    "name"              : "node-app",
    "script"            : "app.js",
    "log_date_format"   : "YYYY-MM-DD HH:mm Z",
    "merge_logs"        : false,
    "watch"             : false,
    "max_restarts"      : 10,
    "exec_interpreter"  : "node",
    "exec_mode"         : "fork_mode",
    "env":
    {
      "NODE_ENV"        : "production",
      "RPC_HOST"        : "localhost",
      "RPC_PORT"        : "13337",
      "LISTENING_PORT"  : "30303",
      "INSTANCE_NAME"   : "...",
      "CONTACT_DETAILS" : "...",
      "WS_SERVER"       : "wss://stats.ethdev.com",
      "WS_SECRET"       : "...",
      "VERBOSITY"       : 2
    }
  }
]

Why does the connection fail? Ubuntu 14.4 Kernel 3.19.0-42-generic #48-Ubuntu x86_64 GNU/Linux.

Cheers

5chdn commented 8 years ago

magically started working now :)

dclijste commented 8 years ago

I have the same issue after updating netstats, unfortunately magic hasn't started working for me yet..

nickbarba commented 8 years ago

Had similar issue when ethereum was not running with rpc enabled. With geth:

geth --rpc

I updated the wiki

dclijste commented 8 years ago

Thanks!

I just wanted to check my node and yes, I had --rpc enabled already but even better, somehow it fixed itself, seems magic did the trick for me!

dclijste commented 8 years ago

gotcha, needed to run node 0.12 instead of 5.10 (or at least any lower version)

DavidBelinchon commented 8 years ago

I have the same problem and not solve with rpc enabled.

versions: geth: 1.4.5 node: 0.12

phoax commented 7 years ago

Same problem. I use Parity, and I get Web3 connection attempt #1 failed when I use the --jsonrpc-interface 0.0.0.0 option.

mingfang commented 7 years ago

I'm also having this problem. Why is this closed?

tony71318 commented 7 years ago

Same Issue Here.

mikeyb commented 7 years ago

well is the service listening? If it cant connect, its probably not running. Make it run and I bet you can connect. $5 says misconfiguration, try the docs again

tony71318 commented 7 years ago

I delete it all and redo again... it works. Don't know where the problem was, but at least it works now.

zwx00 commented 6 years ago

Similar issue here, my web3 connection from eth-netstats fails despite that node is running normally with the following arguments:

geth --nodiscover --bootnodes enode://83faad28b4bd3cbf6fc2245a4f95ab9b068c30fd0b9972a4042aa5afe21128d2989e5cb6791e0193c5ed139fce41688a6ddceb9464a8fb155254ef0d112ececa@<bleh>:30303 --networkid 14 --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi web3,eth,net,db,personal,miner,admin,debug --fast

I can connect from any machine using:

geth attach http://<bleh>:8545/

And can use all of the enabled apis. Any ideas?

ccdle12 commented 6 years ago

Experiencing the same problem, using docker, have any solutions occurred?

suyash515 commented 6 years ago

I had the same issue and on checking further in the source code, I saw that the values that were being specified in the app.json file were not being taken into consideration. The following worked for me:

RPC_HOST=server_ip RPC_PORT=port_here WS_SERVER=ws_server_here WS_SECRET=secret_key node app.js

This solved the problem and connected to my local node

ccdle12 commented 6 years ago

Adding the --rpc worked for me, was using docker and k8s

brannondorsey commented 6 years ago

@suyash515 great catch. I too was experiencing this problem and your comment saved me a lot of headache +1.

maroodb commented 6 years ago

same error here.

bivalent commented 5 years ago

@suyash515 +1 as well. Surprised that there hasn't been an update to this yet? Otherwise a super cool tool. Probably could also use some sort of log-level option; theres a ton of output from the tool that makes doing other work on the instance difficult

StarNeit commented 4 years ago

Hello @phoax Were you able to run using Parity before? When I am using infura, I am getting erros like

[eth] xx> getLatestBlock couldn't fetch block...

[eth] xx> Error: invalid argument 0: empty hex string

image

Any advice will be helpful, thank you