Closed Bug 1458856 Opened 2 years ago Closed 2 years ago

Rollout on new non-existent preference throws Component Failure


(Firefox :: Normandy Client, defect, P1)




Firefox 61
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox59 --- unaffected
firefox60 --- unaffected
firefox61 + verified
firefox62 --- verified


(Reporter: adrian_sv, Assigned: mythmon)




(1 file)

The following reproduces only on a FF client when using a new non-existent preference added manually from about:config.

You need access to New Admin interface (
1. Set the app.normandy.dev_mode preference to true to run recipes immediately on startup.
2. Set the app.normandy.logging.level preference to 0 to enable more logging.
3. Set the security.content.signature.root_hash preference to DB:74:CE:58:E4:F9:D0:9E:E0:42:36:BE:6C:C5:C4:F6:6A:E7:74:7D:C0:21:42:7A:03:BC:2F:57:0C:8B:9B:90.
4. Set the preference value for app.normandy.api_url set to

1. Open Firefox client with a new profile.
2. Open about:config in a new tab and right click and add a new preferences: e.g. non_existent_preference, int, with value 10.
3. Open Admin center and create a new rollout type recipe, targeting the step2 preference, changing the value to something else, e.g. 12.
4. Publish step 3 recipe.
5. On the profile from step 1, set prerequisites and restart.
6. Open browser console and check the results.

[Actual Result:]
1525337683826	app.normandy.recipe-runner	INFO	Executing recipe "pref-r-2" (action=preference-rollout)
[Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getIntPref]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: resource://normandy/lib/PrefUtils.jsm :: getPref :: line 34" data: no]

getPref resource://normandy/lib/PrefUtils.jsm:34:16 	_run/newRollout.preferences< resource://normandy/actions/PreferenceRolloutAction.jsm:41:24 	map self-hosted:292:17 	_run resource://normandy/actions/PreferenceRolloutAction.jsm:38:20 	InterpretGeneratorResume self-hosted:1264:8

[Expected Result:]
The preference rollout should be executed successfully with no browser console error.
Comment on attachment 8973029 [details]
Bug 1458856 - Handle prefs with only a user value in preference rollout

Code analysis found 1 defect in this patch:
 - 1 defect found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)

If you see a problem in this automated review, please report it here:

::: toolkit/components/normandy/lib/PrefUtils.jsm:46
(Diff revision 1)
>        }
> +    } catch (e) {
> +      if (branchName === "default" && e.result === Cr.NS_ERROR_UNEXPECTED) {
> +        // There is a value for the pref on the user branch but not on the default branch. This is ok.
> +        return defaultValue;
> +      } else {

Error: Unnecessary 'else' after 'return'. [eslint: no-else-return]
Assignee: nobody → mcooper
Priority: -- → P1
Comment on attachment 8973029 [details]
Bug 1458856 - Handle prefs with only a user value in preference rollout
Attachment #8973029 - Flags: review?(gijskruitbosch+bugs) → review+
Pushed by
Handle prefs with only a user value in preference rollout r=Gijs
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Verified as fixed on the following builds:
Beta 61.0b6(20180517141400) and Nightly 62.0a1(20180520220103).

No error is displayed in browser console when a rollout is performed on a new non-existent preference.
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.