web-ext run -f nightly cannot start Nightly 116 with add-ons
Categories
(WebExtensions :: General, defect, P1)
Tracking
(firefox-esr102 unaffected, firefox114 unaffected, firefox115 fixed, firefox116 fixed)
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox114 | --- | unaffected |
firefox115 | --- | fixed |
firefox116 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(3 files, 2 obsolete files)
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
Original report at https://github.com/mozilla/web-ext/issues/2780; I confirmed that this is happening.
After starting Firefox Nightly 116 (latest version, buildid 20230607033033), I get web-ext run -f nightly
Error: Could not install add-on at '/private/tmp/shared-worker-port': [Exception... "AddonManager is not initialized" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://gre/modules/AddonManager.sys.mjs :: installTemporaryAddon :: line 2658" data: no]
Assignee | ||
Comment 1•2 years ago
|
||
mozregression output:
5:21.62 INFO: Last good revision: 81afd61afe48ea4877eff969a6eda908bcf79231
5:21.62 INFO: First bad revision: 8a4b7b46101dab1ab91d388939059d21319cd034
5:21.62 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=81afd61afe48ea4877eff969a6eda908bcf79231&tochange=8a4b7b46101dab1ab91d388939059d21319cd034
So rewriting one of the imports has resulted in this bug.
Assignee | ||
Comment 2•2 years ago
|
||
Note that the regression is associated with the commit that changed the imports from .jsm to .sys.mjs: https://hg.mozilla.org/integration/autoland/rev/8a4b7b46101dab1ab91d388939059d21319cd034
( not the preceding one that rewrote the file itself from .jsm to .sys.mjs )
Assignee | ||
Comment 3•2 years ago
|
||
Strange, the issue goes away upon reverting the ESM to JSM import at https://searchfox.org/mozilla-central/diff/3c0c3a26765c1c4143f23dd52afa66caf749158b/devtools/server/actors/addon/addons.js#11-14
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
I have manually verified that the above fixes the issue; I'm trying to reproduce the issue in a unit test, but want to already get the fix out without being blocked on the unit test.
Assignee | ||
Comment 5•2 years ago
|
||
Importing JSM as before, instead of ESM fixes the regression.
This effectively reverts the changes in devtools/ starting from
https://hg.mozilla.org/mozilla-central/rev/8a4b7b46101d#l43.1
This commit may be reverted again when the root cause has been
addressed, in bug 1837245.
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
test_webext_apis.js was not realistic because it did not use a dedicated
loader like DevToolsStartup. That prevented the test from catching the
regression. This patch fixes that by replicating the logic at
https://searchfox.org/mozilla-central/rev/aec3a901e6f6b3041b5ec457c9111a042cef1fb1/devtools/startup/DevToolsStartup.sys.mjs#1075-1101
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
The WebExtensionDescriptorActor loaded extension modules with the
dedicated devtools loader, which returns a different instance than
the real module in the browser. Besides the code not being designed to
be loaded twice in the same browser instance, this has the following
devtools-protocol-observable consequences:
- Uninitialized AddonManager -> Unable to detect addon updates/uninstalls.
- Detached ExtensionParent -> Unable to observe the actual extension,
including not seeing extension state such as warnings.
Assignee | ||
Comment 8•2 years ago
|
||
Extension modules are singletons and must never be loaded through the
dedicated DevTools loader. This happens when --start-debugger-server is
used.
These files in question are primarily designed to support the Firefox
devtools, so I haven't created separate unit tests for these cases.
The kind of problem associated with this import pattern has been covered
by other patches in this bug.
Updated•2 years ago
|
Comment hidden (obsolete) |
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Comment 12•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8f0425e45173
https://hg.mozilla.org/mozilla-central/rev/a8aefc39fedd
https://hg.mozilla.org/mozilla-central/rev/54b03590d32a
Assignee | ||
Comment 13•2 years ago
|
||
Comment on attachment 9337932 [details]
Bug 1837185 - Use realistic loader in test_webext_apis.js
Beta/Release Uplift Approval Request
- User impact if declined: Users cannot install add-ons through remote debugging / web-ext.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Targeted fix in devtools/, to effectively revert to the behavior before the regression without side effects. Problem is well-understood and covered by automated tests. I have also verified the behavior manually before landing the patch.
- String changes made/needed: none
- Is Android affected?: Unknown
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 14•2 years ago
|
||
Comment on attachment 9337932 [details]
Bug 1837185 - Use realistic loader in test_webext_apis.js
Approved for 115.0b4.
Comment 15•2 years ago
|
||
Comment on attachment 9337994 [details]
Bug 1837185 - Correct loader for extension imports in WebExtension descriptor +tests
Approved for 115.0b4.
Comment 16•2 years ago
|
||
Comment on attachment 9337995 [details]
Bug 1837185 - Correct remaining extension imports in devtools modules
Approved for 115.0b4.
Comment 17•2 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/10aa949f3b16
https://hg.mozilla.org/releases/mozilla-beta/rev/378711852278
https://hg.mozilla.org/releases/mozilla-beta/rev/2f27f8b0f598
Description
•