keepassxc-browser icon indicating copy to clipboard operation
keepassxc-browser copied to clipboard

Browser Integration not operable on Firefox Ubuntu 21.10 (Snap)

Open Tony-Goat opened this issue 4 years ago • 28 comments

When trying to connect to the KeePassXC browser plugin to the database's browser integration, it should connect, however, it errors out with "Key Exchange failed." I believe the reason for this bug is Mozilla's request to move to Snap as the default starting with Ubuntu 21.10.

Debug info

KeePassXC - 2.6.6 Revision 9c108b9 KeePassXC-Browser - 1.7.9.1 Operating system: Ubuntu 21.10 amd64 Browser: Firefox 93.0

Tony-Goat avatar Oct 15 '21 05:10 Tony-Goat

You might be tempted to close this saying "We don't support snap installed browsers," however, it is not out of the question for Canonical and Mozilla to remove Firefox completely from the apt repositories in 22.04 or some later versions, and a workaround will be needed for this eventuality.

Tony-Goat avatar Oct 15 '21 05:10 Tony-Goat

Yup the workaround is Auto-Type. Every native messaging based plugin will be broken. This includes one's that talk to smart cards. Until the browser snap itself supports native messaging this is dead in the water.

droidmonkey avatar Oct 15 '21 09:10 droidmonkey

This discussion is very relevant: https://bugzilla.mozilla.org/show_bug.cgi?id=1621763

droidmonkey avatar Oct 15 '21 12:10 droidmonkey

Yup the workaround is Auto-Type. Every native messaging based plugin will be broken. This includes one's that talk to smart cards. Until the browser snap itself supports native messaging this is dead in the water.

I would so LOVE to have back auto-type. But that does not work on wayland (as far as I am aware?) so right now, on ubuntu 21.10, no option remains.

I moved firefox back to debian packages, but even there I can't connect KeePassXC right now (which used to work before the upgrade).

ccoenen avatar Oct 31 '21 14:10 ccoenen

I moved firefox back to debian packages, but even there I can't connect KeePassXC right now (which used to work before the upgrade).

i am not using the firefox-extention, but experienced similar with autotype - installed firefox deb-package in ubuntu 21.10, but keepassxc does not recognize any firefox-window. Autotype is not working and trying to add a window manual under auto-type does not list any open firefox-page. I tried same thing last night with Chrome and had no issue there with auto-type...

NEA1971 avatar Nov 06 '21 09:11 NEA1971

That may be because Firefox is running under wayland.

droidmonkey avatar Nov 06 '21 11:11 droidmonkey

For firefox, the lack of NativeMessaging support in the snap is being tracked by bugzilla bug #1661935, and there's a proposal for an XDG desktop portal to solve the case for both snaps and flatpaks.

oSoMoN avatar Dec 13 '21 21:12 oSoMoN

Is there any available work-around for now?

Thanks!

bouncinglime avatar Jan 04 '22 17:01 bouncinglime

@bouncinglime Use a browser that is not installed via Snap or Flatpak.

varjolintu avatar Jan 04 '22 17:01 varjolintu

@varjolintu I take it that means there is no workaround for using KeePassXC-browser with Firefox 93+ on Ubuntu 21.04+?

bouncinglime avatar Jan 04 '22 17:01 bouncinglime

@varjolintu I take it that means there is no workaround for using KeePassXC-browser with Firefox 93+ on Ubuntu 21.04+?

Just remove Snap Firefox (I believe it's snap remove firefox --purge) and then install Firefox from apt (sudo apt-get install firefox) and it will work fine

piotrek-k avatar Jan 04 '22 17:01 piotrek-k

@bouncinglime Use a browser that is not installed via Snap or Flatpak.

This is next to impossible. I tried that, but my ubuntu keeps converting my firefox over to snap.

ccoenen avatar Jan 04 '22 19:01 ccoenen

@bouncinglime Use a browser that is not installed via Snap or Flatpak.

This is next to impossible. I tried that, but my ubuntu keeps converting my firefox over to snap.

@ccoenen, I'm on Ubuntu 21.10. I removed snap and installed Firefox via apt. Currently installed Firefox is 95.0.1+build2-0ubuntu0.21.10.1

gyuris avatar Jan 04 '22 19:01 gyuris

@bouncinglime Use a browser that is not installed via Snap or Flatpak.

I do not have snap installed on my computer at all, so my Firefox has been installed via apt. KeePassXC-browser is still not working.

bouncinglime avatar Jan 24 '22 04:01 bouncinglime

@bouncinglime And you have checked the Native Messaging script locations and everything from Troubleshooting Guide?

varjolintu avatar Jan 24 '22 05:01 varjolintu

as a workaround I decided to download Firefox and run the binary from the folder https://www.mozilla.org/en-US/exp/firefox/new/

migrating my profile was also easy https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile

empinator avatar Mar 23 '22 06:03 empinator

Some people report on Reddit that Ubuntu has reinstalled the Snap version of Firefox on update. Make sure you are not running a Snap version.

varjolintu avatar Mar 23 '22 07:03 varjolintu

yup, this also happened on my machine, so I gave up: https://github.com/keepassxreboot/keepassxc-browser/issues/1426#issuecomment-1005090609

ccoenen avatar Mar 23 '22 07:03 ccoenen

If you need a work around for the meanwhile and you don't mind using the beta release of Firefox you can use the official Firefox Next PPA. The packages from this PPA still package Firefox as usual.

Since I upgraded my Ubuntu system from 21.10 to 22.04 which converted my existing Firefox install to snap, these are the steps I used:

  1. Add the PPA:
sudo add-apt-repository ppa:mozillateam/firefox-next
sudo apt-get update
  1. Verify you see the PPA beta release of Firefox available:
apt info firefox -a
  1. Remove the existing packages/snap:
sudo apt -y --purge remove firefox*
sudo snap remove firefox
  1. Pin the Firefox package to the PPA beta releases:
cat << EOF | sudo tee /etc/apt/preferences.d/firefox
Package: firefox*
Pin: origin ppa.launchpadcontent.net
Pin-Priority: 600
EOF
  1. Install the Firefox package and relevant locale (if required):
sudo apt -y install firefox firefox-locale-en

I didn't lose any data doing this but your mileage may vary so be careful (eg. take a backup of your Firefox profile).

gbe0 avatar Apr 09 '22 10:04 gbe0

Here is another description how to remove snap and install Firefox via deb for Ubuntu 22.04 Jammy: https://fostips.com/ubuntu-21-10-two-firefox-remove-snap/ It works for me.

gyuris avatar Apr 18 '22 11:04 gyuris

@bouncinglime And you have checked the Native Messaging script locations and everything from Troubleshooting Guide?

I had no idea this troubleshooting guide was available. I would definitely recommend that everyone having this issue check it out.

However! It did not solve my problem. Everything was correct per the guide.

Turns out I had apparmor running on Firefox. Check your own system by running sudo aa-status (more details here) and disable the profile for firefox if it's there. I'm using apparmor and firejail to keep Zoom isolated, so I didn't want to disable it entirely.

Both keepass and gnome extensions are now working in my firefox.

bouncinglime avatar Apr 18 '22 17:04 bouncinglime

Need to add apparmor and firejail on the browser and/or keepassxc to the troubleshooting guide

droidmonkey avatar Apr 18 '22 19:04 droidmonkey

Right now the information about Firefox installed as SNAP not working is scattered around github issues. Maybe it would be good to include a question in the FAQ (https://keepassxc.org/docs/#faq-browser) about this SNAP problem.

Also, by reading this issue, I got the impression that we can use KeepassXC Auto-type with Firefox installed as SNAP. Is that correct? Is there a tutorial for that?

dvictori avatar May 18 '22 11:05 dvictori

Read the keepassxc user guide

droidmonkey avatar May 18 '22 11:05 droidmonkey

Read the keepassxc user guide

Thanks, just found the info on Auto-type. I was looking at the Getting Started guide. Still, I believe it would be usefull to add an entry in the FAQ, mentioning the SNAP issue and that Auto-type should work

dvictori avatar May 18 '22 16:05 dvictori

It would also be great if there was a link to the Troubleshooting Guide from the FAQ as well as on the main GitHub page for this project.

bouncinglime avatar May 20 '22 16:05 bouncinglime

I had the same trouble. Fixed by excluding Firefox from apparmor profiles (or you can disable it at all, but I don't recommend to do this). Just move /etc/apparmor.d/usr.bin.filefox into /etc/apparmor.d/disabled and reboot. I think, it is possible to just add some rules into the profile to enable keepassxc-proxy to be executed, but I don't know how...

zhum avatar Jul 01 '22 08:07 zhum

According to Ubuntu, the Firefox Beta Snap packages should already work with KeePassXC-Browser. Haven't tested it myself yet though. https://www.omgubuntu.co.uk/2022/07/ubuntu-devs-fix-another-frustrating-firefox-snap-flaw

EDIT: Tested it with the latest Kubuntu, and it worked nicely.

varjolintu avatar Jul 29 '22 07:07 varjolintu

@varjolintu any additional steps were necessary? My Firefox (Snap, version 105.0.1) have never displayed that "allow to start WebExtension" prompt from omgubuntu link you've posted and KeePass plugin still doesn't connect to KeePass.

piotrek-k avatar Sep 25 '22 16:09 piotrek-k

@varjolintu any additional steps were necessary? My Firefox (Snap, version 105.0.1) have never displayed that "allow to start WebExtension" prompt from omgubuntu link you've posted and KeePass plugin still doesn't connect to KeePass.

Using the beta? I have no idea if the feature is in stable Firefox Snap.

varjolintu avatar Sep 25 '22 17:09 varjolintu