Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to database in chromium installed via snap on ubuntu #1823

Closed
EHJ-52n opened this issue Jan 12, 2023 · 8 comments
Closed

Cannot connect to database in chromium installed via snap on ubuntu #1823

EHJ-52n opened this issue Jan 12, 2023 · 8 comments

Comments

@EHJ-52n
Copy link

EHJ-52n commented Jan 12, 2023

Expected Behavior

I installed the extension and tried to connect it to my database.
I expect to connect to my open database when clicking on "Reload" on the extension pop-up or "Connect" on the "Connected Databases" tab in the settings page.

Current Behavior

I receive the error message "Key exchange was not successful." when clicking on "Reload".

"Cannot connect to KeePassXC. Check that browser integration is enabled in KeePassXC settings." is displayed when clicking on the extension icon.

I can connect and use the extension within firefox, hence the keepassxc application is working correctly.

I tried to use the advanced configuration and configured two different locations, so I tested three different configurations:

  1. default
  2. advanced with path ~/snap/chromium/common/chromium/NativeMessagingHosts
  3. advanced with path ~/.config/chromium/NativeMessagingHosts

Possible Solution

none

Steps to Reproduce (for bugs)

  1. Open keepassxc and activate the browser integration in the settings
    Select the browsers: Google Chrome, Firefox, Tor Browser, Chromium
    On the General tab, select "Request to unlock the database if it is locked", "Match URL scheme", "Allow returning expired credentials", "Search in all opened databases".
    On the "Advanced" tab, select "Return advanced string fields which start with 2KPH:", "Update native messaging manifest files at startup". Optinally select "Use a custom browser configuration location" with "Browser type" "Chromium".
  2. Open chromium browser and install the latest extension version from https://chrome.google.com/webstore/detail/keepassxc-browser/oboonakemofpalcgghocfoadofidjkkk.
  3. Click the extension icon and click on "Reload".

Debug info

  • Versions

    • KeePassXC: 2.7.4
    • KeePassXC-Browser: 1.8.4
    • Operating system: Ubuntu 22.04.1 LTS
    • Browser: Chromium 108.0.5359.124 snap
  • From KeePassXC-Browser:

    KeePassXC - unknown
    KeePassXC-Browser - 1.8.4
    Operating system: Linux x86_64
    Browser: Chrome/Chromium 108.0.0.0
    

In the debug mode, I received the following error messages:

[Error keepass.js:887] KeePassXC-Browser - No content script available for this tab.                                                        global.js:177
[Error keepass.js:437] KeePassXC-Browser - 9: Key exchange was not successful.                                                              global.js:177
[Error keepass.js:887] KeePassXC-Browser - No content script available for this tab.                                                        global.js:177
[Error keepass.js:333] KeePassXC-Browser - 5: Cannot connect to KeePassXC. Check that browser integration is enabled in KeePassXC settings. client.js:317
KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser                                                      global.js:177
[Error client.js:337] KeePassXC-Browser - Failed to connect: Specified native messaging host not found.                                     global.js:177 
[Error keepass.js:887] KeePassXC-Browser - No content script available for this tab.                                                        global.js:177
[Error keepass.js:437] KeePassXC-Browser - 9: Key exchange was not successful.                                                              global.js:177
[Error keepass.js:887] KeePassXC-Browser - No content script available for this tab.                                                        global.js:177
[Error page.js:233] KeePassXC-Browser - Cannot send activated_tab message: Could not establish connection. Receiving end does not exist.

Please tell me, if you need any additional information.

And thank you very much for your time and providing KeePassXC!

@varjolintu
Copy link
Member

Possible duplicate of #1426. This is entirely Snap's fault. There's nothing we can do about it.

@varjolintu varjolintu closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2023
@EHJ-52n
Copy link
Author

EHJ-52n commented Jan 16, 2023

It is not a duplicate of #1426 because for firefox it is working as I mentioned. I installed both browsers using snap:

~ snap list | head -n1; snap list | egrep -e "chromium|firefox"
Name                            Version                     Rev    Tracking         Publisher       Notes
chromium                        109.0.5414.74               2271   latest/stable    canonical**     -
firefox                         108.0.2-1                   2263   latest/stable    mozilla**       -

Hence, there is a way to get this running in the context of snap. I am unsure, if this something keepassxc or chromium developers have to deal with.

@varjolintu
Copy link
Member

@EHJ-52n I've only heard that Firefox Snap works with Native Messaging. I have no idea if Chromium behaves the same.

@droidmonkey
Copy link
Member

It is not available for chromium or chrome yet, so the behavior is entirely expected.

@EHJ-52n
Copy link
Author

EHJ-52n commented Jan 23, 2023

I can confirm that switching to Linux Mint driven chromium solves this issue for me.

@scheriam
Copy link

I face the same issue, but only on a freshly setup machine with Ubuntu 22.10. I have another machine with Ubuntu 22.10 that I used for several years now and updated Ubuntu there over and over again to get to the current version. There the Chromium Snap worked with .deb KeepassXC even before the Firefox Snap problem was fixed, and still is working. I would like to find out the differences on the two machines, but had no luck so far.

Maybe you can guide me where specifically I could try to spot the differences on the two machines?
So to start, I have the same version of Chromium snap on both machines (112.0.5615.49 (Official Build) snap (64-bit)), I have the same version of KeepassXC on both machines (Version 2.6.6, Revision: 9c108b9) and I have the same version of the KeepassXC browser extension (id=oboonakemofpalcgghocfoadofidjkkk, Version 1.8.6.1)

@droidmonkey
Copy link
Member

droidmonkey commented Apr 15, 2023

To my understanding the chromium snap still doesn't have support for native messaging. Double check that the working box actually has chromium snap installed and not chromium native. Also make sure you are actually running the snap even if it is installed. You might still be running the native version (both installed at same time).

@scheriam
Copy link

@droidmonkey thx for the hint, I investigated further: I did not install a non-snap version to the working box, but I did an ugly hack to start the version that is installed via the Snap Store without the snap environment (simple symlink to the binary inside). I don't know what exact steps I took that it works, because when I try to reproduce it on the new machine, Chromium behaves super weird, far from a working state. And of course when I start the snap in the intended way, the KeePassXC plugin stops working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants