clients
clients copied to clipboard
Does not internally handle lack of connection gracefully - Error: Could not establish connection. Receiving end does not exist.
If the Bitwarden extension cannot reach its servers when launching Firefox, internally it does not handle this issue gracefully. Externally, I don't see an issue.
Here is the error displayed in the developer tools. You may need to create a remote connection to the browser to see all the details (go to Settings within Firefox's developer tools, and select the last 2 checkboxes in the lower-right corner, then create a separate remote developer tools session).
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. background.js:1504
send moz-extension://[UUID]/background.js:1504
I recommend implementing a handler for this case.
Besides network issues, it's possible that Bitwarden also will not be able to access the network when Firefox loads if suspendTabsUntilReady
is set to yes
in the Advanced Settings in the uBlock Origin web extension.
This can happen even if the vault has not been logged into in a particular session, when there's not even a mechanism to communicate with the Bitwarden server.
This causes Bitwarden to chew a fairly significant amount of CPU in the background, even when doing nothing.
Using Bitwarden 1.46.2, it looks like in about 10 minutes, I got about 80 of these messages in my console.
Line 1890 is: chrome.runtime.sendMessage(message);
In my light research into this message, it appears one way to address it is to convert to using browser.runtime.sendMessage and to catch any errors and to either eat them or take action on them.
I am also getting many of these in Version: 1.47.1. Performance impact doesn't seem high on my system, though.
Bump.
I am having tis problem too and no solution is provided here.
So
- what is it? and
- how do I stop it?
The addon tries to connect to the internet or does whatever it does on my computer every single time I open any tab or do any refresh. It doesn't even have to be a website. Every time I go to the browser option tab or any other internal browser info or setting tab, Bitwarden tries something and fails, resulting in the "Unchecked..." error message shown above. It also doesn't matter if Bitwarden/the vault is logged in or not. The mysterious background action takes place and the error shows up.
@Jerriy Yes, it's now been over a year since I posted this issue, and we still haven't received any response from anyone actively working on the responsible code (or anyone at all from Bitwarden, Inc.). The lack of communication and response is concerning, especially for a project like Bitwarden.
@eliykat you closed the duplicates on this topic, can we then expect this to be worked on soon?
Seems like fixes have been already proposed by different users on those tickets.
As far as I can see the background script isn't properly checking when it can't reach any content script.
The issue comes form here
https://github.com/bitwarden/browser/blob/8ffe2c2dcabfb358322ff030c381db6d6a61386c/src/services/browserMessaging.service.ts#L6
I only tested this in a mock project but, since the promise isn't being used at all, it only needs this to be attached
.catch(() => {})
EDIT: This error seems to be printed 8 times each time a tab is updated.
It is happening on FF 95.0.2 too and Biometric login not working.
I'm also seeing this and as a result the Firefox Task Manager reports that the Bitwarden extension is constantly the top entry when sorted by Energy Impact. Kind of disappointing this hasn't been fixed in over 2 years. Is there a documented preferred approach somewhere? I could attempt a pull request.
@jdharms a pull request is welcome. My suggested solution is to log (catch + rethrow?) the error the first few times it occurs. After (for example) 5 occurrences, warn the user that further repeated errors will be suppressed, and silently swallow them from that point onwards.
Alternative solutions are welcome though.
General instructions for local development setup are here: https://contributing.bitwarden.com/
Just a bump, since this is still happening (In my case: Chrome-dev: v2024.2.1 on Mac Sonoma 14.4.1)
@eliykat
Can we solve this problem as soon as possible?
The solution is readily available on Stackoverflow
.
how-to-fix-unchecked-runtime-lasterror-could-not-establish-connection
Hi @qinxs, I'll bump our internal tracking of this issue for visibility, however it's not currently prioritised for work. PRs are welcome though, please see my previous comment.