-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent Tor connection failures on Tails 4.20 when the network hook script runs #5952
Comments
Still pending reproduction. At minimum during this sprint we may see another RC (and then the final at the end of the sprint period) and can do some additional testing here. |
The changes to the connection wizard have been deferred to Tails 4.20, due on 2021-07-13. Re-milestoning this issue to the next release. |
The Tor Connection Assistant is part of Tails 4.20 (I've re-titled the issue accordingly). I've not been able to reproduce the original issue, but given how timing-dependent it is, it's quite possible that it may still arise. What I am seeing is a consistent brief flash of a connection error, the first time I connect to Tor (using defaults, without bridges): This is likely triggered by our Tor restart here: The assistant is smart enough to pick up that the connection was temporarily lost. It's also smart enough to recognize the recovery, and the error goes away. Still, this has significant potential for confusion. |
Here's what I've learned after another 90 minutes or so of investigation:
For now, I'll open a docs PR with a screenshot of the TCA, and a temporary note about the error behavior above that users may observe. |
Thanks for following up! That does seem like a related behaviour to my original report - it could just come down to timing/network speed. The fix of waiting for the TCA to finish before firing the network hook makes sense if we can do it, though I'd worry about users never closing the TCA window and then getting confused as to why their shortcuts aren't working. Will set up a 4.20 stick and attempt to reproduce both. |
I'm seeing the error flash now as described above, no sign of the earlier more serious error. A fix would still be good but it may not be as urgent. |
I'm still seeing the flash error on Tails 4.21, but only on initial connect, not on reconnect. I'm also sometimes seeing a more serious error which is likely related: the Tails built-in update check complains that it cannot connect (it does not retry). In short, restarting Tor exactly at the same time that Tails is doing its best to connect to Tor and run its own update checks is probably not a sustainable way to go. In this commit I am switching it to
Meanwhile, it looks like Tails is preparing to re-enable said sandbox mode: If I understand correctly, the One other strategy that may be worth exploring:
In prelim testing, it seems to work fine to make the |
As far as I can tell, this would require running a script as root on startup, for which Tails does not appear to provide any facilities ( Otherwise I think it would be best to ask upstream for implementation advice here, to make sure we handle our setup logic in a way that does not interfere with Tails' setup and update checks. |
I've tested the behavior in Tails 4.22 and still observe the following issues:
The first is the more serious issue and IMO a good reason to try to resolve this at least in the long run. As expected, Tails 4.22 re-enabled Per brief discussion with Kev today, I've investigated using the Because the network is not fully up at this stage, it would also require splitting the hook into two: 1) the Tor restart for the configuration change, 2) the update check, which can run as before while other stuff is going on. Unfortunately, with Tails 4.22, the TCA enters a persistent error state if our hook runs before it tries to do its thing (I believe I was able to run it without issues prior to running TCA in previous Tails versions). That may be resolvable with a closer read of the TCA code, so I'm still cautiously optimistic that the I've also investigated if Tails' shell functions may be of service in monitoring the state of the system before we do things, but so far I don't see how -- AFAICT, to safely restart Tor, we have to do so either before TCA runs or after the TCA window is closed by the user (because it actively polls for the Tor status while it is open) and the Tails update check has run. |
I think if the pre-up script works, we don't need to do a tor restart - the pre-up would pop the auth-private files into place, Tails' own network hook would bounce Tor, and we'd do the upgrade check once it was complete. This would probably also mean a couple of changes in the tailsconfig Ansible run as well tho. |
After spending some time with this issue I'm inclined to defer it:
Splitting the A good fix for this overall would involve:
The scope of said good fix is probably too much to make it into the 2.1.0 milestone. |
Description
With SD set up on Tails, a network hook script (or rather the
securedrop_init.py
script run by the hook) runs every time a network interface (that's not the loopback) comes up. This script copies Tor config changes into place and bounces Tor, to allow access to authenticated hidden services (JI, SSH).In Tails 4.19rc1, Tor is now started manually by the user via the new Tor Connection app (TCA). Depending on timing, the network hook script may restart Tor while TCA is also starting it. Subsequent network calls in the script fails, meaning that the hook fails overall. TCA interprets this as Tor failing - this can result in a failed connection or the TCA reconnecting using bridges. This doesn't seem to happen for everybody - if TCA connects quickly enough then it isn't an issue.
Steps to Reproduce
Expected Behavior
Tor connects without issue.
Actual Behavior
TCA assumes vanilla Tor connections don't work, falls back to default bridges. Network hook script not run completely.
Comments
Adding a time.sleep(30) after the tor restart in the hook seems to alleviate the issue. It might make sense have the script watch for Tor coming back up before proceeding.
The text was updated successfully, but these errors were encountered: