Author

Topic: No outgoing connections (Read 178 times)

legendary
Activity: 2856
Merit: 7410
Crypto Swap Exchange
December 29, 2021, 05:19:32 AM
#15

Code:
Dec 27 15:17:17 raspibolt tor[637]: Dec 27 15:17:17.433 [warn] Could not bind to 127.0.0.1:9051: Address already in use. Is Tor already running?

I didn't know raspibolt use tor (with t lowercase) rather than Tor (with T uppercase) on it's log, which is very unusual. You might want to use both tor and Tor to find any missed lines. But since the command managed to show that other process use port 9051, you should find out which process use that port (with command provided by @vv181).
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
December 29, 2021, 12:34:36 AM
#14
Have you tried to restart the Tor service, and it still got no connection? If that so, I would try to check the Tor service journal, see if the issues are there.
I have restarted Tor and it continues showing me the exact thing. I closed qt and ran bitcoind, and this is what's shown repeatedly after a little bit:
Code:
2021-12-27T15:15:53Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)

Connection refused means that nothing's listening on port 9050 on the localhost interface (check your Tor logs again). If the error was "host unreachable" or something like that, then it would mean your firewall is blocking the connection but since there is no such message, that is not the reason.

Quote
Code:
Dec 27 17:08:35.169 [warn] Directory /var/lib/tor/hidden_service_electrs/ cannot be read: Permission denied
Dec 27 17:08:35.170 [warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.

Your hidden_service_electrs folder can't be read by the Tor service, if I remember correctly Tor is running as a different user and group than root, so changing the owner from "root" to "tor-user" or something like that should resolve the problem.
legendary
Activity: 1932
Merit: 1273
December 28, 2021, 01:05:47 PM
#13
@BlackHatCoiner I actually have no idea what causes it, but looking at your last log, I think it seemed like the tor is already running even though the systemctl status isn't showing so.

I think you should try to run:
Code:
sudo netstat -plnt | grep 9051
to check whether port 9051 is indeed used by the Tor or not. If it has an output which I think it's likely, the last word of the output will show the application whose using the port. e.g., /app-name

After that, I think the only manual solution I could think of is to manually kill the Tor process and then try to restart the Tor service again.
Code:
sudo killall tor
sudo systemctl restart [email protected]

and then check again if the tor is running properly using:
Code:
sudo systemctl status [email protected]

Other than that, I have no idea where's the problem.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
legendary
Activity: 2856
Merit: 7410
Crypto Swap Exchange
December 28, 2021, 06:04:38 AM
#11
Seems the permission denied errorwarning is expected and does not indicate the issues. One more thing I would try to check is:
Code:
cat /var/log/syslog | grep tor


Don't forget grep is case sensitive, so it should be Tor (not tor).

Code:
# -b -0 indicate current boot
sudo journalctl -x -b -0 | grep Tor

Code:
sudo cat /var/log/syslog | grep Tor
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 27, 2021, 05:43:16 PM
#10
Code:
bitcoin@raspibolt:~ $ sudo journalctl -xe | tor
Dec 27 17:08:35.164 [notice] Tor 0.3.5.15 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma 5.2.4, and Libzstd 1.3.8.
Dec 27 17:08:35.164 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Dec 27 17:08:35.164 [notice] Read configuration file "/etc/tor/torrc".
Dec 27 17:08:35.169 [warn] Directory /var/lib/tor/hidden_service_electrs/ cannot be read: Permission denied
Dec 27 17:08:35.170 [warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.
Dec 27 17:08:35.170 [err] Reading config failed--see warnings above.



Reposted for notification:

Seems the permission denied errorwarning is expected and does not indicate the issues. One more thing I would try to check is:
Code:
cat /var/log/syslog | grep tor

Code:
bitcoin@raspibolt:~ $ sudo cat /var/log/syslog | grep tor
Dec 27 06:46:24 raspibolt systemd[1]: Starting User Runtime Directory /run/user/1002...
Dec 27 06:46:24 raspibolt systemd[1]: Started User Runtime Directory /run/user/1002.
Binary file (standard input) matches
legendary
Activity: 1932
Merit: 1273
December 27, 2021, 01:06:30 PM
#9
~
Status=1/failure should indicate some things. But I think further log is needed, please do $ journalctl -xe | tor


Code:
bitcoin@raspibolt:~ $ sudo journalctl -xe | tor
Dec 27 17:08:35.164 [notice] Tor 0.3.5.15 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma 5.2.4, and Libzstd 1.3.8.
Dec 27 17:08:35.164 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Dec 27 17:08:35.164 [notice] Read configuration file "/etc/tor/torrc".
Dec 27 17:08:35.169 [warn] Directory /var/lib/tor/hidden_service_electrs/ cannot be read: Permission denied
Dec 27 17:08:35.170 [warn] Failed to parse/validate config: Failed to configure rendezvous options. See logs for details.
Dec 27 17:08:35.170 [err] Reading config failed--see warnings above.

Seems the permission denied errorwarning is expected and does not indicate the issues. One more thing I would try to check is:
Code:
cat /var/log/syslog | grep tor
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 27, 2021, 12:16:14 PM
#8
So try to post the output of:
Code:
sudo systemctl status [email protected]

Interesting... This is what I get:
Code:
bitcoin@raspibolt:~ $ sudo systemctl status [email protected]
[email protected] - Anonymizing overlay network for TCP
   Loaded: loaded (/lib/systemd/system/[email protected]; enabled-runtime; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2021-12-27 15:17:19 GMT; 57min ago
  Process: 722 ExecStartPre=/usr/bin/install -Z -m 02755 -o debian-tor -g debian-tor -d /run/tor (code=exited, status=0/SUCCESS)
  Process: 723 ExecStartPre=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 --verify-config (code=e
  Process: 724 ExecStart=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 (code=exited, status=1/FAI
 Main PID: 724 (code=exited, status=1/FAILURE)

Dec 27 15:17:19 raspibolt systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 27 15:17:19 raspibolt systemd[1]: Failed to start Anonymizing overlay network for TCP.
Dec 27 15:17:19 raspibolt systemd[1]: [email protected]: Service RestartSec=100ms expired, scheduling restart.
Dec 27 15:17:19 raspibolt systemd[1]: [email protected]: Scheduled restart job, restart counter is at 5.
Dec 27 15:17:19 raspibolt systemd[1]: Stopped Anonymizing overlay network for TCP.
Dec 27 15:17:19 raspibolt systemd[1]: [email protected]: Start request repeated too quickly.
Dec 27 15:17:19 raspibolt systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 27 15:17:19 raspibolt systemd[1]: Failed to start Anonymizing overlay network for TCP.
legendary
Activity: 1932
Merit: 1273
December 27, 2021, 11:48:12 AM
#7
Tor use the same port?
Yep, 9050 is the default Tor socks proxy.

And IIRC the default Tor service unit that Debian uses is [email protected] not tor. So try to post the output of:
Code:
sudo systemctl status [email protected]


And also I believe the Bitcoin Tor documentation gives some useful information for debugging:

There are several ways to see your local onion address in Bitcoin Core:

    in the debug log (grep for "tor:" or "AddLocal")
    in the output of RPC getnetworkinfo in the "localaddresses" section
    in the output of the CLI -netinfo peer connections dashboard

You may set the -debug=tor config logging option to have additional information in the debug log about your Tor configuration.

CLI -addrinfo returns the number of addresses known to your node per network. This can be useful to see how many onion peers your node knows, e.g. for -onlynet=onion.
So, if you also post the output of the above I think it would be also useful to debug where the problem is.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 27, 2021, 11:42:37 AM
#6
The verifying blocks finished and I did stop Bitcoin Core (and restarted it). The following continues existing and I don't get any outgoing connections;

Code:
2021-12-27T15:15:53Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
legendary
Activity: 3500
Merit: 6205
Looking for campaign manager? Contact icopress!
December 27, 2021, 11:33:42 AM
#5
Then, bitcoin-cli stop to use the qt:
Code:
bitcoin@raspibolt:~ $ bitcoin-cli stop
error code: -28
error message:
Verifying blocks...

I went to protocol.h to check what does that mean. Apparently, the client is still... “warming up”. What is that suppose to mean?

The "Verifying blocks..." is one of the things done at startup. It should not take too long... unless something is wrong.
It never happened to me, but this can be a start: https://bitcointalksearch.org/topic/m.6902445
Is everything OK with the storage/SSD?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 27, 2021, 11:25:27 AM
#4
Have you tried to restart the Tor service, and it still got no connection? If that so, I would try to check the Tor service journal, see if the issues are there.
I have restarted Tor and it continues showing me the exact thing. I closed qt and ran bitcoind, and this is what's shown repeatedly after a little bit:
Code:
2021-12-27T15:15:53Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)

Doesn't Tor use the same port? When I check the Tor service journal this is what comes up:
Code:
bitcoin@raspibolt:~ $ sudo journalctl -f -u tor
-- Logs begin at Fri 2021-12-24 11:17:01 GMT. --
Dec 24 11:58:25 raspibolt systemd[1]: Starting Anonymizing overlay network for TCP (multi-instance-master)...
Dec 24 11:58:25 raspibolt systemd[1]: Started Anonymizing overlay network for TCP (multi-instance-master).
Dec 27 15:08:00 raspibolt systemd[1]: Reloading Anonymizing overlay network for TCP (multi-instance-master).
Dec 27 15:08:00 raspibolt systemd[1]: Reloaded Anonymizing overlay network for TCP (multi-instance-master).

Do you have anything else running on the RPi behind tor that you could come into the unit with from the outside to see if it's working?
I think Apache, but it shouldn't open on startup.

Also, did you do another full shutdown / reboot. I have had some things get funky with a power-loss and not restart properly but a reboot fixes it.
So, what you're saying is to restart the RPi properly? Alright, just did.

I run bitcoind:
Code:
bitcoin@raspibolt:~ $ bitcoind
Error: Cannot obtain a lock on data directory /home/bitcoin/.bitcoin. Bitcoin Core is probably already running.

Then, bitcoin-cli stop to use the qt:
Code:
bitcoin@raspibolt:~ $ bitcoin-cli stop
error code: -28
error message:
Verifying blocks...

I went to protocol.h to check what does that mean. Apparently, the client is still... “warming up”. What is that suppose to mean?
legendary
Activity: 3458
Merit: 6231
Crypto Swap Exchange
December 27, 2021, 11:10:20 AM
#3
If it was working I would 1st do as vv181 suggests.
Do you have anything else running on the RPi behind tor that you could come into the unit with from the outside to see if it's working?
Also, did you do another full shutdown / reboot. I have had some things get funky with a power-loss and not restart properly but a reboot fixes it.

-Dave
legendary
Activity: 1932
Merit: 1273
December 27, 2021, 10:46:40 AM
#2
Have you tried to restart the Tor service, and it still got no connection? If that so, I would try to check the Tor service journal, see if the issues are there.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 27, 2021, 07:39:37 AM
#1
I had a power outage which shut down my RPi 4 abruptly. For the past two days I get no connections at all which has left me with an older state of the block chain. What happened and how can I fix this?

Bitcoin Core v0.21.1 with onlynet=onion, listenonion=1 and blocksonly=0. I can provide more info from the config file if it's necessary.

Jump to: