Closed Bug 1401744 Opened 7 years ago Closed 7 years ago

Opt-out Enrollment Study breaks about:addons after failsafe date

Categories

(Shield :: Shield Study, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: osmose, Assigned: osmose)

References

Details

The add-on used in bug 1394962 contains a failsafe that automatically uninstalls the study on startup if the local time is past Tuesday, September 12, 2017 12:00:00 AM. However, when that failsafe is executed, the following error is logged to the browser console:

1505942118428	Toolkit.Telemetry	ERROR	TelemetryEnvironment::_checkForChanges: Error collecting addons: TypeError: promiseCallProvider is not a function (resource://gre/modules/AddonManager.jsm:2513:32) JS Stack trace: getActiveAddons@AddonManager.jsm:2513:32 < async*getActiveAddons@AddonManager.jsm:3609:7 < _getActiveAddons@TelemetryEnvironment.jsm:655:27 < async*_updateAddons@TelemetryEnvironment.jsm:627:27 < async*_checkForChanges@TelemetryEnvironment.jsm:581:25 < _onAddonChange@TelemetryEnvironment.jsm:566:5 < onUninstalling@TelemetryEnvironment.jsm:561:5 < callAddonListeners@AddonManager.jsm:1667:11 < callAddonListeners@AddonManager.jsm:3162:5 < uninstallAddon@XPIProvider.jsm:4738:7 < uninstall@XPIProvider.jsm:5699:5 < removeAddon/</<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/mkelly/Library/Application%20Support/Firefox/Profiles/yy0fzwly.default-1477538586801/extensions/optout-nothing-study-addon@bootstrap.js:125:62 < safeCall@AddonManager.jsm:187:5 < makeSafe/<@AddonManager.jsm:202:25 < promise callback*promiseOrCallback@AddonManager.jsm:228:3 < getAddonByID@AddonManager.jsm:3578:12 < removeAddon/<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/mkelly/Library/Application%20Support/Firefox/Profiles/yy0fzwly.default-1477538586801/extensions/optout-nothing-study-addon@bootstrap.js:125:5 < removeAddon@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/mkelly/Library/Application%20Support/Firefox/Profiles/yy0fzwly.default-1477538586801/extensions/optout-nothing-study-addon@bootstrap.js:124:9 < async*startup@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/mkelly/Library/Application%20Support/Firefox/Profiles/yy0fzwly.default-1477538586801/extensions/optout-nothing-study-addon@bootstrap.js:24:11 < async*callBootstrapMethod@XPIProvider.jsm:4494:20 < startInstall/<@XPIInstall.jsm:1878:13 < async*startInstall@XPIInstall.jsm:1778:6 < install@XPIInstall.jsm:1450:7 < install@XPIInstall.jsm:2121:5 < checkForBlockers@XPIInstall.jsm:1736:5 < install@XPIInstall.jsm:1447:7 < install@XPIInstall.jsm:2121:5 < checkPrompt/<@XPIInstall.jsm:1711:7 < async*checkPrompt@XPIInstall.jsm:1691:6 < install@XPIInstall.jsm:1444:7 < install@XPIInstall.jsm:2121:5 < install@XPIInstall.jsm:2644:5 < startInstall@AddonManager.jsm:2062:5 < startInstall@AddonManager.jsm:2132:9 < installAddonFromWebpage@AddonManager.jsm:2139:9 < installAddonFromWebpage@AddonManager.jsm:3644:5 < handleUriInChrome/<@browser.js:1032:11 < safeCall@AddonManager.jsm:187:5 < makeSafe/<@AddonManager.jsm:202:25 < promise callback*promiseOrCallback@AddonManager.jsm:228:3 < getInstallForURL@AddonManager.jsm:3552:12 < handleUriInChrome@browser.js:1031:9 < _loadURIWithFlags@browser.js:1075:9 < loadURIWithFlags@tabbrowser.xml:8505:13 < openLinkIn@utilityOverlay.js:443:5 < openUILinkIn@utilityOverlay.js:207:3 < fpCallback_done@browser.js:2412:9  Log.jsm:752
TypeError: logger is undefined[Learn More]  AddonManager.jsm:229:5
TypeError: AddonManagerInternal is undefined[Learn More]

After this, about:addons will not load until the browser is restarted. The study add-on is still successfully uninstalled; after a browser restart, Firefox will behave normally.

It's unclear yet if this is only a problem with the enrollment study or with other Shield studies that are using the study utils.
The cause of the bug is these lines in the shutdown handler (they're only run when the add-on is being disabled or uninstalled):

Cu.unload('resource://gre/modules/Console.jsm');
Cu.unload('resource://gre/modules/AddonManager.jsm');
Cu.unload('resource://gre/modules/TelemetryEnvironment.jsm');

Unloading these modules while they're in use by other parts of the browser causes lots of weird issues, such as about:addons not being able to load properly. We shouldn't be unloading them from an add-on.

I cannot find any other studies that have this issue. The example study in the study utils library also does not have these lines: https://github.com/mozilla/shield-studies-addon-utils/blob/master/examples/stage-2-shield-study/addon/bootstrap.js

We don't intend to run this study again, and I don't think there is a repo for the enrollment study anyway, so I'm going to mark this as WONTFIX. I've filed https://github.com/mozilla/normandy/issues/1069 for adding the ability to disable extensions uploaded to Normandy, so that we can mark this extension as unusable.

I'm also going to send a an email to dev-shield to follow up on the requirements/standard test plans we should have in place for opt-out studies, as a way to address why we missed this bug in the first place.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.