Nick reported that 6.0a5 on OS X is neither starting after an update nor after being freshly downloaded. The error message is: Tor launcher\n\nTor unexpectedly exited. This might be a bug in Tor itself...
Running "tor.real" from the command line is starting it fine.
After a bit of testing it turned out that putting it on the desktop is working fine, too. Just having it in /Applications produces the bug. I guess this is due to #13252 (moved).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I cannot reproduce this with a clean install or an upgrade from 6.0a4 on the Mac OS 10.10.5 computer I have easy access to right now. Maybe something got corrupted in the browser profile during the upgrade (perhaps because of #18928 (moved)).
Nick, do either or both of the following directories exist? If so, what is in them?
/Applications/TorBrowser.app/TorBrowser/
~/Library/Application Support/TorBrowser-Data/
Please make a copy of everything under ~/Library/Application\ Support/TorBrowser-Data/ and set it aside for future debugging if you have not already done so.
Then, try renaming or setting aside that directory and see if the browser starts correctly (it should act like a clean start since you are setting aside your migrated browser profile and your Tor data directory).
If that works then the problem must be with your migrated browser profile.
If you are willing to help us some more, at that point quit the browser, throw away the newly created ~/Library/Application\ Support/TorBrowser-Data directory, place a copy of the older TorBrowser-Data directory that is not working back under ~/Library/Application\ Support/, and then edit your prefs.js file to add these two lines:
{{{
user_pref("extensions.torlauncher.loglevel", 0);
user_pref("extensions.torlauncher.logmethod", 0);
where SOMETHING is a random string that the browser generated when it migrated your old profile over to ~/Library/Application\ Support.Finally, start the browser from a shell and see if anything interesting is logged, e.g.,
I had an idea that a difference might be that some people are running with a "Standard" account (vs. an "Admin" account). But using a Standard account did not allow me to reproduce the problem.
Please make a copy of everything under ~/Library/Application\ Support/TorBrowser-Data/ and set it aside for future debugging if you have not already done so.
Okay, it all went the way you expected. Moving the TorBrowser-Data directory aside made TB work.
Afterwards, when I tried the steps you recommend, this was logged:
{{{
[05-06 03:44:57] TorLauncher INFO: debug output ready
[05-06 03:44:57] TorLauncher DBUG: Starting /Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor/tor
[05-06 03:44:57] TorLauncher DBUG: --defaults-torrc
[05-06 03:44:57] TorLauncher DBUG: /Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor/torrc-defaults
[05-06 03:44:57] TorLauncher DBUG: -f
[05-06 03:44:57] TorLauncher DBUG: /Users/nickm/Library/Application Support/TorBrowser-Data/Tor/torrc
[05-06 03:44:57] TorLauncher DBUG: DataDirectory
[05-06 03:44:57] TorLauncher DBUG: /Users/nickm/Library/Application Support/TorBrowser-Data/Tor
[05-06 03:44:57] TorLauncher DBUG: GeoIPFile
[05-06 03:44:57] TorLauncher DBUG: /Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor/geoip
[05-06 03:44:57] TorLauncher DBUG: GeoIPv6File
[05-06 03:44:57] TorLauncher DBUG: /Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor/geoip6
[05-06 03:44:57] TorLauncher DBUG: HashedControlPassword
[05-06 03:44:57] TorLauncher DBUG: 16:8e408eb3d34c70fe60fe0364178c9aa68a4af6bb6961ab8844225c0667
[05-06 03:44:57] TorLauncher DBUG: __OwningControllerProcess
[05-06 03:44:57] TorLauncher DBUG: 66947
[05-06 03:44:58] TorLauncher DBUG: Opening control connection to 127.0.0.1:9151
[05-06 03:44:58] TorLauncher DBUG: Sending Tor command: AUTHENTICATE 414124775d585b586a4e62633f2c3753
[05-06 03:44:58] TorLauncher NOTE: failed to open authenticated connection: [Exception... "Component returned failure code: 0x804b000d (NS_ERROR_CONNECTION_REFUSED) [nsIBinaryOutputStream.writeBytes]" nsresult: "0x804b000d (NS_ERROR_CONNECTION_REFUSED)" location: "JS frame :: jar:file:///Users/nickm/Library/Application%20Support/TorBrowser-Data/Browser/fl4i90pd.default/extensions/tor-launcher@torproject.org.xpi!/components/tl-protocol.js :: TorProtocolService.prototype._sendCommand :: line 685" data: no]
May 05 23:44:58.109 [notice] Tor v0.2.8.2-alpha (git-684babee8491c3e9) running on Darwin with Libevent 2.0.22-stable, OpenSSL 1.0.1s and Zlib 1.2.5.
May 05 23:44:58.111 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
May 05 23:44:58.111 [notice] This version is not a stable Tor release. Expect more bugs than usual.
May 05 23:44:58.111 [notice] Read configuration file "/Applications/TorBrowser.app/Contents/Resources/TorBrowser/Tor/torrc-defaults".
May 05 23:44:58.112 [notice] Read configuration file "/Users/nickm/Library/Application Support/TorBrowser-Data/Tor/torrc".
May 05 23:44:58.162 [notice] Opening Socks listener on 127.0.0.1:9150
May 05 23:44:58.162 [notice] Opening Control listener on 127.0.0.1:9151
May 05 23:44:58.000 [warn] Couldn't open file for 'Log info file /Applications/TorBrowser.app/TorBrowser/Data/Tor/info.log': No such file or directory
May 05 23:44:58.000 [notice] Closing partially-constructed Socks listener on 127.0.0.1:9150
May 05 23:44:58.000 [notice] Closing partially-constructed Control listener on 127.0.0.1:9151
May 05 23:44:58.000 [warn] Failed to parse/validate config: Failed to init Log options. See logs for details.
May 05 23:44:58.000 [err] Reading config failed--see warnings above.
[05-06 03:44:58] TorLauncher DBUG: Opening control connection to 127.0.0.1:9151
[05-06 03:44:58] TorLauncher DBUG: Sending Tor command: AUTHENTICATE 414124775d585b586a4e62633f2c3753
[05-06 03:44:58] TorLauncher NOTE: failed to open authenticated connection: [Exception... "Component returned failure code: 0x804b000d (NS_ERROR_CONNECTION_REFUSED) [nsIBinaryOutputStream.writeBytes]" nsresult: "0x804b000d (NS_ERROR_CONNECTION_REFUSED)" location: "JS frame :: jar:file:///Users/nickm/Library/Application%20Support/TorBrowser-Data/Browser/fl4i90pd.default/extensions/tor-launcher@torproject.org.xpi!/components/tl-protocol.js :: TorProtocolService.prototype._sendCommand :: line 685" data: no]
[05-06 03:44:58] TorLauncher NOTE: Tor unexpectedly exited. This might be due to a bug in Tor itself, another program on your system, or faulty hardware. Until you restart Tor, the Tor Browser will not able to reach any websites. If the problem persists, please send a copy of your Tor Log to the support team.
Restarting Tor will not close your browser tabs.
It looks like this is the trouble:
May 05 23:44:58.000 [warn] Couldn't open file for 'Log info file /Applications/TorBrowser.app/TorBrowser/Data/Tor/info.log': No such file or directory
[snip]
[05-06 03:44:58] TorLauncher DBUG: Sending Tor command: AUTHENTICATE 414124775d585b586a4e62633f2c3753
Hopefully that's just a random password.
[snip]
It looks like this is the trouble:
{{{
May 05 23:44:58.000 [warn] Couldn't open file for 'Log info file /Applications/TorBrowser.app/TorBrowser/Data/Tor/info.log': No such file or directory
}}}
Your old torrc seems to have a Log option whose path wasn't migrated to the new bundle data location. It should probably point to /Users/nickm/Library/Application Support/TorBrowser-Data/Tor/info.log. Maybe this wasn't a Tor Browser profile problem after all?
Your old torrc seems to have a Log option whose path wasn't migrated to the new bundle data location. It should probably point to /Users/nickm/Library/Application Support/TorBrowser-Data/Tor/info.log. Maybe this wasn't a Tor Browser profile problem after all?
It could be argued that this is a migration problem. We could add code to Tor Browser that tries to fix up paths inside torrc during profile migration. But that seems like a bad idea since Tor Browser currently has no knowledge of how to parse a torrc file, including which config file directives accept paths.
In an ideal world we would capture stderr inside Tor Launcher (which would have made the problem obvious at least). This also tells me that fixing #10059 (moved) by providing a mechanism to ask for log messages via the control port is perhaps not the best solution; in this case, tor exited to soon for such a solution to be effective.
One thing still confuses me about this ticket though. In the description, gk said:
Running "tor.real" from the command line is starting it fine.
Maybe a different torrc was used for that test?
Your old torrc seems to have a Log option whose path wasn't migrated to the new bundle data location. It should probably point to /Users/nickm/Library/Application Support/TorBrowser-Data/Tor/info.log. Maybe this wasn't a Tor Browser profile problem after all?
It could be argued that this is a migration problem. We could add code to Tor Browser that tries to fix up paths inside torrc during profile migration. But that seems like a bad idea since Tor Browser currently has no knowledge of how to parse a torrc file, including which config file directives accept paths.
In an ideal world we would capture stderr inside Tor Launcher (which would have made the problem obvious at least). This also tells me that fixing #10059 (moved) by providing a mechanism to ask for log messages via the control port is perhaps not the best solution; in this case, tor exited to soon for such a solution to be effective.
Getting the stdout/stderr would have been helpful in this case, yeah.
Also I wonder if somewhere down the line we might have some way in particular for Tor to report this kind of error so the Launcher can say something like, "Tor found a problem with your configuration. It said, "[message here]". Retry with a fresh configuration?"
One thing still confuses me about this ticket though. In the description, gk said:
Running "tor.real" from the command line is starting it fine.
Maybe a different torrc was used for that test?
As we discussed during the Tor Browser dev meeting this past Monday, it would be good to give users a better idea what went wrong. The real solution is for Tor Launcher to capture stderr, but that is not easy to implement. But it would be easy to display a different error message when it appears that tor never fully started (i.e., when Tor Launcher is unable to establish a control port connection before tor exits). The current message that is displayed by Tor Launcher when it detects that tor has exited looks like this:
Tor unexpectedly exited. This might be due to a bug in Tor itself, another program on your system, or faulty hardware. Until you restart Tor, the Tor Browser will not able to reach any websites. If the problem persists, please send a copy of your Tor Log to the support team.
Restarting Tor will not close your browser tabs.
[OK] [Restart Tor]
Here is a proposal for a message to display in the "could never connect to the control port" case:
Tor exited during startup. This might be due to an error in your torrc file, a bug in Tor or another program on your system, or faulty hardware. Until you fix the underlying problem and restart Tor, Tor Browser will not start.
[OK] [Restart Tor]
Comments? One problem with this is that it does not tell users where to find the torrc that Tor Browser is using (I suppose we could include the full path in the error alert). Another problem is that it is late in the Tor Browser 6.0 cycle and therefore it may be a bad idea to add strings that need to be translated.
Sounds good to me. We can omit it in 6.0 and backport it later to 6.0.x as soon as the translations (or a sufficiently large part of them) are available. Not sure about including the torrc path. I am inclined to omit that by arguing that folks who are able to play with their torrc file should know where it is (and, sure, I am assuming that our default torrc files are not causing this problem or, more precisely, that they are not causing that problem in a way a dev knowing what to do would not have hit it).