Firefox 122 update breaks webextensions permission

Bug #2051188 reported by Paul Rouget
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Unknown
firefox (Ubuntu)
Fix Released
High
Amin Bandali

Bug Description

We build webextensions for Firefox.

Since the latest update to Firefox 122, the native webextension bridge stopped working.

```
$ flatpak permission-show snap.firefox
Table Object App Permissions Data
desktop-used-apps application/vnd.debian.binary-package snap.firefox gnome-software-local-file,1,3 0x00
webextensions net.downloadhelper.coapp snap.firefox yes 0x00
```

This used to work and be enough, but not anymore.

In the logs I see:

```
Jan 25 12:47:56 ubuntu-linux-22-04-02-desktop firefox[154219]: OnGetManifestDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “GetManifest”
Jan 25 12:47:57 ubuntu-linux-22-04-02-desktop firefox_firefox.desktop[154219]: [Parent 154219, Main Thread] WARNING: OnGetManifestDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “GetManifest”: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187
```

Revision history for this message
In , Me+bz (me+bz) wrote :

Steps to reproduce:

- Update to Firefox 122 on Ubuntu
- Install Video DownloadHelper and its Companion App.
- In the settings of the addon, see that the Companion App is not recognized

The command:

```
$ flatpak permission-show snap.firefox
``

Shows that Firefox is allowed to read the manifest.

But it doesn't. The logs say:

```
Jan 25 12:47:56 ubuntu-linux-22-04-02-desktop firefox[154219]: OnGetManifestDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “GetManifest”
Jan 25 12:47:57 ubuntu-linux-22-04-02-desktop firefox_firefox.desktop[154219]: [Parent 154219, Main Thread] WARNING: OnGetManifestDone error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “GetManifest”: 'glib warning', file /build/firefox/parts/firefox/build/toolkit/xre/nsSigHandlers.cpp:187
```

Revision history for this message
In , Me+bz (me+bz) wrote :

launchpad bug: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2051188

@Sylvestre Can you see if you find anyone who could assist?

Revision history for this message
In , Me+bz (me+bz) wrote :

I'm working on the Video DownloadHelper extension (100_000+ Linux users, mostly Ubuntu), and the Snap sandbox has always been a problem, but that specific update made it worse. We're getting those bug reports since the yesterday.

Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

:me+bz, if you think that's a regression, could you try to find a regression range using for example [mozregression](https://wiki.mozilla.org/Auto-tools/Projects/Mozregression)?

Revision history for this message
In , Release-mgmt-account-bot (release-mgmt-account-bot) wrote :

The [Bugbug](https://github.com/mozilla/bugbug/) bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Revision history for this message
In , Me+bz (me+bz) wrote :

(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #3)
> :me+bz, if you think that's a regression, could you try to find a regression range using for example [mozregression](https://wiki.mozilla.org/Auto-tools/Projects/Mozregression)?

That's a little tricky because it's a snap-sandbox specific issue, and mozregression doesn't work with Snap: https://bugzilla.mozilla.org/show_bug.cgi?id=1763188

Revision history for this message
Paul Rouget (paulrouget) wrote :

Running:

snap run --shell firefox

I can access the native messaging JSON file, and run native messaging binary linked in the JSON file.

So it doesn't seem to be a sandboxing issue.

Revision history for this message
In , Me+bz (me+bz) wrote :

Created attachment 9376384
Screenshot 1 of the exception

Revision history for this message
In , Me+bz (me+bz) wrote :

I've attached the exception from the js console.

Revision history for this message
Paul Rouget (paulrouget) wrote :
Revision history for this message
In , Me+bz (me+bz) wrote :

More investigation: the code that's throwing comes from a patch by Canonical: https://github.com/canonical/firefox-snap/blob/stable/patches/native-messaging-portal.patch

Revision history for this message
Paul Rouget (paulrouget) wrote :
Revision history for this message
Paul Rouget (paulrouget) wrote :

And that's the call that creates the exception: https://github.com/canonical/firefox-snap/blob/7f87c2af624891313906abe7fdccfda1ad76a0f7/patches/native-messaging-portal.patch#L748

I know nothing about DBus and all. Any idea what is going wrong?

Revision history for this message
In , Me+bz (me+bz) wrote :
Revision history for this message
Paul Rouget (paulrouget) wrote :

Amin, I think your change is responsible for that regression.

The commit https://github.com/canonical/firefox-snap/commit/f1bf0d6dd649e13a1a9a159de63ae74068966c0c

Revision history for this message
Paul Rouget (paulrouget) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Revision history for this message
Amin Bandali (bandali) wrote :

Hi Paul,

Can you please confirm the Ubuntu release you're running? Is it Ubuntu 22.04 (jammy)?

affects: ubuntu-release-upgrader (Ubuntu) → firefox (Ubuntu)
Changed in firefox (Ubuntu):
assignee: nobody → Amin Bandali (bandali)
importance: Undecided → High
Revision history for this message
In , Sebastien Bacher (seb128) wrote :

Thanks for the bug report. The messaging portal patch is indeed part of the snap and not upstream at this point. The patch was refreshed to apply cleaning to 122 and rebased at the same time on the current phabricator version which made it use a new dbus method. We didn't notice that this method hadn't been backported to the Ubuntu 22.04 portal package. We are working now on reverting the patch to not depends on the new method.

Revision history for this message
In , Donal Meehan (dmeehan) wrote :

*** Bug 1876495 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Sledru (sledru) wrote :

Salut Paul, I hope you are doing great!
Thanks for the ping. We have been discussing with Canonical about it today (here and by email)

Revision history for this message
Paul Rouget (paulrouget) wrote :

Amin, it's 22.05.

Revision history for this message
Paul Rouget (paulrouget) wrote :

I meant 22.04.

Revision history for this message
Amin Bandali (bandali) wrote :

Thank you for confirming, Paul.

This happened because after the recent refresh of the native messaging patch shipped with the Firefox snap, it started using a newer 'GetManifest' DBus method from xdg-desktop-portal that hasn't yet been backported to the version of the portal available in Ubuntu 22.04. I sadly didn't catch this earlier because I did the development and testing work for this on Ubuntu 23.10 (which has an up-to-date portal package that does include the GetManifest method), and forgot to test it on Ubuntu 22.04.

I'm working to fix this ASAP by removing the use of GetManifest in the patch for the time being, until we get a newer version of xdg-desktop-portal backported to Ubuntu 22.04.

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Snegritas (snegritas) wrote :

Hello!
I have managed to reproduce the issue with firefox 122.0-2 on Ubuntu 22.04. I can confirm that the issue is fixed with firefox 122.0-2.1.
I would like to mention that there is still an error in the console when intalling the addon mentioned in the description, see attached screen shot
Updating the flags and the status of this bug.

Revision history for this message
In , Snegritas (snegritas) wrote :

Created attachment 9376642
Screenshot from 2024-01-26 14-52-14.png

Revision history for this message
In , Donal Meehan (dmeehan) wrote :

Marking this bug as resolved

Revision history for this message
In , Amin Bandali (bandali) wrote :

I've posted a quick post-mortem write up on the Ubuntu Discourse for folks who may be interested in reading what exactly happened:

[Firefox 122 snap temporary native messaging breakage for Ubuntu 22.04 users (fixed since)](https://discourse.ubuntu.com/t/firefox-122-snap-temporary-native-messaging-breakage-for-ubuntu-22-04-users-fixed-since/41940)

Revision history for this message
Amin Bandali (bandali) wrote :

Hi again Paul, (all,)

A new build of Firefox snap with version string "122.0-2.1" is now available on the 'stable' channel which includes fixed support for native messaging for Ubuntu 22.04 users. My apologies for any inconvenience this issue may have caused.

I've posted a quick post-mortem write up on the Ubuntu Discourse for folks who may be interested in reading what exactly happened:

https://discourse.ubuntu.com/t/firefox-122-snap-temporary-native-messaging-breakage-for-ubuntu-22-04-users-fixed-since/41940

Changed in firefox (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Paul Rouget (paulrouget) wrote :

Thanks for the quick fix! It's all working now.

Changed in firefox:
status: Confirmed → Fix Released
Revision history for this message
Paul Rouget (paulrouget) wrote :

@bandali - is it possible the update 123 re-introduced this issue? We're getting reports with the same error.

Revision history for this message
Amin Bandali (bandali) wrote :

Hi Paul, I don't think so? Yesterday I tested on Firefox 123 an extension that requires natives messaging to work, and it seemed to work just fine.

Could you please double-check that the issue is happening with Firefox 123, and if so, please provide more details including some logs, screenshots, and steps to reproduce the issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.