Tor will disconnect about one month

Hi developer,

I use Raspberry Pi4 4GB, tor version 0.4.5.9, ubuntu 21.10, 1Gb speed, it’s directly connected to internet, not behind the router, no need port forward

I’ve created a relay,I don’t know why the relay will disconnect about 20-30 days, around 1 month, when it disconnect, all flags are gone under nyx, it show “none” , under tor relay search page, my server will turn red

it makes me feel annoying, it tried 4-5 times, each time, about 1 month, it will disconnect. I need “service tor restart” , restart tor, it will work about 1 month, after a month, it will disconnect again, this problem, non stop non stop loop

I’ve tried use the latest tor version, it is the same

here is my torrc setting, is it something wrong under my settings?

RunAsDaemon 1
ORPort auto
DirPort auto
AssumeReachable 1
Exitpolicy reject :
CookieAuthentication 0
HashedControlPassword 16:XXXXXXXXXXXXXXX
AuthDirGuardBWGuarantee 4 MB
MaxAdvertisedBandwidth 3.5 MB
RelayBandwidthRate 3 MB
RelayBandwidthBurst 4 MB
MaxMemInQueues 512 MB
ExcludeNodes {cn},{mo},{kp},{ir},{sy},{pk},{cu},{vn}
strictnodes 0
ContactInfo abc@abc.com
Nickname abc

thanks for help first

Thanks for running a relay!

First thoughts are:

  • You don’t want “AssumeReachable 1”, because you want your Tor to actually discover its IP address, test its reachability, and give warnings in the logs if it thinks something is wrong.

  • You should check your Tor logs to see if they say anything, especially around the time that the relay seems to go offline. Maybe you are getting a new external IP address, and Tor is being bad at noticing, perhaps because AssumeReachable is set?

  • Setting AuthDirGuardBWGuarantee doesn’t do anything since you’re not a directory authority.

  • Setting ExcludeNodes and strictnodes likely does not do what you have in mind, because that setting only applies to when you’re using your Tor as a client.

  • Lastly, don’t worry about anonymizing your relay. Running a relay is an act of transparency, even though running a client is an act of privacy. See the discussion in this gitlab ticket for more details:
    Write "expectations for relay operators" document (#18) · Issues · The Tor Project / Community / Relays · GitLab
    (and you actually did provide enough details in that screenshot that we can look up your relay uniquely, but I will let you opt to provide more information next, rather than deanonymizing you. :slight_smile:

Next time it happens, please consider dropping by the #tor-relays channel on irc (or the matrix bridge to that channel) to say that your relay just mysteriously dropped offline. People can help to debug it right then.

Thanks for reply and thanks for remind, actually, I really forgot to check the log when it disconnect, you remind me to check the log, so I check /var/log/tor/notices.log, would you please help me to debug the log?

In 22 of Dec 20:02,the relay still running, already run 32 days, but around 15 mins later, it seems appear some error, low on memory, when in 23 of Dec 00:00, it appears a reload message

Dec 23 00:02, the relay automatic reload itself, 02:03, it clear my relay alive record, only online 1.59 hours.

My Pi have 4GB ram, and I believe that I have enough memory to run tor relay, why this happen?

root@ubuntu:~# free -h
total used free shared buff/cache available
Mem: 3.7Gi 1.0Gi 114Mi 47Mi 2.6Gi 2.5Gi
Swap: 1.0Gi 250Mi 773Mi

I try to delete the line in torrc, that you suggest to remove first.

thanks for your help and remind again

I see that you have already set MaxMemInQueues set to 512 MB in your torrc. Maybe this is a bit too low? Have you tried doubling it? If that free -h commend was run right before tor crashed, the system had plenty of memory available.

I also recommend to run some kind of monitoring solution as well. It could help you identify trends in memory / CPU usage etc. and tor crashing.

2 Likes

I also saw that the error in the log file seems to be caused by this setting(MaxMemInQueues). Actually, I don’t know what is the use of this configuration. My torrc is just set up by referring to some examples on the Internet. I just removed this line. In fact, what is the use of this setting?

The purpose of this configuration is to limit the program to only use 512MB ram and prevent the program from eating too much memory? If this parameter is not configured, will the program eat up a lot of memory?

thank you for the suggestion.

1 Like

Yes, that is the purpose. If you don’t set the parameter, Tor will determine at startup how much memory is available and set the value automatically. Even if there is lots of memory available, I have not seen a single Tor instance take more than 2 GB.

2 Likes

Thank you, your explanation is very clear, I understand now, I believe that after removed MaxMemInQueues, tor should no longer be disconnected by itself.

1 Like

Help, its me again, my relay auto restart faster than before, this time only online 5 days, then it restart, I already removed AssumeReachable / AuthDirGuardBWGuarantee / MaxMemInQueues

please help to debug my log

notice.log.1

Jan 01 14:24:54.000 [notice] Heartbeat: Tor’s uptime is 5 days 0:00 hours, with 276 circuits open. I’ve sent 13.16 GB and received 11.37 GB. I’ve received 661156 connections on IPv4 and 0 on IPv6. I’ve made 87535 connections with IPv4 and 27932 with IPv6.
Jan 01 14:24:54.000 [notice] While bootstrapping, fetched this many bytes: 18484 (microdescriptor fetch)
Jan 01 14:24:54.000 [notice] While not bootstrapping, fetched this many bytes: 73061254 (server descriptor fetch); 3780 (server descriptor upload); 8334654 (consensus network-status fetch); 836821 (microdescriptor fetch)
Jan 01 14:24:54.000 [notice] Circuit handshake stats since last time: 62/62 TAP, 21637/21637 NTor.
Jan 01 14:24:54.000 [notice] Since startup we initiated 0 and received 0 v1 connections; initiated 0 and received 430 v2 connections; initiated 0 and received 661 v3 connections; initiated 0 and received 7396 v4 connections; initiated 105763 and received 94408 v5 connections.
Jan 01 14:24:54.000 [notice] DoS mitigation since startup: 0 circuits killed with too many cells. 0 circuits rejected, 0 marked addresses. 0 connections closed. 1 single hop clients refused. 0 INTRODUCE2 rejected.
Jan 01 14:25:32.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3540 seconds]
Jan 01 15:09:43.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:44.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:45.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:48.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:48.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:49.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:49.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:49.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:55.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:55.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:55.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:56.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:56.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:56.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:57.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:57.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:57.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:57.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:58.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:58.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:59.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:09:59.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:01.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:08.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:08.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:12.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:15.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:17.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:18.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:10:22.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:11:01.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:11:04.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:11:07.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:11:18.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:11:19.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:12:39.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:12:39.000 [notice] Rend stream is 120 seconds late. Giving up on address ‘[scrubbed].onion’.
Jan 01 15:25:33.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3600 seconds]
Jan 01 16:25:33.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3540 seconds]
Jan 01 17:25:33.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3540 seconds]
Jan 01 18:25:33.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3540 seconds]
Jan 01 19:25:33.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3540 seconds]
Jan 01 20:24:54.000 [notice] Heartbeat: Tor’s uptime is 5 days 6:00 hours, with 285 circuits open. I’ve sent 14.34 GB and received 12.46 GB. I’ve received 687029 connections on IPv4 and 0 on IPv6. I’ve made 92790 connections with IPv4 and 29506 with IPv6.
Jan 01 20:24:54.000 [notice] While bootstrapping, fetched this many bytes: 18484 (microdescriptor fetch)
Jan 01 20:24:54.000 [notice] While not bootstrapping, fetched this many bytes: 77014445 (server descriptor fetch); 3780 (server descriptor upload); 8745442 (consensus network-status fetch); 868789 (microdescriptor fetch)
Jan 01 20:24:54.000 [notice] Circuit handshake stats since last time: 75/75 TAP, 22909/22909 NTor.
Jan 01 20:24:54.000 [notice] Since startup we initiated 0 and received 0 v1 connections; initiated 0 and received 461 v2 connections; initiated 0 and received 691 v3 connections; initiated 0 and received 7719 v4 connections; initiated 111772 and received 99585 v5 connections.
Jan 01 20:24:54.000 [notice] DoS mitigation since startup: 0 circuits killed with too many cells. 0 circuits rejected, 0 marked addresses. 0 connections closed. 1 single hop clients refused. 0 INTRODUCE2 rejected.
Jan 01 20:25:34.000 [notice] Unable to find IPv6 address for ORPort 44009. You might want to specify IPv4Only to it or set an explicit address or set Address. [59 similar message(s) suppressed in last 3600 seconds]
Jan 01 20:59:04.000 [notice] External address seen and suggested by a directory authority: 2a09:bac0:23::815:be0
Jan 01 20:59:34.000 [notice] Guessed our IP address as [2a09:bac0:23::815:be0] (source: METHOD=NONE).
Jan 01 20:59:39.000 [notice] Self-testing indicates your ORPort xxx.xxx.xxx.xxx:43949 is reachable from the outside. Excellent.
Jan 01 21:11:23.000 [notice] Now checking whether IPv6 ORPort [2a09:bac0:23::815:be0]:44009 is reachable… (this may take up to 20 minutes – look for log messages indicating success)
Jan 01 21:11:23.000 [notice] Now checking whether IPv4 DirPort xxx.xxx.xxx.xxx:35095 is reachable… (this may take up to 20 minutes – look for log messages indicating success)
Jan 01 21:11:25.000 [notice] Self-testing indicates your DirPort is reachable from the outside. Excellent.
Jan 01 21:12:25.000 [notice] Performing bandwidth self-test…done.
Jan 01 21:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address.
Jan 01 22:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 01 23:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 00:01:18.000 [notice] Received reload signal (hup). Reloading config and resetting internal state.
Jan 02 00:01:18.000 [notice] Read configuration file “/usr/share/tor/tor-service-defaults-torrc”.
Jan 02 00:01:18.000 [notice] Read configuration file “/etc/tor/torrc”.

notice.log

Jan 02 00:01:18.000 [notice] Tor 0.4.5.9 opening new log file.
Jan 02 00:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 01:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 02:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 02:24:54.000 [notice] Heartbeat: Tor’s uptime is 5:25 hours, with 284 circuits open. I’ve sent 15.20 GB and received 13.20 GB. I’ve received 724838 connections on IPv4 and 0 on IPv6. I’ve made 97369 connections with IPv4 and 30855 with IPv6.
Jan 02 02:24:54.000 [notice] While bootstrapping, fetched this many bytes: 18484 (microdescriptor fetch)
Jan 02 02:24:54.000 [notice] While not bootstrapping, fetched this many bytes: 80340050 (server descriptor fetch); 4860 (server descriptor upload); 9088850 (consensus network-status fetch); 903039 (microdescriptor fetch)
Jan 02 02:24:54.000 [notice] Circuit handshake stats since last time: 96/96 TAP, 18999/18999 NTor.
Jan 02 02:24:54.000 [notice] Since startup we initiated 0 and received 0 v1 connections; initiated 0 and received 485 v2 connections; initiated 0 and received 727 v3 connections; initiated 0 and received 8161 v4 connections; initiated 117320 and received 104306 v5 connections.
Jan 02 02:24:54.000 [notice] DoS mitigation since startup: 0 circuits killed with too many cells. 0 circuits rejected, 0 marked addresses. 0 connections closed. 1 single hop clients refused. 0 INTRODUCE2 rejected.
Jan 02 03:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 04:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 05:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 06:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 07:19:34.000 [notice] Auto-discovered IPv6 address [2a09:bac0:23::815:be0]:44009 has not been found reachable. However, IPv4 address is reachable. Publishing server descriptor without IPv6 address. [2 similar message(s) suppressed in last 2400 seconds]
Jan 02 07:53:55.000 [notice] New control connection opened.
Jan 02 07:53:57.000 [notice] New control connection opened.

I really don’t know what happens, sigh

I need help, thank you.

Dear Someone,

The forum software says your issue has been solved already, but it doesn’t seem so from your side. Did your relay come back up okay? after showing these logs? If so, you can ignore this post.

I may be picking up on something that has solved itself, but I notice in the logs that you can’t connect with IPv6. If you have tor running on ipv6 as well as ipv4, tor must be reachable on both 4 and 6 in order to work. You can check ipv6 with a ping of the authorities - the command is given in 7. Check IPv6 availability at Tor Project | Relay Post-install and good practices
Or you can follow the logs’ advice and just run on ipv4 for a while and see if it stays up.