You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tons of Socks5() connect to x.x.x.x:8333 failed: connection refused-messages when i use TOR - why? #29759
I also get these errors sometimes when running with Tor. While they appear on some outgoing connection attempts, other connections are successful, so there seems to be nothing wrong on my end fundamentally. While a timout does not lead to a log entry in debug.log, answers from the SOCKS5 proxy with "general failure" and "connection refused" are logged, and it is not clear to me when which of the three happens.
So I wonder if this happens every time and you can't make successful connections, or only sporadically (in which case the only problem might be overzealous logging).
As @mzumsande mentioned above, some errors like these are normal because they are printed whenever we fail to connect to a Tor peer. Not all Tor peers are online all the time. Does bitcoin-cli getpeerinfo show that you have at least one outbound connection to a Tor node? With some filtering: bitcoin-cli getpeerinfo |jq 'map(select(.inbound == false and .network == "onion")) |map({connection_type: .connection_type, addr: .addr, network: .network})'.
If you cannot establish any connection to a Tor node, then there is a real problem in your setup.
Socks5() connect to x.x.x.x:8333 failed: connection refused
This error comes from the Socks5 proxy (aka the Tor daemon) if it cannot connect to the destination we asked for. Do you get only IP addresses in those messages (x.x.x.x) or also onion addresses (e.g. ydvbxdzs6w5wefifiqsqntpbd7tliofenqih5hlnz34546fvy4ab7iid.onion)?
There is an inconsistency wrt logging connection failures: IPv4 and IPv6 connection failures are logged only if running with -debug=net:
LogPrintf("Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
PS this is different from #25094 - the current issue is about errors when trying to establish outbound connections. That issue is about not being able to accept incoming connections (because we couldn't communicate properly to the Tor daemon where to redirect those incoming connections to).
For me, the Tor daemon also behaves inconsistently (Ubuntu).
If I attempt to make a connection to one and the same non-reachable node (with addnode and onetry), I sometimes get a IntrRecvError::Timeout (which is not logged unconditionally), and sometimes get an error (Socks5() connect to x.x.x.x:8333 failed: general failure). I haven't been able to detect a pattern which of the two happens when, it looks random to me.
From reading the code, I get the impression that the original assumption was that if the peer is not online, the Socks5 proxy returns a timeout instead of a failure - which isn't always the case for me.
"Do you get only IP addresses in those messages (x.x.x.x) or also onion addresses (e.g. ydvbxdzs6w5wefifiqsqntpbd7tliofenqih5hlnz34546fvy4ab7iid.onion)?"
No, only for IP addresses as shown on post above. (other kind of message, but same host / ip and also same port) @vasild
Activity
kosuodhmwa commentedon Mar 28, 2024
Installed as described on https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service AND
1.) "usermod -a -G debian-tor BITCOIN_USER" instead of "usermod -a -G tor BITCOIN_USER"
2.) Then a OS restart after that user / group permission change thing
kosuodhmwa commentedon Mar 28, 2024
(BITCOIN_USER = root)
kosuodhmwa commentedon Mar 28, 2024
Maybe the problem is that IPv6 is disabled via sysctl.conf on that system?
kosuodhmwa commentedon Mar 28, 2024
Similar problem here?
#25094
kosuodhmwa commentedon Mar 28, 2024
kosuodhmwa commentedon Mar 29, 2024
Nobody knows what the problem is?
pinheadmz commentedon Mar 29, 2024
What exact commit did you compile from? Does it include #29649 ?
kosuodhmwa commentedon Mar 29, 2024
How can i get the version number from the source i've got from master GIT repo i've compiled?
pinheadmz commentedon Mar 29, 2024
mzumsande commentedon Apr 1, 2024
I also get these errors sometimes when running with Tor. While they appear on some outgoing connection attempts, other connections are successful, so there seems to be nothing wrong on my end fundamentally. While a timout does not lead to a log entry in debug.log, answers from the SOCKS5 proxy with "general failure" and "connection refused" are logged, and it is not clear to me when which of the three happens.
So I wonder if this happens every time and you can't make successful connections, or only sporadically (in which case the only problem might be overzealous logging).
Tons of Socks5() connect to x.x.x.x:8333 failed: connection refused-m…
vasild commentedon Apr 2, 2024
As @mzumsande mentioned above, some errors like these are normal because they are printed whenever we fail to connect to a Tor peer. Not all Tor peers are online all the time. Does
bitcoin-cli getpeerinfoshow that you have at least one outbound connection to a Tor node? With some filtering:bitcoin-cli getpeerinfo |jq 'map(select(.inbound == false and .network == "onion")) |map({connection_type: .connection_type, addr: .addr, network: .network})'.If you cannot establish any connection to a Tor node, then there is a real problem in your setup.
This error comes from the Socks5 proxy (aka the Tor daemon) if it cannot connect to the destination we asked for. Do you get only IP addresses in those messages (
x.x.x.x) or also onion addresses (e.g.ydvbxdzs6w5wefifiqsqntpbd7tliofenqih5hlnz34546fvy4ab7iid.onion)?There is an inconsistency wrt logging connection failures: IPv4 and IPv6 connection failures are logged only if running with
-debug=net:bitcoin/src/netbase.cpp
Line 551 in 3b987d0
bitcoin/src/netbase.cpp
Line 574 in 3b987d0
whereas Tor connection failures are logged as errors unconditionally:
bitcoin/src/netbase.cpp
Line 448 in 3b987d0
PS this is different from #25094 - the current issue is about errors when trying to establish outbound connections. That issue is about not being able to accept incoming connections (because we couldn't communicate properly to the Tor daemon where to redirect those incoming connections to).
mzumsande commentedon Apr 3, 2024
For me, the Tor daemon also behaves inconsistently (Ubuntu).
If I attempt to make a connection to one and the same non-reachable node (with
addnodeand onetry), I sometimes get aIntrRecvError::Timeout(which is not logged unconditionally), and sometimes get an error (Socks5() connect to x.x.x.x:8333 failed: general failure). I haven't been able to detect a pattern which of the two happens when, it looks random to me.From reading the code, I get the impression that the original assumption was that if the peer is not online, the Socks5 proxy returns a timeout instead of a failure - which isn't always the case for me.
kosuodhmwa commentedon Apr 3, 2024
The source code from the master branch i've compiled is:
root@debian-12-btc-node:~/bitcoin# git rev-parse HEAD gives me the following output:
0fa9f17
kosuodhmwa commentedon Apr 3, 2024
0fa9f17332a6d9b2eb6e3d9f9102bfd2d9c6f516kosuodhmwa commentedon Apr 3, 2024
Now i saw that i also have message like that:
2024-04-03T20:43:47Z Socks5() connect to 77.7.121.181:8333 failed: general failureWill start "bitcoind" now with filtering for that Tor Socks5 messages:
./bitcoind | grep Socks5kosuodhmwa commentedon Apr 3, 2024
"Do you get only IP addresses in those messages (x.x.x.x) or also onion addresses (e.g. ydvbxdzs6w5wefifiqsqntpbd7tliofenqih5hlnz34546fvy4ab7iid.onion)?"
No, only for IP addresses as shown on post above. (other kind of message, but same host / ip and also same port) @vasild
kosuodhmwa commentedon Apr 5, 2024
kosuodhmwa commentedon Apr 18, 2024
Maybe it's an idea to check these servers (they will be listed via console output) via "telnet [IP_ADDRESS] 8333"...
If i dont get an anwser from telnet (TCP), then the problem is on these hosts / servers. If i get an answser, there is a problem on my side
vasild commentedon May 8, 2024
Addressed in #30064
kosuodhmwa commentedon May 8, 2024
ok thx
net: log connections failures via SOCKS5 with less severity
kosuodhmwa commentedon Jun 1, 2024
closed
kosuodhmwa commentedon Jul 28, 2024
-> easy to bypass with <./bitcoind | grep -v -e 'Socks5'>
Merge #30064: net: log connections failures via SOCKS5 with less seve…