Hello,
First of all thank you for the thorough explanation of what you did.
The suggested rpcauth
value contains the username and password that you provided, salted with random data. So it’s normal that every time it’s different. You could use any one of the suggested values, but using rpcuser
and rpcpassword
should also work.
The error that you report, *connection refused*, is normally shown if the RPC port is not open. If you try to connect to any random port that is not open, you will see that you will get the same error. So the plugin sees a closed TCP port.
You did not mention if you have specified rpcport=8332
in your conf file. It should be the default, but it doesn’t hurt to specify it.
Other than that, try using telnet
or nc
(netcat) to see if that TCP port is open on your server.
Lastly, I would not discount the possibility that there is a firewall on your WordPress machine that blocks outgoing connections to non-standard ports. Just because the peer-to-peer communication over 8333 works doesn’t mean that 8332 also works…
In conclusion, set the rpcport
setting, and also try to check if the port is actually open. Let me know what you find.
Thread Starter
patchy
(@mycheapnet)
Thank you for your reply.
My wordpress is hosted on a shared hosting platform.
And my vps is on a different hosting.
I didn’t understand what you mean when you said “there is a firewall on your WordPress machine that blocks outgoing connections to non-standard ports”.
Does it mean that my shared hosting on which my wp is installed on is causing the error? since this is a shared hosting and it might block this port?
————————————-
I also tried to open the 8332 on my vps and then tested it using telnet as you said:
root@ubuntu:~# sudo ufw allow 8332/tcp
root@ubuntu:~# iptables -I INPUT -p tcp -m tcp –dport 8332 -j ACCEPT
root@ubuntu:~# telnet 213.32.15.51 8332
Trying 213.32.15.51…
Connected to 213.32.15.51.
Escape character is ‘^]’.
Connection closed by foreign host.
————————————-
Also did this to check the ports on my vps:
root@ubuntu:~# sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8333 0.0.0.0:* LISTEN 1342/bitcoind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1097/sshd
tcp6 0 0 :::8332 :::* LISTEN 1342/bitcoind
tcp6 0 0 :::8333 :::* LISTEN 1342/bitcoind
tcp6 0 0 :::22 :::* LISTEN 1097/sshd
————————————-
It didn’t fix the error.
-
This reply was modified 6 years, 4 months ago by patchy.
OK your tests indicate that the port is open. I can also see the open port from where I am. This means that it’s not a firewall issue on the side of your VPS host. However the port appears closed to the plugin.
What I meant earlier was that your host might be running a firewall blocking outgoing connections from your WordPress host to any TCP port other than 80 and 443. I say this because another user had that problem. I do not know if this is the case for you, just something worth investigating.
I do not think that your issue has to do with your IP filtering settings (rpcallowip
). If it did, you’d get a reply with “403 – forbidden”. And if you later get a “301 – unauthorized” reply, that would have to do with your credentials.
As it is right now the plugin sees a closed port. That’s why the only thing I can think of is some outgoing firewall on your WordPress machine.
Internally the plugin uses the PHP curl module to connect to that port. If you google for that error, you will see that when others had that same error, “Connection refused” it was always some firewall to blame.
https://stackoverflow.com/questions/45041047/php-curl-connection-refused
https://stackoverflow.com/questions/44114090/php-curlconnection-refused
If you decide to check with your host I’d be very interested to hear what you find.
Once you get this resolved, you should use rpcallowip
to accept incoming connections only from your WordPress machine.
regards
Thread Starter
patchy
(@mycheapnet)
I have contacted my hosting and they said that they have opened 8332 port for me.
I have also used rpcallowip:
rpcallowip=127.0.0.1/8
rpcallowip=148.163.126.66/24
rpcallowip=148.163.126.87
rpcallowip=148.163.126.72
First 2 i got from the plugin suggestion and the other 2 i got from my host.
Restarted the service and i keep getting this error.
I have created a wordpress website on my vps and used the local ip to setup the plugin and it works there.
I might end up migrating my website to my vps but i prefer to keep it on my current shared hosting since i am afraid there will be bad consequences by me managing my own apache2 wordpress website on a vps (such as installations that i have to make like curl etc..)
So my best shot is to fix this problem..
You said you could see it blocked, can you still see it as blocked? since my hosting provider opened it.
No, sorry if I was not clear. I said that the port looks open from here. I do not know why the port looks closed from your WordPress. The fact that they opened up the firewall was a necessary step.
Running your own apache or nginx server is not incredibly hard as long as you keep them updated, but the plugin should still work with the setup you have now.
Are you running any firewall on your VPS?
You could also check your bitcoin logs at ~/.bitcoin/debug.log
or ~/.bitcoin/testnet3/debug.log
. There could be clues there as to what’s going on.
EDIT: You could tail -f
the logs and observe if anything is written out 1) while starting the wallet and 2) while trying to connect from the plugin. There will be a lot of data in there, but you are only interested in errors that may occur at the time of these two events.
-
This reply was modified 6 years, 4 months ago by dashed-slug.net. Reason: added instructions on how to check logs
Thread Starter
patchy
(@mycheapnet)
The debug files are full of endless information i have no idea how to approach it.
Regarding the firewall i use ufw.
Here are the settings i have on it:
root@ubuntu:~# sudo ufw status numbered
Status: active
To Action From
— —— —-
[ 1] 443 ALLOW IN Anywhere
[ 2] 8332 ALLOW IN Anywhere
[ 3] 8332/tcp ALLOW IN Anywhere
[ 4] Apache Full ALLOW IN Anywhere
[ 5] 22 ALLOW IN Anywhere
[ 6] 2222 ALLOW IN Anywhere
[ 7] 80 ALLOW IN Anywhere
[ 8] 21/tcp ALLOW IN Anywhere
[ 9] Anywhere ALLOW IN 148.163.126.87
[10] Anywhere ALLOW IN 148.163.126.66
[11] Anywhere ALLOW IN 148.163.126.0/24
[12] Anywhere ALLOW IN 127.0.0.0/8
[13] 443 (v6) ALLOW IN Anywhere (v6)
[14] 8332 (v6) ALLOW IN Anywhere (v6)
[15] 8332/tcp (v6) ALLOW IN Anywhere (v6)
[16] Apache Full (v6) ALLOW IN Anywhere (v6)
[17] 22 (v6) ALLOW IN Anywhere (v6)
[18] 2222 (v6) ALLOW IN Anywhere (v6)
[19] 80 (v6) ALLOW IN Anywhere (v6)
[20] 21/tcp (v6) ALLOW IN Anywhere (v6)
————————————————
Just thought of something.. i use cloudflare, can it be the cause of this?
-
This reply was modified 6 years, 4 months ago by patchy.
Try adding a domain mask in all your IP filters. i.e.:
rpcallowip=148.163.126.87/24
rpcallowip=148.163.126.72/24
and try again.
Thread Starter
patchy
(@mycheapnet)
I tried it and it didn’t work..
I ended up setting a WP website on my vps and migrating it.
Now it works!
I have fixed my problem but others might have it.
I think it could be informative to suggest new users who are getting this error, to setup their website on the same vps/server they are using for the bitcoin node.
Thank you very much for your support and your time!
Thank you, every time such an incident happens I add to the troubleshooting section of the manual. It’s like a knowledgebase for installation issues.
I guess we’ll never know what went wrong.
If you face further issues please open a new thread.
best regards
Alex