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

[Bug]: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist. #14987

Closed
php4fan opened this issue Jun 18, 2022 · 20 comments
Assignees
Labels
area-api needs-triage Sev2-normal Normal severity; minor loss of service or inconvenience. stale issues and PRs marked as stale team-extension-platform type-bug

Comments

@php4fan
Copy link

php4fan commented Jun 18, 2022

Describe the bug

see steps to reproduce

Steps to reproduce

  1. Make sure you have MetaMask installed and enabled
  2. If you have Chrome already open, close it
  3. Launch Chrome
  4. Open the Console

The following error will show up, usually once, sometimes two or three times:

Error messages or log output

Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

Version

10.14.6

Build type

No response

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

I have no other extensions enabled. If I disable MetaMask, the error stops showing up when I launch Chrome.

Guys do you even test before releasing??

@BelfordZ
Copy link
Contributor

@php4fan Thanks for the issue. Having troubles reproducing this.

Reproduction aside, is this blocking you in anyway?

We test extensively before releasing. If you are interested, have a look at our e2e tests: https://github.com/MetaMask/metamask-extension/tree/develop/test/e2e

@php4fan
Copy link
Author

php4fan commented Jun 29, 2022

Why are you closing this?

is this blocking you in anyway?

Not that I know of (unless it's related to the cause of some of the other dozens of bugs), but it's not acceptable to have random bogus errors in the console. Imagine if every extension I install did that, and then I need to debug the errors in my own code.

@BelfordZ
Copy link
Contributor

@php4fan Sorry for not making it more clear - I was not able to reproduce this issue using latest. I've installed the version you are using, and now see the error.

Updating to latest will fix it.

We don't want to leave random errors in the console.

@php4fan
Copy link
Author

php4fan commented Jun 29, 2022

Oh I see, sorry.

@php4fan
Copy link
Author

php4fan commented Jun 29, 2022

By "latest" do you mean building from source?
I now have 10.16.1 and I'm still observing the issue.

@BelfordZ BelfordZ reopened this Jun 29, 2022
@BelfordZ BelfordZ assigned BelfordZ and unassigned vandan Jun 29, 2022
@BelfordZ
Copy link
Contributor

I was not able to reproduce this in 10.16.1 until after many many attempts. Seems to only happen on some pages (I could only get it to happen when the first tab opened was github).

I am able to reproduce it 9/10 times now by:

  1. disabling all other extensions
  2. open chrome in profile "A" which has metamask installed
  3. close / quit
  4. open chrome in profile "B"
  5. open console and be amazed

Digging deeper...

@BelfordZ
Copy link
Contributor

BelfordZ commented Jul 1, 2022

@php4fan should be fixed once this all gets merged up and released. Sorry for the confusion and the incorrect closing of this issue, and thank you for taking the time to submit an issue.

@izogfif
Copy link

izogfif commented Dec 13, 2022

@BelfordZ So, any update on this?

@php4fan
Copy link
Author

php4fan commented Jan 24, 2023

Still seeing these errors.

@izogfif
Copy link

izogfif commented Jan 24, 2023

For what it's worth: I had the same error message when I tried to attach event listeners in service worker in onInstalled event handler. See "Don't" block in documentation:

chrome.runtime.onInstalled.addListener(() => {
  // ERROR! Events must be registered synchronously from the start of
  // the service worker.
  chrome.bookmarks.onCreated.addListener(() => {
    // do something
  });
});

@seaona
Copy link
Contributor

seaona commented Mar 10, 2023

I believe there are multiple ways to reproduce this behaviour. Here are some solid steps for repro'ing in one way:

  1. Load MM
  2. Click popup
  3. While having the popup open, disable the extension
  4. Enable back the extension
  5. Check background console
receiving-end-not-exist.mp4

cc @BelfordZ

@danjm danjm added team-extension-client team-extension-platform Sev2-normal Normal severity; minor loss of service or inconvenience. labels Mar 14, 2023
@CyberpunkLucyKiwi
Copy link

Hi, guys, I find the same errors when integrate Metamask extension into Electron, by using

import { app, BrowserWindow, session } from 'electron';
import path from 'path';
...
const ext = await session.defaultSession.loadExtension(
path.join(__dirname, '../../extensions/ejbalbakoplchlghecdalmeeeajnimhm/10.28.3_0'),
{ allowFileAccess: true, }
);

Metamask version are 10.28.3_0 and 10.30.1_0 and 10.29.0.0_0, all will result into errors, and Metamask popups with infinite loading and errors:
contentscript.js:1 Error: Could not establish connection. Receiving end does not exist. Resetting the streams.

I have checked with many possibilities, but no idea with it. The Electron loading extension method has no problem, because I can use the same method for coinbase wallet extension, it's perfect for loading and popuping.

@a0m0rajab
Copy link

I got into the same error but at another extension, It was resolved when I refreshed the page and ignoring the cache: (CTRL+SHIFT+R)

@CyberpunkLucyKiwi
Copy link

Oh, thanks for tips, I tried, but not work for me, even I set no-cache header when running electron dev mode. This bug is really werid.

@CyberpunkLucyKiwi
Copy link

I got into the same error but at another extension, It was resolved when I refreshed the page and ignoring the cache: (CTRL+SHIFT+R)

Oh, thanks for tips, I tried, but not work for me, even I set no-cache header when running electron dev mode. This bug is really werid.

@a0m0rajab
Copy link

This is related to sendMessage function, but not sure how to debug it or how to check it for this project.
Here is the related functions:
https://github.com/search?q=repo%3AMetaMask%2Fmetamask-extension%20sendmessage&type=code

@CyberpunkLucyKiwi
Copy link

Great clue, the next step is how to debug it, maybe try the source code of extension, not sure.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Aug 26, 2023
@github-actions
Copy link
Contributor

This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
@php4fan
Copy link
Author

php4fan commented Oct 10, 2023

Oh FFS again this idiocy. Stop closing issues "because" you don't fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-api needs-triage Sev2-normal Normal severity; minor loss of service or inconvenience. stale issues and PRs marked as stale team-extension-platform type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants