Keepassxc-browser: Save Credentials stopped working

Created on 20 Jun 2018  路  52Comments  路  Source: keepassxreboot/keepassxc-browser

Expected Behavior

Enter username and password into credential fields. Right click field -> KeepassXC Browser -> Save credentials. Extension icon starts blinking red. Shows options add or update when clicked.

Current Behavior

Enter username and password into credential fields. Right click fields -> KeepassXC Browser -> Save credentials. Nothing happens.

Debug info

KeePassXC - 2.3.3
keepassxc-browser - 1.1.7
Operating system: Linux (Fedora 27)
Browser: Chrome/Firefox/Vivaldi/Chromium
Proxy used: YES

PR pending bug

Most helpful comment

@herexf The site you added to ignore list has not a valid match pattern (I need to fix this parsing myself), so add / to the end of the URL and try again.

All 52 comments

Cannot reproduce this. Is your database open when you do this?

I can confirm this behaviour on Firefox Nightly 62.0a1 for a while now, both on Windows and Linux, the database is open.
Instead it's working fine for me on Firefox Stable 60.0.2 and all versions of Chrome, so not sure what the causes of this bug might be.

Here Firefox and Chromium stable works too. It might be an issue in the Firefox Nightly. Often there are internal API changes that might break something.

I have this issue in vivaldi, chromium and firefox stable. Not sure how to debug this. Any ideas?

@cogliostro This works with Chrome: go to the page you have the problem, right click mouse and select Inspect, and select debugging tab. keepassxc-browser.js should open. In cipForm.onSubmit() function is the one that should trigger the popup in the last line.

You should set a breakpoint to https://github.com/keepassxreboot/keepassxc-browser/blob/develop/keepassxc-browser/keepassxc-browser.js#L548.

Please note that AJAX form submits cannot be properly detected, so if it doesn't work for a certain site, that might be the case.

Workaround from #184 works.

Can confirm this behaviour on firefox-nightly 62.0a1.20180624 , keepassxc plugin version 1.1.7, arch linux, the database is open.

I can see the blinking icon, but it doesn't do anything, no matter how many times I click on it. I never see the option to save credentials in the database.

@motherload No need to write to two different issues. The workaround did not work for you? Can you debug the extension?

I've got the same behaviour. Context menu 'Save credentials' does nothing and there is also no prompt on updated credentials being sent.

Ubuntu 18.04 with KDE
Firefox 60.0.2 (64-bit)
KeepassXC 2.3.3 from PPA
keepassxc-browser 1.1.7

The workaround with the ignored sites did work for me. But only after I removed the entry from the list again. With the entry on the list the add-on did nothing anymore. Not even fill normal fields.

https://github.com/keepassxreboot/keepassxc-browser/pull/207 should fix this. Wait for the new release.

As I cannot reproduce the problem, only some additional debugging information will help.

@varjolintu sorry. By the way, I now upgraded to firefox-nightly 63, and the behavior hasn't changed. Still get blinking icon, but it won't save the credentials in the database. The "add to ignore list" workaround seems to have absolutely no effect in any way.

I can try to debug it, but not sure how to. Can you give me any pointers? I followed the wiki instructions, but I see no errors. Although, in firefox's about:debugging, I see the following message

Reading manifest: Error processing version_name: An unexpected property was found in the WebExtension manifest.

but that doesn't seem to be critical.

I disabled all other extensions and firefox built-in no tracking options, but the problem persisted. Although, this time I got some different error messages in the debug console

Error: "Promised response from onMessage listener went out of scope"
moz-extension://926959ea-40ac-4ef6-8042-f2871e79e8dd/background/init.js:84:1 keepassxc-browser.js:1429:17

and

Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://926959ea-40ac-4ef6-8042-f2871e79e8dd/browser-polyfill.min.js
Source Map URL: browser-polyfill.min.js.map[Learn More]

If I have the credentials for a website saved in the database, keepass extension inputs sucessfully both username and password fields. Even in these cases, the former error message seems to show up in every website, and maybe isn't critical.

The latter error message seems to appear only on the websites that do not have credentials saved in the database.

@motherload Use the Inspector / Web Developer on the web page the error can be seen. On the debugging tab you can select Extensions from the left panel. keepassxc-browser.js is the source file for the content script.

The Web Developer console should show an error if there's a problem.

Same here

Context menu 'Save credentials' does nothing, no blinking, no any pop up messages.

All latest versions.
KeePassXC-Browser Version: 1.1.7
KeePassXC Version: 2.3.3

@herexf Does the workaround help? It was linked earlier in this thread.

@varjolintu

Sorry, I didn't find any solutions, the icon didn't blink and no window or dialog pop up.
But it works well for detecting the credentials. Just nothing happens for new website or changed credentials.
Thanks

@varjolintu

I tried another laptop which running win 10 pro and latest Chrome x64 and got same issue, nothing happened and no message or windows/dialog pop up.

Probably because I have created the database from keepass 2? Not new database created by keepassxc directly.

@herexf That shouldn't affect if the database is created from another application.

Thanks, then I don't know the reason now.... it's a little bit annoying.

Google Smart Lock will pop up automatically when I change the credentials or detect new credentials for new website.

Below is my log in console when I click submit button and save credentials in context menu, hope this helps a little.

/////LOGS//////

browserAction.js:209 Uncaught (in promise) TypeError: settings.ignoredSites is not iterable
    at browserAction.js:209
(anonymous) @ browserAction.js:209
Promise.then (async)
browserAction.setRememberPopup @ browserAction.js:205
keepass.isConfigured.then @ event.js:222
Promise.then (async)
keepass.testAssociation @ event.js:220
keepass.getDatabaseHash @ keepass.js:436
keepass.sendNativeMessage.then @ keepass.js:573
Promise.then (async)
keepass.getDatabaseHash @ keepass.js:550
keepass.testAssociation @ keepass.js:424
kpxcEvent.onSetRememberPopup @ event.js:218
browser.tabs.get.then @ event.js:72
Promise.then (async)
kpxcEvent.invoke @ event.js:46
kpxcEvent.onMessage @ event.js:13
(anonymous) @ browser-polyfill.min.js:1
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
EventImpl.dispatch @ extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ extensions::utils:138
messageListener @ extensions::messaging:240
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
EventImpl.dispatch @ extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ extensions::utils:138
dispatchOnMessage @ extensions::messaging:392
init.js:108 {message: "The message port closed before a response was received."}message: "The message port closed before a response was received."__proto__: Object

@herexf https://github.com/keepassxreboot/keepassxc-browser/issues/184#issuecomment-397826042 - here's a workaround while waiting for new release.

@varjolintu

Thanks, I have tried to added some sites to the ignore list, but still doesn't work,

@herexf Could you see if the logs still show an error from browserAction.js:209 just like before?

@varjolintu

Please check the log for new username and password after click the context menu "save credentials"

init.js:108` {message: "The message port closed before a response was received."}
browserAction.js:210 Uncaught (in promise) TypeError: "${pattern}" is not a valid MatchPattern
    at matchPatternToRegExp (global.js:43)
    at siteMatch (global.js:86)
    at browserAction.js:210
matchPatternToRegExp @ global.js:43
siteMatch @ global.js:86
(anonymous) @ browserAction.js:210
Promise.then (async)
browserAction.setRememberPopup @ browserAction.js:205
keepass.isConfigured.then @ event.js:222
Promise.then (async)
keepass.testAssociation @ event.js:220
keepass.getDatabaseHash @ keepass.js:436
keepass.sendNativeMessage.then @ keepass.js:573
Promise.then (async)
keepass.getDatabaseHash @ keepass.js:550
keepass.testAssociation @ keepass.js:424
kpxcEvent.onSetRememberPopup @ event.js:218
browser.tabs.get.then @ event.js:72
Promise.then (async)
kpxcEvent.invoke @ event.js:46
kpxcEvent.onMessage @ event.js:13
(anonymous) @ browser-polyfill.min.js:1
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
EventImpl.dispatch @ extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ extensions::utils:138
messageListener @ extensions::messaging:240
EventImpl.dispatchToListener @ extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ extensions::utils:138
EventImpl.dispatch_ @ extensions::event_bindings:387
EventImpl.dispatch @ extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ extensions::utils:138
dispatchOnMessage @ extensions::messaging:392

If the password field is blank,

init.js:108 {message: "The message port closed before a response was received."}

@herexf The site you added to ignore list has not a valid match pattern (I need to fix this parsing myself), so add / to the end of the URL and try again.

@varjolintu

Many thanks, working now.
Extension icon is blinking and able to save/update the credentials now.

Cheers

@herexf Nice to hear. I just fixed the slash bug so it if a site is added manually and it lacks the slash character, it is added automatically to ensure the URL's is matched correctly. So everything should work in the next release.

Just figured out why the save credentials functionality does not work in Firefox Nightly.
From the console, the error is

browserAction.js:262:13
Error: Type error for parameter options (Property "buttons" is unsupported by Firefox) for notifications.create.

And according to this compatibility table it's true: Firefox does not officially support buttons in notifications.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/notifications/NotificationOptions

The strange thing is in stable it works..

@oidualc Thanks for the info. I didn't even know that it's not officially supported. Maybe they have changed the non-supported options to fail in the later versions, including nightly. Of course you can use a workaround and disable notifications from the settings.

Have you guys solved this? Can you release the new version now because it sucks to manually add/update entries in keepassxc.

@ArjonBu It's solved. New version is released soon.

Same type issue here. I only got started with KeePass a few days ago and have only ever used version 1.2.0 of KeePassXC-Browser. Let me be more specific with my system and what I've tried and observed:

Win 7 Pro
Firefox 61.0.1
KeePass 2.39.1
KeePassXC-Browser 1.2.0
KeyPassNatMsg v2.0.0-beta.10

I can save NEW credentials to my database from the browser but cannot save CHANGED ones. For changed ones, using "Save credentials" from context menu or submitting password change both do cause the extension icon to flash and I have no problem clicking it in time, but the resulting window makes no reference to saving/updating credentials but rather just gives the option of filling in existing credentials. As the latter behavior indicates, the database is open and functioning normally in other respects. I tried the workaround of adding an unused site to the ignored list with no effect on this behavior (I also tried removing it and then retrying as one commenter suggested; no dice).

That sounds strange. Can you give me the site where this happens?

Sure. I tried different examples including evite.com, sfn.org, and right here on github.com. Since I created a github account to be able to post after reading up on this issue I thought that was a pretty good demonstration of having no problem creating credentials and having them added to the db via browser extension but being unable to have them changed that way.

Thanks. I'll check it out.

Thank YOU. Please let me know if I can provide any other details/info.

I'm having the same problem. Already tried all the solutions/workarounds posted in this issue with no success.
Here's some more details:

  • OS: Windows 10 Pro (64 bit) - Version 1803
  • Browser: Firefox Developer Edition 62.0b14 (64 bit)
    KeePassXC-Browser Version: 1.2.0
    KeePassXC Version: 2.3.3

Revision: 0a155d8
Libraries:

  • Qt 5.10.1
  • libgcrypt 1.8.2

CPU Architecture: x86_64
Kernel: winnt 10.0.17134

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • Legacy Browser Integration (KeePassHTTP)
  • SSH Agent
  • YubiKey

Following you'll find the errors printed to the console when trying to add/update some credentials:
Promise rejected after context unloaded: Promised response from onMessage listener went out of scope keepassxc-browser.js:1471 cip.initCredentialFields/< moz-extension://---extension-key---/keepassxc-browser.js:1471:13

Promise rejected after context unloaded: Promised response from onMessage listener went out of scope keepassxc-browser.js:1580 cip.preparePageForMultipleCredentials moz-extension://---extension-key---/keepassxc-browser.js:1580:5

Promise rejected after context unloaded: Promised response from onMessage listener went out of scope keepassxc-browser.js:1823 cip.fillIn moz-extension://---extension-key---/keepassxc-browser.js:1823:13

Promise rejected after context unloaded: Promised response from onMessage listener went out of scope keepassxc-browser.js:2042 cip.rememberCredentials moz-extension://---extension-key---/keepassxc-browser.js:2042:9

Let me know if I can provide any more information.

@sdl3901 I can reproduce the issue. Trying to find the reason and solve it.

@varjolintu thank you for your time.

@N0153 Haven't looked at your issue any closer yet. That context unloaded is something strange. Context is unloaded only if the page/frame is not present anymore.

@varjolintu don't worry. My comment wasn't meant to put pressure on you.
Regarding the context unloaded, let me know how can I help you with the debugging.

Made some debugging and this issue is clearly happening because updating the password fields which triggered the context menu doesn't have any username available. popup_remember.js indentifies this and closes the popup right away.

I can make a fix where updating the credentials it uses the old username if the current one doesn't exists. But when creating new credentials this way the username will always stay empty, and I need to find a way to prevent that behaviour. Maybe ignoring new credentials would do if this kind of situation is detected.

Fixed. You are welcome to try the patch: https://github.com/keepassxreboot/keepassxc-browser/pull/256.

@varjolintu thank you for your time. I tried the fix #256 but the issue is still there.
This are the steps I followed while testing the patch:

  1. cloned repo
  2. run web-ext run --firefox=firefoxdeveloperedition
  3. connected the extension to the database
  4. compiled an access form
  5. right-clicked the username field -> KeepassXCBrowser -> Save credentials
  6. the icon blinked but there was no pop-up to save/update the password
  7. repeated steps 5 and 6 with password field, obtainig the same result

No errors or warnings where reported in the console, unless I actually logged in with the credentials. In this case I got the same behaviour of steps 5 and 6 but with the same error of two days ago:
Promise rejected after context unloaded: Promised response from onMessage listener went out of scope keepassxc-browser.js:2042 cip.rememberCredentials moz-extension://---extension-key---/keepassxc-browser.js:2042:9

How can I try to reproduce your tests?

@N0153 Try it with stable Firefox. Developer Edition is basically Firefox Beta which we don't support. This is also explained in the PR.

@varjolintu rjolintu tried with Firefox stable. It all works perfectly. I wonder what's the matter with the Developer/Beta edition.
Anyway, thank you for your time.

I'd like to try it and report back. I'm new here, however, and not clear on how to apply patches. Is there a guide someone can point me to? I did find my way to the Commit tab for comment #256 and went down into folders based on when modified so I think I know where the relevant files are but I'm not sure how to properly download the correct ones and which commands to use to apply them.

@sdl3901 try the following statements from the command-line/terminal (you need git, nodejs and npm installed and configured on the system):
npm i -g web-ext (it needs sudo or root permissions on Unix systems)
cd
git clone https://github.com/keepassxreboot/keepassxc-browser.git
cd keepassxc-browser
git checkout popup_remember_fix
cd keepassxc-browser
web-ext run --f=firefox --bc

More information about web-ext here

Thanks, @N0153 I'll give this a shot later when I have some time to figure all of that out.

@sdl3901 Another way to try it without downloading anything or meddling with npm or web-ext:
1) Go to https://github.com/keepassxreboot/keepassxc-browser/tree/popup_remember_fix
2) Clone or download button -> Download ZIP
3) Extract the ZIP
4) Go to addons:debugging in Firefox, check Enable add-on debugging
5) Click Load Temporary Add-on and browse the extracted ZIP folder for manifest.json
6) Select manifest.json and Firefox should load the add-on as a temporary one

Sounds good, @varjolintu I just did that now.

On github and evite.com, updating password activates extension icon, clicking that shows the proper-looking New, Update, and Dismiss options, and clicking Update does bring up a dialog box to confirming saving the updated credentials to KeePass, but it does not appear to actually update the entry. However, I tried changing the password twice in a row and can see that the password entry is in fact updating but it's not the most recent new password but the one before. It appears that the update is being done based on the old password, which happens to be the first password field on the change password page (you have to enter old pwd, new pwd, then confirm new pwd). Note that if I right-click in a new pwd field vs. old pwd field and use the context menu to save credentials (rather than site's button to submit the password change) it updates based on whichever field I chose. So I think when using the site's update button to activate the extension the update is using the first found pwd field, which is the old one, hence no real update. I assume there is no way to distinguish old vs. new pwd fields for the extension's code, but even if not, it's probably safe to assume that the first field is for the old one and that using the last password field available on a page will be the correct one for the new password?

I was getting some other odd sporadic behavior (losing connection to database, icon freezing in red, password generation not working) but it was hard to figure out the conditions yielding these problems, as I was doing things over and over in different combinations. It's late and my mind is boggled at this point, so maybe I can just check for that sort of thing after you have an opportunity to address the issue of ensuring the correct password field is used for updates?

Thanks!

@sdl3901 Great info. Thank you. I'll modify the PR to ignore the first input field, because it's clearly almost always the old password.

The problems with Firefox Developer Editions, Beta and Nightly builds are clearly related to this bug I found with mozregression testing:
https://bugzilla.mozilla.org/show_bug.cgi?id=1419893
https://hg.mozilla.org/integration/autoland/rev/331be24ce5e6

I'm making any necessary changes to the next release.

Was this page helpful?
0 / 5 - 0 ratings