Open Bug 1957620 Opened 9 months ago Updated 8 months ago

Trying to install an unpacked webextension permanently raises a confusing "ERROR_FILE_ACCESS: There was an error accessing the filesystem." error

Categories

(Toolkit :: Add-ons Manager, defect, P3)

defect

Tracking

()

People

(Reporter: whimboo, Unassigned)

References

Details

Over on bug 1947678 I'm currently switching our WebDriver BiDi implementation from installing permanently to temporary by default. While doing that work I added more tests and now covered a scenario which is actually confusing.

When trying to install an unpacked webextension - that is not signed - in Firefox it fails as expected but the error message the AddonManager returns from the install.install() method is:

ERROR_FILE_ACCESS: There was an error accessing the filesystem

This is actually the error code -4 from:
https://searchfox.org/mozilla-central/source/toolkit/mozapps/extensions/AddonManager.sys.mjs#4030-4033

Not sure what might fail with the file system, but the overall issue is that the webextension is not signed. As such doesn't make the error code -5 (ERROR_SIGNEDSTATE_REQUIRED) more sense? At least for our users it would be pretty helpful.

Component: General → Add-ons Manager
Product: WebExtensions → Toolkit
Severity: -- → S4
Priority: -- → P3

Luca, as you asked recently in how to reproduce that scenario here are the steps. Just run the following webdriver test:

mach wpt --setpref="remote.log.truncate=false" --webdriver-arg=-vv testing/web-platform/mozilla/tests/webdriver/bidi/web_extension/moz_permanent.py

Note that you will have to build geckodriver first if you haven't done that yet.

The log output that can be seen is:

 0:15.70 pid:29231 1744713047538	RemoteAgent	DEBUG	WebDriverBiDiConnection e00d9e36-a288-495e-be65-3f80b7476d1c -> {"id":17,"method":"webExtension.install","params":{"extensionData":{"type":"path","path":"/Users/henrik/code/gecko/testing/web-platform/tests/webdriver/tests/support/webextensions/firefox/unpacked/"},"moz:permanent":true}}
 0:15.70 pid:29231 1744713047538	RemoteAgent	TRACE	Received command webExtension.install for destination ROOT
 0:15.70 pid:29231 1744713047540	RemoteAgent	DEBUG	WebDriverBiDiConnection e00d9e36-a288-495e-be65-3f80b7476d1c <- {"type":"error","id":17,"error":"invalid web extension","message":"Could not install Add-on: ERROR_FILE_ACCESS: There was an error accessing the filesystem.","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:199:5\nInvalidWebExtensionError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:485:5\ninstallAddon@chrome://remote/content/shared/Addon.sys.mjs:56:11\n"}
You need to log in before you can comment on or make changes to this bug.