Closed Bug 1314074 Opened 8 years ago Closed 3 years ago

Display sensible error if running from inside a dmg or otherwise unsupported environment

Categories

(Toolkit :: Startup and Profile System, defect, P1)

49 Branch
x86
macOS
defect

Tracking

()

RESOLVED DUPLICATE of bug 516362

People

(Reporter: mcote, Assigned: jwatt)

References

Details

Attachments

(8 files)

I have Firefox release channel, 49.0.1, installed on an older (2010) MacBook Pro running OS X 10.12.1. Steps to reproduce: 1. Go to Firefox -> About Firefox. 2. Wait for update to download. 3. Press "Restart Firefox to Update". Expected: Firefox exits and then restarts, running 49.0.2. Actual: Firefox exits and then restarts. The "Software Update" dialog immediately appears, indicating that 49.0.2 is ready to be installed. Clicking "Restart Firefox" then puts up a dialog titled "Firefox is trying to install a new helper tool" and requests my system username and password, on top of a update progress bar in another dialog. Entering my credentials closes the first dialog, leaving only the progress dialog, which disappears a few seconds later. Firefox then comes back up, but this time with a "Software Updated Failed" dialog (with the text "The update could not be installed. Please make sure there are no other copies of Firefox running on y our computer, and then restart Firefox to try again.") I'm sure I can easily install 49.0.2 fresh, but I'm leaving this version for now in case anyone wants to try to debug this with me.
Hm looking at the Firefox Release page, I don't even see a 49.0.2.
Please perform the following: 1. Type about:config in the url bar. 2. Click the button that is shown. 3. Copy devtools.chrome.enabled into the search bar. 4. Toggle the value from false to true by either double clicking it or via the context menu. 5. Under Tools -> Web Developer select Browser Console. 6. Copy and paste the following into the text box at the bottom var fileLocator = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); var dir = fileLocator.get("UpdRootD", Ci.nsIFile); dir.reveal(); 7. Attach the active-update.xml and updates.xml files to this bug 8. In the updates subdirectory attach the last-update.log and the backup-update.log files if they exist. 9. In the 0 subdirectory attach the update.log and the update.status files if they exist.
Flags: needinfo?(mcote)
Attached file active-update.xml (deleted) —
Attached file updates.xml (deleted) —
Flags: needinfo?(mcote)
Attached file updates/0/update.log (deleted) —
Attached file updates/0/update.status (deleted) —
Okay, files uploaded. Note that there were no files in the updates directory, aside from the 0 subdirectory.
Attachment #8806018 - Attachment mime type: text/x-log → text/plain
Relevant error ensure_parent_dir: failed to create directory: /var/folders/p_/b8jr9yw533d5z0w13bz5gq_00000gn/T/AppTranslocation/97DBC6F5-35ED-438C-9BD8-8A182DA3E2AC/d, err: 30 DoUpdate: error extracting manifest file failed: 7 calling QuitProgressUI
Hm that directory already exists and contains a Firefox.app directory: $ ls -l /var/folders/p_/b8jr9yw533d5z0w13bz5gq_00000gn/T/AppTranslocation/97DBC6F5-35ED-438C-9BD8-8A182DA3E2AC/d total 0 drwxr-xr-x@ 3 mcote admin 102 16 Oct 01:09 Firefox.app
Try deleting the following and then try to update again /Users/mcote/Library/Caches/Mozilla/updates/var/folders/p_/b8jr9yw533d5z0w13bz5gq_00000gn/T/AppTranslocation/97DBC6F5-35ED-438C-9BD8-8A182DA3E2AC/
No change; same problem as described in comment 0.
After the download completes but before restarting look in the updates/0 directory from comment #2. There should be an update.mar file. If the size of it is small enough please attach it to this bug.
Also, make a copy of that file to your desktop if you can't attach it since we'll need to investigate its contents.
Attached file update.mar (deleted) —
This is from the second prompt to restart (when the Update Ready to Install dialog comes up).
The mar file is correct and I'm at a loss as to what is different about your system than other systems. Stephen / Matt, do either of you have any idea what could be going on with this bug? It appears that the mar file is correct and the failure is with extracting the first file which is the updatev3.manifest.
Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(mhowell)
So this tries to run an elevated update because the current user doesn't have write access to the Firefox.app bundle. The path to Firefox.app is detected as: > /var/folders/p_/b8jr9yw533d5z0w13bz5gq_00000gn/T/AppTranslocation/97DBC6F5-35ED-438C-9BD8-8A182DA3E2AC/d/Firefox.app This is not a typical install location. Are you running Firefox.app directly from a .dmg image without extracting it to disk (like /Applications) first?
Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(mhowell)
Flags: needinfo?(mcote)
Huh... I though Firefox displayed at least a warning when trying to run from the dmg but perhaps that bug never got fixed. Meh!!! if that is the case.
According to Apple [1], the running from a randomized location stuff also applies when you run from the Downloads directory, not just from inside the DMG. [1] https://developer.apple.com/library/content/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG17
Huh. So I just started Firefox manually from a terminal, thusly: $ /Applications/Firefox.app/Contents/MacOS/firefox And then the upgrade procedure went as usual. I don't see any Firefox dmgs on my drive except in the Trash, nor is there a copy of Firefox in my Downloads directory. I guess it's possible that I ran it from a dmg before moving it to the Trash. Maybe let's turn this bug into a "display sensible error if running from inside a dmg or otherwise unsupported environment"?
Flags: needinfo?(mcote)
Component: Application Update → Startup and Profile System
Summary: Can't upgrade to 49.0.2 → Display sensible error if running from inside a dmg or otherwise unsupported environment
So this happened again and I poked a bit more. Indeed, running "mount" showed /Applications/Firefox.app on /private/var/folders/p_/b8jr9yw533d5z0w13bz5gq_00000gn/T/AppTranslocation/014149D9-1698-408E-9DD2-B2A535B8F1A2 (nullfs, local, nodev, nosuid, read-only, nobrowse, mounted by mcote) So yeah, somehow I was running from a mounted dmg, though I had no other indications of this (no obvious ability to eject it from the Finder, for example). Even more confusingly, I had already deleted the Firefox.app file, but it remained mounted. I unmounted it, then reinstalled Firefox, and all seems to be well now. Not sure how I got into this mess, so apologies for the confusion. :)
No worries! Thanks for confirming.
Priority: -- → P3

Cross-linking Bug 1601148 and its related SUMO threads for reference, such as this one. The TL;DR is that the "running from a randomized location" behaviour means that users who Join Firefox by signing in with their Firefox Account, will be signed out every time they restart the browser, because their profile directory gets recreated in a new location.

Put another way: this bug means we're losing potential Firefox Accounts MAU :-)

I don't have a good sense from the scrollback of how actionable this bug is. Is it something that a member of the FxA or Sync client teams could potentially take on with a bit of mentoring? Is there a way we could gather telemetry about how often this happens in practice?

ni? :mossop as the triage owner, but please redirect me as appropriate, I'm well into unfamiliar territory in this part of Firefox.

Flags: needinfo?(dtownsend)

(In reply to Ryan Kelly [:rfkelly] from comment #23)

Cross-linking Bug 1601148 and its related SUMO threads for reference, such as this one. The TL;DR is that the "running from a randomized location" behaviour means that users who Join Firefox by signing in with their Firefox Account, will be signed out every time they restart the browser, because their profile directory gets recreated in a new location.

Put another way: this bug means we're losing potential Firefox Accounts MAU :-)

I don't have a good sense from the scrollback of how actionable this bug is. Is it something that a member of the FxA or Sync client teams could potentially take on with a bit of mentoring? Is there a way we could gather telemetry about how often this happens in practice?

There are two chief problems here:

  1. Detecting that we're in this state. I haven't spotted any API for this. Potentially we could rely on the apparent install location structure, it seems to be similar each use but that may change as OSX is updated and in different locales.
  2. Figuring out what to actually do when in this state. There are two or three things that could cause it and I suspect that we cannot solve any of them in Firefox code. A new binary that gets elevated permissions could probably solve some of them but otherwise it will be up to the user to manually fix it.
Flags: needinfo?(dtownsend)

I think bug 1557401 is the real problem here which is kinda fallout from bug 1474285, which hasn't really had much work done since it was released.

I think that profile per install based on directory location is not a great design to begin with; it should be keyed to something intrinsic to the Firefox binary, not the install or launch location.

Thanks for the context! I don't disagree with anything in Bug 1557401, but I do think that "Firefox forgot all my settings for no obvious reason" is a different and worse user experience than "Firefox forgot all my settings after I deliberately moved the application". I'd be happy with a fix that addressed the first issue without addressing the second, if it meant the fix was more tractable. But...

Detecting that we're in this state. I haven't spotted any API for this.

From this, and my own poking around on the web, "tractable" doesn't seem like the right word here, at least not yet.

(In reply to Ryan Kelly [:rfkelly] from comment #23)

Is there a way we could gather telemetry about how often this happens in practice?

So we do send a telemetry event when a new profile is created in startup. If there was some way to correlate the pings for a single user then seeing a high number of those events could be a signal. But since it is a new profile each time we won't have a client ID so we'd have to correlate against machine data, which hopefully is difficult.

(In reply to Ryan Kelly [:rfkelly] from comment #26)

Thanks for the context! I don't disagree with anything in Bug 1557401, but I do think that "Firefox forgot all my settings for no obvious reason" is a different and worse user experience than "Firefox forgot all my settings after I deliberately moved the application".

It is the same thing -- from bug 1557401:

A user may think "well, let me try out Firefox", downloads the app, runs it (doesn't "install"), enjoys the experience, and before they unmount the disk image, they move the application to /Applications or similar (like ~/Applications).

What happens after that is that the user "loses" data, and is immediately turned off to Firefox, thinking that it can't retain its own preferences, and promptly switches back to their previous browser.

They may also have an extremely bad taste in their mouth and tell their friends and colleagues that Firefox loses data and is unreliable, and ought not to be used.

It is literally the same issue, except with the added step of them actually deciding that they like Firefox enough to move it outside of a disk image or downloads folder (perhaps even signing up for Fxa).

(In reply to Asif Youssuff from comment #28)

It is literally the same issue, except with the added step of them actually deciding that they like Firefox enough to move it outside of a disk image or downloads folder (perhaps even signing up for Fxa).

The two have the same effect in terms of creating a new profile, in bug 1557401's case because the install location has changed and in this case because the install location has appeared to change. However in bug 1557401's case the user only gets a new profile when they move the bundle while here the user gets a new profile every time they restart Firefox with no action on the user's part.

The solution to the two is also likely to be different. Fixing bug 1557401 would not solve this bug entirely because translocation causes other problems beyond the profile issue.

(In reply to Asif Youssuff from comment #28)

A user may think "well, let me try out Firefox", downloads the app, runs it (doesn't "install"), enjoys the experience, and before they unmount the disk image, they move the application to /Applications or similar (like ~/Applications).

Fixing this bug could solve that scenario.

Another live example here: https://www.reddit.com/r/firefox/comments/eodn3j/logs_me_out_everytime/

Every time I close and sleep my computer firefox signs me out. It is working fine on my pc but on my Mac, it signs me out every time. I have already tried going to history and unchecking cookies and everything but it still does it. Any help would be great thanks!

This definitely needs to be addressed ASAP, since the issue was worsened with the new profile management updates in Firefox 67. Here are some samples of users who have issues with this:

Depends on: 1700795

This continues to be an issue in the real world. See https://www.reddit.com/r/firefox/comments/mh6d79/keeps_crashing_losing_login_info/ for example:

I recently got a new Macbook Air and so Firefox has crashed 3 separate times - each time losing the saved logins for every single site and acts like it's been installed for the very first time.

The user eventually confirms that Firefox is being run from the disk image and has not moved it to a stable location on disk. Unfortunately, this causes issues due to bug 1557401.

Taking a fresh look at this.

Assignee: nobody → spohl.mozilla.bugs
Severity: normal → S2
Status: NEW → ASSIGNED
Priority: P3 → P1

(In reply to Dave Townsend [:mossop] from comment #24)

There are two chief problems here:

  1. Detecting that we're in this state. I haven't spotted any API for this. Potentially we could rely on the apparent install location structure, it seems to be similar each use but that may change as OSX is updated and in different locales.

Going off the directory structure should be a good first start and we can probably iterate on this as we move forward.

  1. Figuring out what to actually do when in this state. There are two or three things that could cause it and I suspect that we cannot solve any of them in Firefox code. A new binary that gets elevated permissions could probably solve some of them but otherwise it will be up to the user to manually fix it.

As a first step I've been debating between a doorhanger and an about: page in the style of about:restartrequired.

  1. Doorhanger: The advantage of a doorhanger is that it allows a user to try Firefox without having to drag it to disk. However, it is easy to dismiss. This may not be a particularly big issue because the doorhanger would display every time Firefox is started from the DMG.

  2. about: page: A page similar to about:restartrequired would force users to install Firefox properly before using it, which has the potential to lead to a better retention rate and MAU.

As a start, both of these options could simply direct to our macOS installation help page.

An elevated binary to "fix" this issue for an end user does not seem to be the right approach. If we were to invest in an elevated helper to address this issue, we should first revisit whether or not we want to develop an installer for macOS. Just like the about: page, an installer would prevent users from trying Firefox before it is installed properly. Previously, we have always leaned against adding an installer because it is "not the macOS way". There has arguably been an influx of Windows users to the macOS platform. It is typical for Windows applications to be installed with an installer, hence an increased number of bug reports surrounding a lack of installer on macOS and/or confusion around how to properly install Firefox from a DMG.

I believe as a first step we should decide how aggressive we want to be about notifying a user that they are running from an unsupported location and choose between a doorhanger (less aggressive) or an about: page (more aggressive).

Mossop, what are your thoughts?

Flags: needinfo?(dtownsend)

(In reply to Stephen A Pohl [:spohl] from comment #34)

(In reply to Dave Townsend [:mossop] from comment #24)
I believe as a first step we should decide how aggressive we want to be about notifying a user that they are running from an unsupported location and choose between a doorhanger (less aggressive) or an about: page (more aggressive).

Mossop, what are your thoughts?

I think since this causes you to lose all your data between each run we should probably be pretty aggressive. I'm not totally sure whether completely blocking browsing is right or not, I'd be interested to hear Romain's take here.

Anecdotal but I see more and more macOS apps come as .app installers these days.

Flags: needinfo?(dtownsend) → needinfo?(rtestard)

I thought it might help the conversation to have screenshots of what these two options might look like. I agree that a more aggressive approach might be preferred here.

Comment on attachment 9214785 [details]
Doorhanger option

I think this looks more visually aggressive than that about: page actually. If there were a way to make this persistent (open in every window, on every tab and no close button) then that might serve the right purpose. Constant reminder you are using Firefox in a way that causes problems but still able to try some things out if needed.

Handing this over to Jonathan who has been looking into this as well.

Assignee: spohl.mozilla.bugs → jwatt

(In reply to Stephen A Pohl [:spohl] from comment #34)

An elevated binary to "fix" this issue for an end user does not seem to be the right approach. If we were to invest in an elevated helper to address this issue, we should first revisit whether or not we want to develop an installer for macOS. Just like the about: page, an installer would prevent users from trying Firefox before it is installed properly. Previously, we have always leaned against adding an installer because it is "not the macOS way". There has arguably been an influx of Windows users to the macOS platform. It is typical for Windows applications to be installed with an installer, hence an increased number of bug reports surrounding a lack of installer on macOS and/or confusion around how to properly install Firefox from a DMG.

Reminder that we do already build an installer[1]. We should consider making the installer the default download.

  1. https://ftp.mozilla.org/pub/firefox/releases/86.0.1/mac/en-US/Firefox%2086.0.1.pkg

(In reply to Haik Aftandilian [:haik] from comment #41)

Reminder that we do already build an installer[1]. We should consider making the installer the default download.

  1. https://ftp.mozilla.org/pub/firefox/releases/86.0.1/mac/en-US/Firefox%2086.0.1.pkg

This has been considered at various times before and we have always continued to favor a dmg over the pkg for regular installs as far as I'm aware. The pkg installer was created for enterprise deployments. I don't believe that there has been a change in perspective on this but I'm going to see if someone has up-to-date info. It's been a while since I've dealt with this.

(In reply to Dave Townsend [:mossop] from comment #35)

(In reply to Stephen A Pohl [:spohl] from comment #34)

(In reply to Dave Townsend [:mossop] from comment #24)
I believe as a first step we should decide how aggressive we want to be about notifying a user that they are running from an unsupported location and choose between a doorhanger (less aggressive) or an about: page (more aggressive).

Mossop, what are your thoughts?

I think since this causes you to lose all your data between each run we should probably be pretty aggressive. I'm not totally sure whether completely blocking browsing is right or not, I'd be interested to hear Romain's take here.

Anecdotal but I see more and more macOS apps come as .app installers these days.

Passing over to Martin who'll be focussing on this space soon

Flags: needinfo?(rtestard) → needinfo?(mbalfanz)
Attached image Chrome Mac Install Prompt (deleted) —

We are exploring multiple solutions to work on in Q2.

I agree that we need to be fairly aggressive here. The goal needs to be to catch users before they run into problems. One approach that I like is what Chrome is doing: When starting Chrome from the dmg, they will show a prompt offering the user to install. Hitting "Install" will then copy Chrome to the /Applicatons folder and start it from there. "Don't Install" will run it from the dmg. I see us doing something along the similar lines.

This could be combined will with other helpful methods, e.g. as spohl presented above. I could also imagine to add instructional text to the dmg background. As users indicated on SUMO, the arrow is not self-explanatory.

Exploration is happening right now, so please keep the comments coming :)

Flags: needinfo?(mbalfanz)

I think a dialog to move the app to /Applications will probably help most users, except those who are not administrators of the machine. I don't have the data to know how large of a userbase that might be, but I would assume that means that we would still need to try to find a stable location to store the app as a secondary candidate in that case. Otherwise, we continue to run the risk of running into bug 1557401 on subsequent launches after a user has moved the binary to a temporary location to escape the suggestions in comment 34, and has proceeded to move the application to a "stable" location.

Offering to move to /Applications sounds like a good first step though, assuming that many users are also administrators.

We implemented the prompt to install Firefox in bug 516362 and have telemetry to monitor the effect on users. Once that data starts to come in in January we'll consider whether the ideas in comment 34 here or some other fixes/approach are necessary, but we'll open new more targeted bugs for that. (And there's still bug 1601148 open, of course.)

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: