Extensions from policies.json only install on first run

VERIFIED FIXED in Firefox -esr60

Status

()

defect
P1
normal
VERIFIED FIXED
6 months ago
3 months ago

People

(Reporter: techdude300, Assigned: mkaply)

Tracking

64 Branch
Firefox 68
Points:
---

Firefox Tracking Flags

(firefox-esr60 fixed, firefox68 verified)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

I've been trying to create an Enterprise Policy via policies.json that will install extensions from AMO, however, it only works the first time the browser is launched from a fresh profile.

Repro Steps:

  1. Place this "policies.json" in the distributions/ directory of the Firefox install path:

{
"policies": {
"Extensions": {
"Install": [
"https://addons.mozilla.org/firefox/downloads/latest/darkreader",
"https://addons.mozilla.org/firefox/downloads/latest/vimium-ff",
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin"
],
"Uninstall": [],
"Locked": []
}
}
}

  1. Run Firefox and view about:policies. The URLs show up under the Active tab. However, none of the extensions are ever installed, and in the Error tab it shows the following errors:

Policy Errors
Download failed - https://addons.mozilla.org/firefox/downloads/latest/ublock-origin
Download failed - https://addons.mozilla.org/firefox/downloads/latest/vimium-ff

  1. Create a new Firefox profile "firefox --new-instance -P"

  2. Observe that the extensions do actually install

  3. Add an extension to "policies.json" (this is in order to trigger Firefox to reload the policy)

  4. Restart Firefox with the new profile, go to about:policies, and notice that the same list of errors has appeared for every extension listed

Actual results:

Extensions will only be installed on the first run of Firefox on a fresh user profile. Otherwise there are errors in downloading the extensions.

Expected results:

Any change to policies.json should cause the new extensions to be installed successfully, without errors.

Component: Untriaged → Enterprise Policies

Any change to policies.json should cause the new extensions to be installed successfully, without errors.

Any change to the list of extensions will cause them to be reinstalled, but not to policies.json in general.

I get what your asking here.

Assignee: nobody → mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P1
Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/29b08c635a7c
If policy extension download fails, try again. r=Felipe
Flags: needinfo?(mozilla)

I'm at a loss. This passes locally and I clearly have a try catch around the await.

Flags: needinfo?(mozilla)
Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/d76eea893d56
If policy extension download fails, try again. r=Felipe

Argh. This went through chaos mode with no issues. I'll look more.

Flags: needinfo?(mozilla)
Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/c20b3ba913d9
If policy extension download fails, try again. r=Felipe
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68

Comment on attachment 9055251 [details]
Bug 1518663 - If policy extension download fails, try again.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Policy related
  • User impact if declined: If a policy to install an extension fails, that extension won't be installed again
  • Fix Landed on Version: 68
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Policy only, has automated test.
  • String or UUID changes made by this patch:
Attachment #9055251 - Flags: approval-mozilla-esr60?
Flags: qe-verify+

managed to reproduce the issue on Ubuntu 16.04 LTS, Nightly 64.0a1 (2018-10-01). It is not reproducible on Nightly 68.0a1 (2019-04-29), so I'll mark it as verified.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment on attachment 9055251 [details]
Bug 1518663 - If policy extension download fails, try again.

Fix for policy issue, verified in nightly.
OK for uplift for esr 60.7.

Attachment #9055251 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
You need to log in before you can comment on or make changes to this bug.