While testing an in-browser update of TB 4.0a2 to TB 4.0a3 with meek enabled, the meek browser profile seems to be damaged after the update. brade and I observed this on both Mac OS and Windows 7. Steps to reproduce:
Configure TB 4.0-alpha-2 with the meek-amazon transport.
Use the in-browser updater to update to 4.0-alpha-3 (for testing, we are hosting the XML update manifest and MAR files on our own server and setting app.update.url.override to point to them).
After restart, the Tor Status window will make no progress and an error alert that reads "Profile Missing. Your Firefox profile cannot be loaded. It may be missing or inaccessible."
Strangely, restarting the browser a second time seems to fix the problem.
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.
What does yours look like after starting the browser a second time? If you run ./Browser/firefox -P, is the meek-http-helper profile listed? For me it only shows "default".
The meek-http-helper profile isn't listed in profiles.ini (on purpose). I wonder if that can be related? Here is my profiles.ini with 4.0-alpha-2:
...
What does yours look like after starting the browser a second time? If you run ./Browser/firefox -P, is the meek-http-helper profile listed? For me it only shows "default".
My profile.ini is the same as yours after updating to 4.0-alpha-3, so I do not think that is the problem.
Today on Mac OS after I saw the "Profile Missing" error, I restarted the browser again and the Tor Launcher configuration wizard was displayed (presumably because the Tor bootstrap failed the last time the browser was started). But at the same time, a "Select Your Add-ons" window was displayed, asking me to confirm that I wanted the meek HTTP helper add-on the be enabled (I will attach a screenshot). After I dismiss that window and then click "Connect" in the Tor Launcher wizard, everything works fine. Upon subsequent restarts everything is also OK.
I wonder if the problem occurs during/after an update because the hidden meek client browser does not get shutdown while the updater is updating files. Or maybe the shutdown is not fast enough. Tor Launcher issues a TAKEOWNERSHIP control port command and relies on tor to shut itself down when the main browser exits.
brade and I just came up with another way to possibly cause this kind of problem. We tried it, and indeed the same problem occurs. No update is required. Just follow these steps:
Install a new TB 4.0-alpha-3 browser and configure it to use meek.
Go to Tools|Add-ons and install a Firefox add-on that requires a restart. We used our Page Saver add-on but any add-on that requires a restart should work.
Click "Restart Now" within the Add-ons window after the add-on has been downloaded. This will case the browser to restart quickly. Then you will see the "Profile Missing" alert.
I notice that profile.default does something different. I don't know how it gets set, but my Browser/TorBrowser/Data/Browser/profile.default/prefs.js has
I used the auto-updater to update from Tor Browser 4.0.4 to 4.0.5 with Linux 32bit on Debian Wheezy. After auto-updating I click the 'restart' button. Tor restarts and then the configuration window comes up asking me if I want to connect directly to Tor or use a bridge.
4.0.4 was configured to use the meek-google bridge. I don't click on any configure buttons and Tor 4.0.5 gets to 100% connection status and connects to meek-google bridge automatically, but Tor web browser doesn't launch and the configure window just sits there blocking Tor web browser from launching.
So I close the configure window, which disconnects Tor. Then relaunch Tor, but this time the configure window doesn't come up and the Tor web browser launches when the connection status gets to 100%. A window pops up saying "Tor has been successfully updated."
I saw this again today when updating from TB 4.0.8 to 4.5.1 on Windows 7 with meek-azure enabled. Now that a lot of people are using meek, I am worried that many people will encounter this bug. My best guess is still that this bug is caused by the invisible browser that meek uses not shutting down quickly enough (or at all) during restart of the main browser.
Type "restart".
So this problem doesn't have to do with an update or an add-on per se, but with the restart function that is different from "New Identity" and different from closing the browser and opening it again.
My best guess is still that this bug is caused by the invisible browser that meek uses not shutting down quickly enough (or at all) during restart of the main browser.
I checked and everything is getting new PIDs after restart, everything from the main firefox on down.
If I add an artificial delay to meek-client-torbrowser (time.Sleep(50*time.Second)) before the call to runFirefox, the error occurs as always, after waiting for 50 seconds. Here is the mysterious part: If I manually run the meek-http-helper profile during those 50 seconds, the headless browser and extension runs and produces output with no problems!
But then as soon as the 50 seconds elapse, the firefox that is started by meek-client-torbrowser fails with the profile error. Even while the profile error is being shown, I can run the headless browser manually with no problem.
I wish I knew how to trace the code path that leads to the "profile cannot be loaded" error, to know what is going wrong in Firefox's opinion.
Kathy and I poked at this a little more and we think we found the root cause: before restarting, Firefox sets some environment variables to tell it things like where the profile is, and those are inherited by the meek helper firefox process. If you examine the environment of the meek firefox, you will see things like:
It seems to come down to environment variables that Firefox sets when restarting. Specifically, XRE_PROFILE_PATH, which overrides the -profile option that meek-client-torbrowser uses. If I make this patch, then everything works with no profile error:
Notice that XRE_PROFILE_LOCAL_PATH and XRE_PROFILE_PATH point to profile.default, not profile.meek-http-helper. Firefox seems to prioritize XRE_PROFILE_PATH (didn't test XRE_PROFILE_LOCAL_PATH) over the -profile option on the command line. The profile error we've been seeing is actually caused by the headless browser trying to run the default profile, instead of the meek-http-helper profile asked for on the command line.
I can reproduce the profile error dialog now, using the meek-client-torbrowser delay from comment:16. This command raises the error if executed while Tor Browser is running (even if that Tor Browser is not running meek).
If you run the above command when Tor Browser is not running, then it starts a new Tor Browser instance with Tor Launcher and everything, so it's clear the problem is XRE_PROFILE_PATH overriding the -profile option.
So do we just want to apply the Unsetenv patch to meek-client-torbrowser? It seems to suffice.
So do we just want to apply the Unsetenv patch to meek-client-torbrowser? It seems to suffice.
Wow, that was weird: parallel debugging, and we came to the same conclusion. I say "Yes, let's just clear the env vars." I think it would be safe to clear all of them, but as the meek maintainer that is your call.
So do we just want to apply the Unsetenv patch to meek-client-torbrowser? It seems to suffice.
Wow, that was weird: parallel debugging, and we came to the same conclusion. I say "Yes, let's just clear the env vars." I think it would be safe to clear all of them, but as the meek maintainer that is your call.