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

inconsitent connection to kp #1752

Closed
ZenMasta opened this issue Oct 25, 2022 · 9 comments
Closed

inconsitent connection to kp #1752

ZenMasta opened this issue Oct 25, 2022 · 9 comments

Comments

@ZenMasta
Copy link

##My issue and steps I'm doing to reproduce.
TLDR: The browser plugin fails to maintain a connection to kp. To the best of my abilities, I checked to make sure that the proxy was running and that the registry settings are intact.

The extension is inconsistent and almost prejudicial. And I say that because it seems that the most regular success I have is with github.
Most of the time, the icon in firefox is gray with the red x.
When I click it the icon and then reload, I would say that it works probably 99%% if I'm on git hub.
If I switch browser tabs, the icon will remain green, but as soon as I go to a page where login is required, the icon turns dark and I cannot seem to reload successfully.

One that I use frequently is www.convergepay.com/converge-webapp/#!/login
However, just this morning I was able to log in to that page several times.

Now, this isn't to say that reloading never works on other sites. But most of the time it just doesn't. And the most consistent behavior I get is after clicking reload, it will say "KeePassXC-Browser is connected to KeePassXC and has been configured using the following identifier: Work PC" but the icon will remain dark. and if I click the gray icon, it will offer me the option to reload again.

I have dual monitors and sometimes have kp active on the other while my browser is on the primary. One thing that I have noticed, is if the browser extension successfully reloads, it minimizes kp. And as I'm typing this I was testing other things. It seems anytime I go to a tab with logins (for when the connection persists) it will minimize kp if it's open on the other screen.

I don't really expect that to be relevant, but just in case, I'm mentioning it.

Debug info

The console doesn't record anything new when trying to use the reload button
KeePassXC - 2.7.3
KeePassXC-Browser - 1.8.3
Operating system: Win64
Browser: Mozilla Firefox 106.0

@varjolintu
Copy link
Member

Duplicate of #1751.

@varjolintu varjolintu closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
@vanous
Copy link

vanous commented Nov 12, 2022

Hi,

long time user, thank you so much for your work.

While 2.7.4 fixed the connection issue which was more of "cannot connect at all" nature, with 2.7.4 i now get frequent random disconnections. Sometimes it helps to restart Firefox, sometimes it helps to restart KPXC, sometimes i have to restart both.

I just want to report this, as prior to 2.7.3, the connection was rock solid. Now with 2.7.4, it generally works, but the browser extension can get disconnected from the KPXC at any time.

Thank you again for making the password experience much better for all of us.

Firefox 106.0.5 (64-bit)
KeePassXC-Browser 1.8.3.1
Debian GNU Linux
KeePassXC 2.7.4

@varjolintu
Copy link
Member

@vanous This new addition to the Troubleshooting Guide might be worth checking: https://github.com/keepassxreboot/keepassxc-browser/wiki/Troubleshooting-guide#linux-check-unix-domain-socket-path

You can also check if keepassxc-proxy is still running when the disconnect happens.

@vanous
Copy link

vanous commented Nov 13, 2022

@varjolintu thank you.

Tested now. Firefox has been running for about a day, KPXC not running, starting it new... i get "cannot connect" from the browser extension, which means that most likely Firefox needs to be restarted. First, let me check the socket files... to me, the socket files seem to be ok:

vanous@debthinkpad:~$ ls -la /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
srwx------ 1 vanous vanous 0 Nov 13 09:30 /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
vanous@debthinkpad:~$ ls -la /run/user/1000/org.keepassxc.KeePassXC.BrowserServer
lrwxrwxrwx 1 vanous vanous 80 Nov 13 09:33 /run/user/1000/org.keepassxc.KeePassXC.BrowserServer -> /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer

And inspecting extension no connection when looking at the Inspect in about:debugging in FF:

KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser [client.js:317:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/background/client.js)
[Error ] KeePassXC-Browser - 9: Key exchange was not successful. [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
[Error ] KeePassXC-Browser - Cannot send activated_tab message: Could not establish connection. Receiving end does not exist. 3 [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
[Error keepass.js:270] KeePassXC-Browser - 4: Cannot decrypt message [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser [client.js:317:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/background/client.js)
[Error keepass.js:753] KeePassXC-Browser - 9: Key exchange was not successful. [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
[Error keepass.js:440] KeePassXC-Browser - No content script available for this tab. [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)

After restarting Firefox:

[Error keepass.js:270] KeePassXC-Browser - 5: Cannot connect to KeePassXC. Check that browser integration is enabled in KeePassXC settings. 2 [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser [client.js:317:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/background/client.js)
[Error keepass.js:753] KeePassXC-Browser - 9: Key exchange was not successful. [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
[Error init.js:66] KeePassXC-Browser - Cannot send activated_tab message: Could not establish connection. Receiving end does not exist.

rechecking the socket files:

vanous@debthinkpad:~$ ls -la /run/user/1000/org.keepassxc.KeePassXC.BrowserServer
lrwxrwxrwx 1 vanous vanous 80 Nov 13 09:42 /run/user/1000/org.keepassxc.KeePassXC.BrowserServer -> /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
vanous@debthinkpad:~$ ls -la /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
srwx------ 1 vanous vanous 0 Nov 13 09:30 /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
vanous@debthinkpad:~$

Restarted KPXC, still no luck:

KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser [client.js:317:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/background/client.js)
[Error keepass.js:753] KeePassXC-Browser - 9: Key exchange was not successful. [global.js:178:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/common/global.js)
KeePassXC-Browser: Connecting to native messaging host org.keepassxc.keepassxc_browser [client.js:317:13](moz-extension://042c6fa7-2e22-479c-a76d-c6feceb41d52/background/client.js)
[Error keepass.js:753] KeePassXC-Browser - 9: Key exchange was not successful.
ls -la ~/.mozilla/native-messaging-hosts
-rw-rw-r-- 1 vanous vanous  295 Nov 13 09:43 org.keepassxc.keepassxc_browser.json
{
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ],
    "description": "KeePassXC integration with native messaging support",
    "name": "org.keepassxc.keepassxc_browser",
    "path": "/home/vanous/Applications/KeePassXC-2.7.4-x86_64.AppImage",
    "type": "stdio"
}
vanous@debthinkpad:~/.mozilla/native-messaging-hosts$ ps ax | grep keepassxc-proxy
 193759 ?        Sl     0:00 keepassxc-proxy /home/vanous/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json keepassxc-browser@keepassxc.org

Anything else i can try? Thank you very much.

I will try to reboot....

@varjolintu
Copy link
Member

Could it be something related to Firejail, AppArmor etc?
You could try to search similar issues: https://github.com/keepassxreboot/keepassxc-browser/issues?q=is%3Aissue+is%3Aopen+firejail

@vanous
Copy link

vanous commented Nov 13, 2022

Thank you. No matter what i try, the connection is very unstable and sometimes even cannot be re-established at all without full reboot. I also tried to change from Wayland to X11 to no avail. Downgrading to 2.7.1 and relevant extension version seems to solve it 100%. Stability is super critical for me, so i will try next releases to see if things get improved, because over time, security and browser compatibility will of course be an issue. The main reason for my original comment was that you are aware that this update has something that makes it unstable for some people.
KP has been really great and i have been super happy, saving me time many times a day, thank you!

@varjolintu
Copy link
Member

@vanous Please check this thread too if it helps: #1772. Of course you can keep using 2.7.1 until it's clear where the issue is.

@vanous
Copy link

vanous commented Nov 13, 2022

Yes... i have read it, but i am not using firejail. I have apparmor disabled for ff too...

@vanous
Copy link

vanous commented Nov 13, 2022

To be precise - my Debian system didn't have an apparmor profile, i understood that this means apparmor is not enabled for firefox then, but maybe i was wrong. I now created a profile for ff and have explicitly made ff disabled. I will observe the result, but it already seems better. I suspect that this is really the issue. I will try solutions mentioned here: keepassxreboot/keepassxc#3096 (comment) when i have more time again.

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

No branches or pull requests

3 participants