Open Bug 1847377 Opened 2 years ago Updated 1 year ago

Firefox snap Native Messaging doesn't work for one user "Progressive Web Apps" extension, works for Firefox tarball or different user

Categories

(WebExtensions :: Untriaged, defect, P3)

Firefox 116
x86_64
Linux
defect

Tracking

(firefox116 affected)

Tracking Status
firefox116 --- affected

People

(Reporter: 52qtuqm9, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

I have three computers running Ubuntu Mantic x86_64. I am using the Firefox snap on all three computers. All three computers have all up-to-date debs and snaps. I've installed the "Progressive Web Apps for Firefox" extension in all three computers and the "firefoxpwa" deb provided by its author on all three computers as well.

On two of the three computers, the PWAs extension in the Firefox snap can talk to firefoxpwa via native messaging successfully, so the extension works just fine.

On the third computer, the extension in the snap can't talk to firefoxpwa. The sendNativeMessage call the extension makes is getting back an exception with the text "Error: An Unexpected error occurred". By installing a wrapper around the firefoxpwa connector I've confirmed that Firefox isn't invoking it at all before returning this error.

Other useful bits of info:

  • At least some other extensions that use native messaging, such as extensions.gnome.org, work fine on this computer.
  • If I download the Firefox tarball on this computer and use the PWAs extension in that instance of Firefox, it works.
  • If I create a new user account on the computer and use the PWAs extension in the Firefox snap in that new user account, it works.
  • If I create a new profile in Firefox's profile manager and attempt to use the PWAs extension in that profile, it does not work; it fails as described above.
  • In the "Ubuntu Software" app I checked the permissions for the Firefox snap and all of them are enabled.

I don't know what is different about this one user account on this one computer which is preventing native messaging from working properly for this one specific extension in the Firefox snap. I've collected all the info that I know how to collect to try to identify a cause, with no success.

Status: NEW → UNCONFIRMED
Ever confirmed: false

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Product: Firefox → WebExtensions

Hello,

I reproduced the issue on the latest Firefox snap (116.0.1/20230803170958) under Ubuntu 22.04 LTS.

I installed the extension from AMO and followed the on-screen instructions to install the firefoxpwa native messaging app. After installation, clicking the extension button opens the extension panel and an error pop-up is shown stating “An unexpected error occurred”. The add-on console also logs several “Uncaught (in promise) Error: An unexpected error occurred”.

Restarting the browser does not fix the issue. The same behavior as above is encountered.

For more details, see the attached screenshots.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Alex, please show the content of the global Browser Console.

I want to know if this is similar or different to bug 1843341.

Flags: needinfo?(acornestean)
See Also: → 1843341

I repeated the test on both the latest tarball Release and snap Release (116.0.2/20230805021307) and noticed something. Firstly, once the extensions is installed, a new tab opens with several instruction steps, including here a license agreement that the user must accept before continuing with the rest of the setup, the installation of the firefoxpwa messaging app, the installation of a runtime and a final “Ready” step where the user is informed that everything is set up and can close that page.

Below you can see the different results for both the tarball and snap versions.

In the case of the tarball Release, once the firefoxpwa app is installed, the steps automatically advance to the installation of the runtime and once this is done the “Ready” step is reached and the page can be closed. No errors are shown in the global Browser console, add-on console or in the add-on panel.

In the case of the snap Release, once the extension is installed and the tab with instructions opens, accepting the license agreement will advance to the step with installing firefoxpwa. One the app is installed, the setup does not advance to the next step (the runtime installation) and an error is displayed on the page (Error: An unexpected error occurred). The browser console constatnly logs a multitude of errors:

  • AbortError: Native application start canceled by user NativeMessaging.sys.mjs:178
    _doInitPortal resource://gre/modules/NativeMessaging.sys.mjs:178
    AsyncFunctionThrow self-hosted:856

  • AbortError: Native application start canceled by user ExtensionCommon.sys.mjs:812
    normalizeError resource://gre/modules/ExtensionCommon.sys.mjs:812
    wrapPromise resource://gre/modules/ExtensionCommon.sys.mjs:965

  • Error: An unexpected error occurred install.30313083.js:1:3138
    d moz-extension://52361f4b-d391-4e12-87e6-02657e856a65/setup/install.30313083.js:1

-NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsINativeMessagingPortal.closeSession] NativeMessaging.sys.mjs:361

These errors are also logged when opening the extension panel manually.

See attached screenshot for more details.

Flags: needinfo?(acornestean)

The severity field is not set for this bug.
:robwu, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(rob)

The error messages look comparable to bug 1843341.

Linking bugs and adding needinfo, similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1843341#c12

Flags: needinfo?(rob) → needinfo?(bandali)
See Also: → 1661935
Blocks: 1661935
See Also: 1661935
Blocks: snap
Severity: -- → S3
Priority: -- → P3

Is this still present?

Flags: needinfo?(bandali) → needinfo?(52qtuqm9)

I don't know I don't use the snap anymore.

Flags: needinfo?(52qtuqm9)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: