Closed Bug 1962531 Opened 4 months ago Closed 4 months ago

Profiles lost when the startup profile selector is enabled

Categories

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

defect

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox137 --- unaffected
firefox138 - unaffected
firefox139 + fixed

People

(Reporter: jhirsch, Assigned: mossop)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: dataloss, regression, Whiteboard: [fidefe-profile-management])

Attachments

(2 files)

We've had two reports today of nightly users whose systems were restarted by a macos update (including force-shutting down nightly) or a crash. After restarting, their profile groups were gone. It looks like they rebooted into the state where SelectableProfileService.currentProfile is null, as last seen in bug 1943559.

Severity: -- → S2
Priority: -- → P1
Whiteboard: [fidefe-profile-management]
Assignee: nobody → jhirsch
Status: NEW → ASSIGNED
Summary: Lost profiles after macos update → Lost profiles after crash or macos update

So far it does appear that users can recover the profile group connection in a tedious and painful way: first, look through the profile groups directory and get a list of potential storeIDs from the sqlite file names (for example, "Profile Groups/5cd06f6a.sqlite"). Then, enable the browser toolbox in a new profile, and in the console, run this snippet, swapping in the storeID. This seems to consistently attach the running profile to a lost profile group:

// Here we use "5cd06f6a" as an example storeID.
SelectableProfileService.groupToolkitProfile.storeID = "5cd06f6a";
Services.prefs.setStringPref("toolkit.profiles.storeID", "5cd06f6a");
await SelectableProfileService.uninit();
await ProfilesDatastoreService.uninit();
await ProfilesDatastoreService.init();
await SelectableProfileService.maybeSetupDataStore();

I can reproduce this without a crash or macOS update. It impacts anyone who has the profile selector to show on startup because bug 1953884 doesn't take that case into account.

Severity: S2 → S1
Keywords: dataloss
Regressions: 1953884
Summary: Lost profiles after crash or macos update → Profiles lost when the startup profile selector is enabled

I've requested that we disable nightly updates while we figure this out so we don't impact more users.

Keywords: regression
Regressed by: 1953884
No longer regressions: 1953884

Set release status flags based on info from the regressing bug 1953884

Duplicate of this bug: 1962606
Duplicate of this bug: 1962623
Assignee: jhirsch → dtownsend

Thanks for marking this an S1.

It impacts anyone who has the profile selector to show on startup

Ugh, that's terrible news--by default we enable the profile selector at startup when a user creates their second profile, so this likely impacts the majority of nightly profiles users.

Bug 1953884 made the storeID pref always set and used the presence of storeID in profiles.ini to
determine whether profiles had previously been created. However it missed the startup code in
nsToolkitProfileService which always sets the storeID in profiles.ini if there is one set in prefs.
This means that users who had never used the profiles feature had the profiles created pref set to
true but no entry for the current profile was added to the database. This causes bustage when we
attempt to display various parts of the UI.

This adds a check to a point in startup when we know we should have found an entry for the current
profile in the database. If one doesn't exist we either create one if there are other profiles in
the database or we reset the prefs and profiles.ini to what they should look like if no profiles
have ever been created.

This should also resolve bug 1943559.

Blocks: 1943559
Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e6eddf11a9c4 The ProfilesDatastoreService should get the storeID from the current nsIToolkitProfile in early startup. r=profiles-reviewers,jhirsch,niklas https://hg.mozilla.org/integration/autoland/rev/df8710fa2766 Re-create the original profile or reset state if the profiles created pref is accidentally set. r=profiles-reviewers,jhirsch
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
Regressions: 1962855
QA Whiteboard: [qa-triage-done-c140/b139]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: