I'm running some experiments using the stem library where I change circuit paths fairly frequently. Every so often, I get a stream detached event and a Socks5Error: 'TTL Expired'
in my Python script, and at the same time I get something like Jan 12 12:09:52.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:6667. Giving up. (waiting for controller)
in my Tor log.
Does anyone have any idea why this might be occurring, and how I could either prevent it or even recover from it? I tried catching the exception, waiting, and then getting a new controller (with Controller.from_port
) but the attempt to get a new controller throws a Socks5Error
as well. Once I restart the script though, everything works fine until the error occurs agin.
Even if the error can't be prevented, I'd like the script to be able to keep going on it's own.
SafeLogging 0
in yourtorrc
, get the failing IP and test it using another Tor client or by other means.