Skip to content
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

The Tor daemon can get into a bad state and break Tor windows #14518

Closed
fmarier opened this issue Mar 6, 2021 · 4 comments · Fixed by brave/brave-core#8714
Closed

The Tor daemon can get into a bad state and break Tor windows #14518

fmarier opened this issue Mar 6, 2021 · 4 comments · Fixed by brave/brave-core#8714

Comments

@fmarier
Copy link
Member

fmarier commented Mar 6, 2021

I collected a browser profile from a user on Mac Catalina 10.15.7 who is unable to use Tor windows in 1.21.73. All he sees in brave://tor-internals is:

Mar 04 09:28:01.000 [notice] Tor 0.4.5.6 opening new log file.
Mar 04 09:28:01.248 [notice] We compiled with OpenSSL 1010109f: OpenSSL 1.1.1i  8 Dec 2020 and we are running with OpenSSL 1010109f: 1.1.1i. These two versions should be binary compatible.
Mar 04 09:28:01.254 [notice] Tor 0.4.5.6 running on Darwin with Libevent 2.1.11-stable, OpenSSL 1.1.1i, Zlib 1.2.11, Liblzma N/A, Libzstd N/A and Unknown N/A as libc.
Mar 04 09:28:01.254 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Mar 04 09:28:01.254 [notice] Configuration file "/nonexistent" not present, using reasonable defaults.
Mar 04 09:28:01.263 [notice] Opening Socks listener on 127.0.0.1:0
Mar 04 09:28:01.264 [notice] Socks listener listening on port 56449.
Mar 04 09:28:01.264 [notice] Opened Socks listener connection (ready) on 127.0.0.1:56449
Mar 04 09:28:01.264 [notice] Opening Control listener on 127.0.0.1:0
Mar 04 09:28:01.264 [notice] Control listener listening on port 56450.
Mar 04 09:28:01.264 [notice] Opened Control listener connection (ready) on 127.0.0.1:56450
Mar 04 09:28:01.000 [notice] Bootstrapped 0% (starting): Starting
Mar 04 09:28:02.000 [notice] Starting with guard context "default"
Mar 04 09:28:02.000 [notice] New control connection opened from 127.0.0.1.
Mar 04 09:28:02.000 [notice] Catching signal TERM, exiting cleanly.

@darkdh took a look and found that it is affected by some states in the tor/data folder. The circuit cannot be established and gets stuck in the bootstrapping phase at 0%. After deleting the folder, it returns to normal.

We can't clear the tor/data directory on startup because it would cause long delays in creating new Tor circuits, but perhaps we can clear that directory on update.

Right now, users can't recover from this state without blowing away their profile. If we could fix these problems automatically for them on update, then the recovery would be automatic, at the cost of longer circuit creation for everyone (only after an update though).

@btlechowski
Copy link

QA/Blocked till we get the data needed to perform verification.

@btlechowski
Copy link

Removed QA/Blocked as the data has been shared

@stephendonner
Copy link

stephendonner commented May 28, 2021

Verified PASSED using the testplan from brave/brave-core#8714 with build !image

Brave 1.26.43 Chromium: 91.0.4472.77 (Official Build) beta (x86_64)
Revision 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS macOS Version 11.4 (Build 20F71)

Steps:

Initialization stuck

  1. obtained the profile with the bad tor state from @fmarier
  2. copied the tor/data from step 1 to user_data_dir to replace the original one
  3. opened a new Tor window and experienced the stuck initialization (disconnected state) and saw the tip message
  4. closed Tor window and went to brave://settings/extensions, disabled Tor, then re-enabled it again
  5. opened a new Tor window
  6. tor status should be connected after initiating complete
example example example example example
Screen Shot 2021-05-28 at 10 33 43 AM Screen Shot 2021-05-28 at 10 34 13 AM Screen Shot 2021-05-28 at 10 34 10 AM Screen Shot 2021-05-28 at 11 00 49 AM Screen Shot 2021-05-28 at 10 35 19 AM

Prompt

  1. disabled Wi-Fi (for simulating persistent disconnected state of Tor)
  2. opened a new Tor window
  3. saw Tor status was disconnected and confirmed I saw a tip prompting me to disable and re-enable Tor
  4. clicked on the link, which went to brave://settings/extensions
  5. turned Wi-Fi back on and returned to the Tor window
  6. confirmed when I reconnected, the tip went away and connected displayed
example example example
Screen Shot 2021-05-28 at 11 07 47 AM Screen Shot 2021-05-28 at 11 10 48 AM Screen Shot 2021-05-28 at 11 08 27 AM

Disable Tor

  1. opened a Tor window and made sure user_data_dir had tor/data and tor/watch files
  2. went to brave://settings/extensions and disabled Tor via the toggle
  3. confirmed the tor folder in user_data_dir was empty
example example
Screen Shot 2021-05-28 at 10 46 00 AM Screen Shot 2021-05-28 at 10 46 16 AM

Verification passed on



<!--StartFragment-->
Brave | 1.26.43 Chromium: 91.0.4472.77&nbsp;(Official Build)&nbsp;beta&nbsp;(64-bit)
-- | --
Revision | 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS | Windows&nbsp;10 OS Version 2004 (Build 19041.985)

<!--EndFragment-->

Initialization stuck
example example example example example
image image image image image
Prompt
example example example
image image image
Disable Tor
example example example example
image image image image

Verification passed on

Brave 1.26.45 Chromium: 91.0.4472.77 (Official Build) beta (64-bit)
Revision 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}
OS Ubuntu 18.04 LTS
Initialization stuck
image image
Prompt

image|image|image

Disable Tor

image

@LaurenWags
Copy link
Member

Updated to release-notes/exclude after discussing with @darkdh 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment