Closed Bug 1960285 Opened 8 days ago Closed 5 days ago

Generic "Extension is invalid" error without details when an invalid extension is launched by "web-ext run"

Categories

(WebExtensions :: Developer Tools, enhancement, P3)

enhancement

Tracking

(firefox139 fixed)

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

STR:

  1. Create an invalid extension. E.g. delete the first { of a manifest.json file, or put an empty directory in _locales/ (directory without messages.json are considered invalid).
  2. Use web-ext run on it.

Expected:

  • Useful error message.

Actual:

  • Generic non-actionable "Extension is invalid" message.

Example:

$ git clone https://github.com/mozilla/multi-account-containers
$ cd multi-account-containers
$ cd src/
$ git submodule init update --init
$ web-ext run
Running web extension from /tmp/multi-account-containers/src
Use --verbose or --devtools to see logging

WebExtError: installTemporaryAddon: Error: Error: Could not install add-on at '/tmp/multi-account-containers/src': Error: Extension is invalid

There is no more useful detail when running with --verbose either:

$ web-ext run --verbose
...
[/path/to/node_modules/web-ext/lib/firefox/index.js][debug] Firefox stdout: console.error: "Error while calling actor 'addons's method 'installTemporaryAddon'" "Could not install add-on at /tmp/multi-account-containers/src: Extension is invalid"
[/path/to/node_modules/web-ext/lib/firefox/index.js][debug] Firefox stdout: console.error: (new Error("Could not install add-on at /tmp/multi-account-containers/src: Extension is invalid", "resource://devtools/server/actors/addon/addons.js", 36))
[/path/to/node_modules/web-ext/lib/program.js][error]
WebExtError: installTemporaryAddon: Error: Error: Could not install add-on at /tmp/multi-account-containers/src: Extension is invalid

Examples of user reports from web-ext:
https://github.com/mozilla/web-ext/issues/1077
https://github.com/mozilla/web-ext/issues/1237
https://github.com/mozilla/web-ext/issues/1371

Considering the displayed serialization when run with web-ext run --verbose, I tried replacing the Error with an AggregateError at https://searchfox.org/mozilla-central/rev/4d00b50c42a788c51ac4c5fe92b684569ba6c3a5/devtools/server/actors/addon/addons.js#35 (to include additionalErrors from https://searchfox.org/mozilla-central/rev/4d00b50c42a788c51ac4c5fe92b684569ba6c3a5/toolkit/mozapps/extensions/internal/XPIInstall.sys.mjs#482-485)
... but that did not work because the toSource() serialization of AggregateError does not include the aggregated errors (bug 1960031).

See Also: → 1960031
Whiteboard: [addons-jira]
Assignee: nobody → rob
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P3
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/f778c68db304 Add details to "Extension is invalid" error r=rpl,devtools-reviewers,frontend-codestyle-reviewers,ochameau
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: