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

Web3 connection attempt failed #226

Open
5chdn opened this issue Jan 16, 2016 · 19 comments
Open

Web3 connection attempt failed #226

5chdn opened this issue Jan 16, 2016 · 19 comments

Comments

@5chdn
Copy link

5chdn commented Jan 16, 2016

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
Copy link
Author

5chdn commented Feb 2, 2016

magically started working now :)

@5chdn 5chdn closed this as completed Feb 2, 2016
@dclijste
Copy link

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

@nickbarba
Copy link

nickbarba commented Apr 19, 2016

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

geth --rpc

I updated the wiki

@dclijste
Copy link

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
Copy link

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

@DavidBelinchon
Copy link

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

  • I runnig geth wtih this parrams:
    --rpcaddr localhost --rpc --rpcport 8545 (I trying also rpcaddr 0.0.0.0)
  • my app.json:
    {
    "NODE_ENV" : "production",
    "RPC_HOST" : "localhost",
    "RPC_PORT" : "8545",
    "LISTENING_PORT" : "30303",
    "INSTANCE_NAME" : "geth",
    "CONTACT_DETAILS" : "",
    "WS_SERVER" : "http://localhost:3000",
    "WS_SECRET" : "",
    "VERBOSITY" : 2
    }
  • open inteligence api:
    pm2 start app.json
  • open netstats:
    PORT=3000 WS_SECRET=npm start
  • Error:
    [eth] =✘= Web3 connection attempt #0 failed

versions:
geth: 1.4.5
node: 0.12

@phoax
Copy link

phoax commented Feb 6, 2017

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
Copy link

mingfang commented Jun 1, 2017

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

@5chdn 5chdn reopened this Jun 1, 2017
@tony71318
Copy link

Same Issue Here.

@mikeyb
Copy link

mikeyb commented Jul 5, 2017

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
Copy link

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

@zwx00
Copy link

zwx00 commented Dec 15, 2017

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
Copy link

ccdle12 commented Apr 19, 2018

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

@suyash515
Copy link

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
Copy link

ccdle12 commented May 16, 2018

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

@brannondorsey
Copy link

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

@maroodb
Copy link

maroodb commented Aug 14, 2018

same error here.

@bivalent
Copy link

@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
Copy link

StarNeit commented Feb 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests