Closed Bug 1930119 Opened 13 days ago Closed 10 days ago

133 firefox snap breaks native messaging: webextension keepassxc-proxy

Categories

(WebExtensions :: General, defect, P1)

Firefox 133
defect

Tracking

(firefox-esr115 unaffected, firefox-esr128 unaffected, firefox132 unaffected, firefox133 verified, firefox134 verified)

VERIFIED FIXED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox132 --- unaffected
firefox133 --- verified
firefox134 --- verified

People

(Reporter: arvid.jasper, Assigned: robwu)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [addons-jira])

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0

Steps to reproduce:

firefox snap and keepassxc worked for me in Ubuntu 22.04 after initialising webextensions.
Addon integration broke now when upgrading to 24.04 and therefore Firefox 133.0b2 64bit snap for Ubuntu canonical-002 - 1.0.
When pushing the button "reload" in the keepassxc addon or "connect to database" in its settings, nothing happens on the front end.
Last successful connection to the database by keepassxc-browser was before my OS upgrade.

The configuration path in keepassxc settings > broswer integration > advanced correctly points to my current snap:
~/snap/firefox/common/.mozilla/firefox/n80h6q6h.default/native-messaging-hosts/

App Armor is not denying traffic.
All other extensions have been temporarily disabled with no effect.
flatpak permissions webextensions is correctly initialized via terminal:
webextensions org.keepassxc.keepassxc_browser snap.firefox yes 0x00

I am using:

KeePassXC-Browser - 1.9.4

KeePassXC - Version 2.7.9
Revision: 8f6dd13
Qt 5.15.13
OS: Ubuntu 24.04.1 LTS
CPU architecture: x86_64
kernel: linux 6.8.0-48-generic

Actual results:

Firefox snap's console is giving following error when trying to connect to the keepassxc database by pushing the respective buttons:

File at path "/usr/bin/keepassxc-proxy" does not exist, or is not executable 2 Subprocess.sys.mjs:141:21
call resource://gre/modules/Subprocess.sys.mjs:141

keepassxc-proxy is existent though, and also flagged as executable. Might the file permissions make a difference here? Though root:root seems legit to me for bin files.

Firefox addon shows key exchange not successful.

Meanwhile MOZ_LOG=NativeMessagingPortal:5 snap run firefox returns with every button push:
D/NativeMessagingPortal will not be used

Expected results:

KeepassXC browser addon should successfully start keepassxc-proxy and be able to communicate to keepassxc.
Their native messaging communication should work flawlessly so keepassxc-browser can access the keepassxc database and fill out passwords online.

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 Nightly Snap (134.0a1/20241111072227 canonical-002) and Beta Snap (133.0b6/20241111023715 canonical-002) under Ubuntu 24.04 LTS.

On these versions clicking the “Reload” button in the add-on panel or “Connect to database” in the add-on settings does not connect the add-on to the KeePassXC app.

I also checked Release Snap (132.0.1/20241104170534 canonical-002) but on this version the KeePassXC-Browser add-on can connect to the KeePassXC app and access the database.

Status: UNCONFIRMED → NEW
Ever confirmed: true

If you visit about:config and set widget.use-xdg-desktop-portal.native-messaging to 2, does the issue resolve?

I think that this may be a regression from https://github.com/canonical/firefox-snap/pull/98

Component: Untriaged → General
Keywords: regression
Regressed by: 1927642

Bugs like this stress the need for end-to-end testing... There is currently no test that verifies that the system as a whole works as desired. That is tracked at bug 1928096.

See Also: → 1928096

A similar patch (that flipped the pref) also landed on nightly: bug 1925154 (https://github.com/canonical/firefox-snap/pull/95)

Canonical was originally using a patch that diverged from the upstream patch, and it looks like their original did not have the widget.use-xdg-desktop-portal.native-messaging pref.

Regressed by: 1925154

The original source of the patch is bug 1661935. We are currently working on getting the patch ready to land in Firefox itself.

See Also: → 1661935

From the risk management perspective, I think that the patch on Beta should be reverted, and be fixed up by solving the (trivial) merge conflict in linux_unittest.py. While the patch diverges from upstream, it has proved to work for a long while.

And maybe similarly for Nightly.

Ultimately, when the upstream (i.e. Firefox) patch at bug 1661935 lands, the downstream patch (in the snap repo) can be dropped.

Flags: needinfo?(lissyx+mozillians)

Can confirm that setting widget.use-xdg-desktop-portal.native-messaging to 2 in about:config does solve the connection issue between the add-on and the app.

Tested on Nightly Snap (134.0a1/20241111072227 canonical-002) and Beta Snap (133.0b6/20241111023715 canonical-002).

Workaround works here as well (Firefox 133.0b2 (64bit)).
Thanks!

(In reply to Rob Wu [:robwu] from comment #7)

From the risk management perspective, I think that the patch on Beta should be reverted, and be fixed up by solving the (trivial) merge conflict in linux_unittest.py. While the patch diverges from upstream, it has proved to work for a long while.

And maybe similarly for Nightly.

Ultimately, when the upstream (i.e. Firefox) patch at bug 1661935 lands, the downstream patch (in the snap repo) can be dropped.

Unfortunately, i cannot deal with that

Flags: needinfo?(lissyx+mozillians)

Since setting the pref to 2 has confirmed the fix, I'm going to just flip the default pref instead of reverting everything.

Assignee: nobody → rob
Status: NEW → ASSIGNED
Whiteboard: [addons-jira]
Blocks: snap
Severity: -- → S4
Priority: -- → P1

(In reply to Rob Wu [:robwu] from comment #11)

These patches have been merged, but a build still needs to be created
According to https://launchpad.net/~mozilla-snaps/firefox/+snap/firefox-snap-beta the build is pending. It will be released as Firefox Beta 133.0b7-1:

I found the Nightly build at https://launchpad.net/~mozilla-snaps/firefox/+snap/firefox-snap-nightly
... but it is currently not building a Nightly with the patch included yet.

I'm marking this as FIXED because the patch has been merged and the build is underway.
To verify this bug, try to look tomorrow for the latest Firefox Beta and Nightly builds on Ubuntu.

Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED

Verified as Fixed. Tested on the latest Snap versions of Nightly (134.0a1/20241112041042 canonical-002 - 1.0) and Beta (133.0b7/20241111165312 canonical-002 - 1.0) on Ubuntu 24.04 LTS.

On both versions the widget.use-xdg-desktop-portal.native-messaging pref is set to 2 by default and the KeePassXC-Browser add-on can connect to the KeePassXC app without issues.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.