Hello!
I've enabled bandwidth accounting on my tor relay, but encountering issues when the relay attempts to wake from hibernation....
Mar 20 23:47:25 tcj Tor[74346]: Bandwidth soft limit reached; commencing hibernation. No new connections will be accepted Mar 20 23:52:30 tcj Tor[74346]: Heartbeat: Tor's uptime is 10 days 12:00 hours, with 150 circuits open. I've sent 90.20 GB and received 90.30 GB. We are currently hibernating. Mar 20 23:52:30 tcj Tor[74346]: Circuit handshake stats since last time: 2745/2745 TAP, 15557/15557 NTor. Mar 20 23:52:30 tcj Tor[74346]: Since startup, we have initiated 0 v1 connections, 0 v2 connections, 0 v3 connections, and 113565 v4 connections; and received 1100 v1 connections,130 v2 connections, 41 v3 connections, and 249967 v4 connections. Mar 21 00:00:00 tcj Tor[74346]: Configured hibernation. This interval began at 2017-03-21 00:00:00; the scheduled wake-up time was 2017-03-21 00:00:00; we expect to exhaust our quota for this interval around 2017-03-22 00:00:00; the next interval begins at 2017-03-22 00:00:00 (all times local) Mar 21 00:00:00 tcj Tor[74346]: Hibernation period ended. Resuming normal activity. Mar 21 00:00:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:00:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:01:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:01:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:02:01 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:02:01 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running?
It will continue in this manner until I manually intervene and restart the relay instance.
snippet from torrc:
## Set a maximum of 30 gigabytes each way per period. AccountingMax 30 GBytes
## Each period starts daily at midnight (AccountingMax is per day) AccountingStart day 00:00
## Required: what port to advertise for incoming Tor connections. ORPort 185.92.223.3:8080
## The IP address or full DNS name for incoming connections to your ## relay. Leave commented out and Tor will guess. Address 185.92.223.3
## If you have multiple network interfaces, you can specify one for ## outgoing traffic to use. OutboundBindAddress 185.92.223.3
Tor version and OS: $ tor --version Tor version 0.2.9.10 (git-1f6c8eda0073f464). $ uname -a OpenBSD tcj.me 6.1 GENERIC#224 amd64
Has anyone else experienced this issue? I have only one outbound interface, so is setting the OutboundBindAddress unnecessary and possibly causing the problem?
I do apologize if this has been discussed already. Please point me to the relevant post if so!
Thanks in advance,
Tyler
On 22 Mar 2017, at 07:46, Tyler Johnson tylrcjhnsn@gmail.com wrote:
Hello!
I've enabled bandwidth accounting on my tor relay, but encountering issues when the relay attempts to wake from hibernation....
Mar 20 23:47:25 tcj Tor[74346]: Bandwidth soft limit reached; commencing hibernation. No new connections will be accepted Mar 20 23:52:30 tcj Tor[74346]: Heartbeat: Tor's uptime is 10 days 12:00 hours, with 150 circuits open. I've sent 90.20 GB and received 90.30 GB. We are currently hibernating. Mar 20 23:52:30 tcj Tor[74346]: Circuit handshake stats since last time: 2745/2745 TAP, 15557/15557 NTor. Mar 20 23:52:30 tcj Tor[74346]: Since startup, we have initiated 0 v1 connections, 0 v2 connections, 0 v3 connections, and 113565 v4 connections; and received 1100 v1 connections,130 v2 connections, 41 v3 connections, and 249967 v4 connections. Mar 21 00:00:00 tcj Tor[74346]: Configured hibernation. This interval began at 2017-03-21 00:00:00; the scheduled wake-up time was 2017-03-21 00:00:00; we expect to exhaust our quota for this interval around 2017-03-22 00:00:00; the next interval begins at 2017-03-22 00:00:00 (all times local) Mar 21 00:00:00 tcj Tor[74346]: Hibernation period ended. Resuming normal activity. Mar 21 00:00:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:00:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:01:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:01:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:02:01 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:02:01 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running?
It will continue in this manner until I manually intervene and restart the relay instance.
This seems to be an internal state management issue. I have opened ticket #21810 to track it. https://trac.torproject.org/projects/tor/ticket/21810
I would like to confirm tor's behaviour when this happens:
Is there something listening on 185.92.223.3:8080? Is it this tor process, or another tor process? If it is this tor process, is tor still working as a relay despite the warnings?
snippet from torrc:
## Set a maximum of 30 gigabytes each way per period. AccountingMax 30 GBytes
## Each period starts daily at midnight (AccountingMax is per day) AccountingStart day 00:00
## Required: what port to advertise for incoming Tor connections. ORPort 185.92.223.3:8080
## The IP address or full DNS name for incoming connections to your ## relay. Leave commented out and Tor will guess. Address 185.92.223.3
## If you have multiple network interfaces, you can specify one for ## outgoing traffic to use. OutboundBindAddress 185.92.223.3
Tor version and OS: $ tor --version Tor version 0.2.9.10 (git-1f6c8eda0073f464). $ uname -a OpenBSD tcj.me 6.1 GENERIC#224 amd64
We sometimes have bugs on OpenBSD because it's one of our rarer platforms.
Do you happen to know if SO_RERUSEADDR has unusual semantics on OpenBSD? (Or is it disabled entirely?)
Has anyone else experienced this issue?
This code has had similar issues in the past, particularly on rarer platforms.
I have only one outbound interface, so is setting the OutboundBindAddress unnecessary and possibly causing the problem?
No, OutboundBindAddress is completely unrelated. OutboundBindAddress is used for connections initiated by your relay. ORPort is used for connections accepted by your relay.
T
-- Tim Wilson-Brown (teor)
teor2345 at gmail dot com PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B ricochet:ekmygaiu4rzgsk6n xmpp: teor at torproject dot org ------------------------------------------------------------------------
On 3/24/17, teor teor2345@gmail.com wrote:
On 22 Mar 2017, at 07:46, Tyler Johnson tylrcjhnsn@gmail.com wrote:
Hello!
I've enabled bandwidth accounting on my tor relay, but encountering issues when the relay attempts to wake from hibernation....
Mar 20 23:47:25 tcj Tor[74346]: Bandwidth soft limit reached; commencing hibernation. No new connections will be accepted Mar 20 23:52:30 tcj Tor[74346]: Heartbeat: Tor's uptime is 10 days 12:00 hours, with 150 circuits open. I've sent 90.20 GB and received 90.30 GB. We are currently hibernating. Mar 20 23:52:30 tcj Tor[74346]: Circuit handshake stats since last time: 2745/2745 TAP, 15557/15557 NTor. Mar 20 23:52:30 tcj Tor[74346]: Since startup, we have initiated 0 v1 connections, 0 v2 connections, 0 v3 connections, and 113565 v4 connections; and received 1100 v1 connections,130 v2 connections, 41 v3 connections, and 249967 v4 connections. Mar 21 00:00:00 tcj Tor[74346]: Configured hibernation. This interval began at 2017-03-21 00:00:00; the scheduled wake-up time was 2017-03-21 00:00:00; we expect to exhaust our quota for this interval around 2017-03-22 00:00:00; the next interval begins at 2017-03-22 00:00:00 (all times local) Mar 21 00:00:00 tcj Tor[74346]: Hibernation period ended. Resuming normal activity. Mar 21 00:00:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:00:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:01:00 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:01:00 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running? Mar 21 00:02:01 tcj Tor[74346]: Opening OR listener on 185.92.223.3:8080 Mar 21 00:02:01 tcj Tor[74346]: Could not bind to 185.92.223.3:8080: Address already in use. Is Tor already running?
It will continue in this manner until I manually intervene and restart the relay instance.
This seems to be an internal state management issue. I have opened ticket #21810 to track it. https://trac.torproject.org/projects/tor/ticket/21810
I would like to confirm tor's behaviour when this happens:
Is there something listening on 185.92.223.3:8080? Is it this tor process, or another tor process? If it is this tor process, is tor still working as a relay despite the warnings?
I am attempting to re-create the issue. As far as I know, only the one tor process is running, this being the one that was started through the appropriate rc script during boot or using rcctl (In OpenBSD at least) to start and stop the process.
The tor process does not continue to function as a relay. I am monitoring connections using a program called pftop, which shows 1000+ connections when the tor relay is functioning, and < 50 when the tor relay is in this blocking state.
snippet from torrc:
## Set a maximum of 30 gigabytes each way per period. AccountingMax 30 GBytes
## Each period starts daily at midnight (AccountingMax is per day) AccountingStart day 00:00
## Required: what port to advertise for incoming Tor connections. ORPort 185.92.223.3:8080
## The IP address or full DNS name for incoming connections to your ## relay. Leave commented out and Tor will guess. Address 185.92.223.3
## If you have multiple network interfaces, you can specify one for ## outgoing traffic to use. OutboundBindAddress 185.92.223.3
Tor version and OS: $ tor --version Tor version 0.2.9.10 (git-1f6c8eda0073f464). $ uname -a OpenBSD tcj.me 6.1 GENERIC#224 amd64
We sometimes have bugs on OpenBSD because it's one of our rarer platforms.
Do you happen to know if SO_RERUSEADDR has unusual semantics on OpenBSD? (Or is it disabled entirely?)
There is a SO_REUSEADDR option for function getsockopt. a quick blurb from the man page [1]:
"SO_REUSEADDR indicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses by callers with the same user ID (or the superuser)."
[1] http://man.openbsd.org/getsockopt
Has anyone else experienced this issue?
This code has had similar issues in the past, particularly on rarer platforms.
I have only one outbound interface, so is setting the OutboundBindAddress unnecessary and possibly causing the problem?
No, OutboundBindAddress is completely unrelated. OutboundBindAddress is used for connections initiated by your relay. ORPort is used for connections accepted by your relay.
T
-- Tim Wilson-Brown (teor)
teor2345 at gmail dot com PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B ricochet:ekmygaiu4rzgsk6n xmpp: teor at torproject dot org
I will update when I can trigger the error again. Just having troubles ramping my relay up after the constant stops and starts from fiddling with my torrc settings.
Should have more information later this week.
Thanks!
I would like to confirm tor's behaviour when this happens:
Is there something listening on 185.92.223.3:8080?
No, there doesn't seem to be:
$ netstat -an -p tcp -f inet | grep LISTEN tcp 0 0 *.443 *.* LISTEN tcp 0 0 127.0.0.1.25 *.* LISTEN tcp 0 0 *.22 *.* LISTEN tcp 0 0 *.80 *.* LISTEN
A port scan of the server shows the tor port as closed...
$ nmap -sT tcj.me
Starting Nmap 7.01 ( https://nmap.org ) at 2017-04-01 09:59 CDT Nmap scan report for tcj.me (185.92.223.3) Host is up (0.15s latency). Not shown: 996 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 443/tcp open https 8080/tcp closed http-proxy
Nmap done: 1 IP address (1 host up) scanned in 11.10 seconds
Is it this tor process, or another tor process?
Only have the one process running still...
$ ps aux | grep tor _tor 45694 0.0 23.1 111008 177576 ?? S Mon10AM 626:59.32 /usr/local/bin/tor
If it is this tor process, is tor still working as a relay despite the warnings?
I would have to say no. Using a program called pftop, I usually see Up States of 1000+ when the relay is going strong, right now I see 13. There is also no traffic on the server right now. However, I do show a single established connection on the tor port 8080, but I'm pretty sure its completely stagnant.
$ netstat -an -p tcp -f inet | grep ESTABLISHED tcp 0 0 185.92.223.3.8080 188.166.41.46.42469 ESTABLISHED tcp 0 0 185.92.223.3.35786 176.10.104.243.443 ESTABLISHED tcp 0 0 185.92.223.3.43470 80.127.107.179.443 ESTABLISHED tcp 0 36 185.92.223.3.22 204.112.151.27.51843 ESTABLISHED tcp 0 0 185.92.223.3.9593 62.210.92.11.9001 ESTABLISHED tcp 0 0 185.92.223.3.19380 185.30.166.37.6667 ESTABLISHED
I would be willing to try any patches you may have!
Thanks,
Tyler
This seems to be an internal state management issue. I have opened ticket #21810 to track it. https://trac.torproject.org/projects/tor/ticket/21810
I would like to confirm tor's behaviour when this happens:
Is there something listening on 185.92.223.3:8080? Is it this tor process, or another tor process? If it is this tor process, is tor still working as a relay despite the warnings?
For comparison, some stats while the relay server is running correctly...
$ netstat -an -p tcp -f inet | grep LISTEN tcp 0 0 127.0.0.1.25 *.* LISTEN tcp 0 0 *.22 *.* LISTEN tcp 0 0 *.443 *.* LISTEN tcp 0 0 185.92.223.3.8080 *.* LISTEN tcp 0 0 *.80 *.* LISTEN
$ netstat -an -p tcp -f inet | grep ESTABLISHED | wc -l 1356
$ ps aux | grep _tor _tor 75460 12.8 24.4 120976 187772 ?? S Sat11AM 60:50.02 /usr/local/bin/tor
If there are more prudent tests/commands that would provide more information, please let me know!
Thanks,
Tyler
tor-relays@lists.torproject.org