MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.04k stars 4.92k forks source link

Blank Extension Screen on Chrome/Firefox/Brave/etc. #4894

Closed ERC1975 closed 1 year ago

ERC1975 commented 6 years ago

Bounty: some users have reported experiencing a blank screen when the open the MetaMask extension in Chrome. This bounty is to identify a root cause of the issue that matches the symptoms and errors described below & to write a patch that fixes it.


I just downloaded and installed the Chrome Extension. However, when I click the fox in the upper right it opens a box/window to the right that is completely empty. It does not appear that the extension is operating correctly.

I'm on a Mac and using Chrome (most recent update).

Thanks, ERC

bdresser commented 6 years ago

@ERC1975 sorry to hear that. Could you help us debug by sending your background logs? There are instructions about halfway down this support article. You can post them here, or send to support@metamask.io and mention this issue URL.

myn commented 6 years ago

Getting same issue on my Mac too.

myn commented 6 years ago

screen shot 2018-07-27 at 6 09 27 pm

myn commented 6 years ago

screen shot 2018-07-27 at 6 11 14 pm Background Page

Strernd commented 6 years ago

Got this same issue on Chrome, Brave and Firefox. https://github.com/MetaMask/metamask-extension/issues/4782

Strernd commented 6 years ago

Reinstalling Metamask fixed it for me on Chrome

estebanmino commented 6 years ago

somehow I was able to reproduce the last error showed in the picture. From development I got this

bug3

It corresponds to the method setupPublicConfig of metamaskController. The app did crash but I tried to reopen it and it worked fine.

bdresser commented 6 years ago

@Strernd next time you experience this, could you check the popup logs and background logs? Curious if you're getting the same error Esteban found, or something different. Sorry for the trouble & thanks for your help!

tritone11 commented 6 years ago

Same problems here, on Chrome on Windows 10, I managed to produce this error with the background logs error I hope this helps somehow, these crashes are haunting me since 2 weeks

tritone11 commented 6 years ago

Similar as above error EDIT:
Inspecting the extension while running, it freezes and it stays white when there is any call to the infura API. Althought the chrome inspector says the various calls like eth_getBlockByNumber, eth_getTransactionByHash, mainnet, blacklist ecc. take from 50ms to 200ms, most of the time I see them in pending for 20-30 seconds. After blocking the domain api.infura.io the extension run smoothly without freezing or without showing the blank screen (without being able to log in or use it, obviously).

Not able to change the network

tritone11 commented 6 years ago

I managed to recover my seed phrase from the crashing, whitescreening Metamask, then reinstall Metamask to get everything fixed.

I set up a private ethereum network with geth and rpc enabled, then stop the internet connection of my computer. Launching metamask, it wasn't able to find infura, so it started without problems and I set up a custom RPC from the metamask dropdown pointing to my ethereum node. Metamask connected to it, I logged in and took my seed phrase from the settings.

Then, I reinstalled Metamask and restored my wallet with the seed phrase.

I guess this would work with any public ethereum node, even testnet nodes, just disable your internet connection or block the infura api, open metamask, re-establish the connection and connect with custom rpc

EDIT: for anybody unable to find a public node to recover your seed or unable to set up your own node, I can open mine shortly to let you recover your seed, just contact me.

bdresser commented 6 years ago

from standup:

bdresser commented 6 years ago

could be related to https://sentry.io/metamask/metamask/issues/562285240/?query=is:unresolved (cc @jennypollack)

bdresser commented 6 years ago

@tritone11 thanks for the detailed rundown. Could I ask you to also send along your state logs to support@metamask.io? They'll help us identify the latest version of a particular migration that might be causing issues.

Instructions on how to get your state logs are here, assuming you're still able to access the UI as you described. Make sure you mention this issue number (4894) in your note. Thanks again for the help!

cc @whymarrh @alacrity26

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.45 ETH (181.59 USD @ $403.53/ETH) attached to it.

gitcoinbot commented 6 years ago

💰 A crowdfund contribution worth 0.05000 ETH (20.5 USD @ $409.98/ETH) has been attached to this funded issue from @.💰

Want to chip in also? Add your own contribution here.

gitcoinbot commented 6 years ago

@shad-k Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

shad-k commented 6 years ago

@bdresser can you send me any logs that you might have received regarding this. I have been trying to recreate this issue but have failed to do so thus far.

bdresser commented 6 years ago

@shad-k haven't received any reliable state logs on this.

above in this thread, most folks either see error: write after end or Error: PortDuplexStream -disconnected.

@estebanmino any detail to add?

estebanmino commented 6 years ago

@shad-k the PortDuplexStream error is generated here https://github.com/MetaMask/metamask-extension/blob/e2be22a4b722df608cb764042cc8ade6664414d8/app/scripts/lib/port-stream.js#L67 and it seems to be a disconnection between background and UI. The write after end error is originated here https://github.com/MetaMask/metamask-extension/blob/e2be22a4b722df608cb764042cc8ade6664414d8/app/scripts/metamask-controller.js#L1272

shad-k commented 6 years ago

@estebanmino can you also point out from where does PortDuplexStream.prototype._write get called and where do we "end" the stream. May be the solution could be something like ending within a callback to the write operation.

estebanmino commented 6 years ago

I haven't seen that deeply, according to the comments there it says that the _write method is called internally somehow. That could be one way to go with the research and it's why this bug has been difficult to catch, also because there are not clear reproduction steps.

gitcoinbot commented 6 years ago

@shad-k Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

shad-k commented 6 years ago

Since I wasn't able to find the root cause of this I would like to stop work on Gitcoin and let someone else claim it if they have a solution for this. Will keep looking for the root cause in the meanwhile.

starmankiti commented 6 years ago

I am in trouble with the same symptoms Is the solution reininstalled metamask? I can not lose the seed 2018-08-22 07 50 13

bdresser commented 6 years ago

@starmankiti you can try killing the extension from your Chrome Task Manager - this shouldn't require you to re-enter your seed phrase, but no promises. For more questions like this please reach out to support@metamask.io.

And to anyone else experiencing this issue - any errors present in your background logs or UI logs might be helpful in diagnosing! Feel free to post them here.

gitcoinbot commented 6 years ago

@meghanasarikonda Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 6 years ago

@meghanasarikonda Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

meghanasarikonda commented 6 years ago

yeah working to reproduce the problem!

gitcoinbot commented 6 years ago

@meghanasarikonda Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

tritone11 commented 6 years ago

@starmankiti if you are still in trouble with the extension and you don't have the seed to recover your wallet, do not reinstall the extension or you will lose it. If restarting the extension didn't work, please refer to this solution to recover your seed phrase using offline metamask and a custom ethereum node https://github.com/MetaMask/metamask-extension/issues/4894#issuecomment-410664381

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@meghanasarikonda due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 months, 2 weeks ago. Please review their action plans below:

1) tiro6090 has started work.

I already spent a couple hours researching this issue, and am confident that I know what the problem is. I tweaked the code to reproduce the problem consistently, and researched the error to find possible causes and fixes. If approved, I'll fix the issue and post a PR this weekend. If the PR doesn't get approved (or I don't get approved for this bounty), I can at least share with the community what the root cause is, and speculation on how it could be fixed. 2) ianfinn1994 has started work.

Quickly, efficiently and expertly solve this issue.

Learn more on the Gitcoin Issue Details page.

tj-ro commented 6 years ago

Ah, thought the "submit a plan" was to get approved to get the bounty or not, my bad! I'll get a PR up this weekend!

tj-ro commented 6 years ago

Just wanted to keep you guys updated, did some more research, but haven't yet gotten together something PR ready. Working on it, and will finish it up this week.

gitcoinbot commented 6 years ago

@tiro6090 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

tj-ro commented 6 years ago

Let me know what you guys think about this and if you think I'm on the right track (a lot of this is new to me so I'm making a pretty wild guess).

I'm 99.9% sure the problem is happening in setupControllerConnection in metamask-controller.js (1212). It creates a dNode with the api. As you can see here: http://status.infura.io/ the infura api isn't perfect, so if it tries to connect to infura, and infura drops the connection our dNode will get an EPIPE error (maybe). If that's the case, dNode "eats" the error: In the dnode connect method: if (err && err.code === 'EPIPE') return; // eat EPIPEs

If we hit that and the controller connection fails then we'll get the blank window (this I'm sure about). So we just need a more graceful way of handling this error instead of just throwing it away and not telling the user anything? That may explain the write after end error.

tj-ro commented 6 years ago

Also, might be worth mentioning that eating EPIPE errors is blocking it from emitting an error that would be handled elsewhere.

bdresser commented 6 years ago

@danfinlay @whymarrh ^

gitcoinbot commented 6 years ago

@tiro6090 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

estebanmino commented 6 years ago

Hi @tiro6090, interesting theory thanks for sharing it. As you mentioned we also think that this is a problem that comes from the background connection somehow. Related to infura, we've had reports that this is failing for users until they reinstall the app entirely, so it doesn't seem to be related specifically to a time period of users dealing with this. What do you think? Also curious to know how is related to this errors.

gitcoinbot commented 6 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@tiro6090 due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

tj-ro commented 6 years ago

Still digging around on this! @estebanmino I'm not convinced by the uninstall reinstall being the solution and not just a coincidence, only because someone above said they had it happening on several different browsers at the same time. I haven't looked into the port stream error in too much detail, the write after end just made sense so I assumed the port stream one was a symptom of the same problem. Let me dig into that specifically a little more.

gitcoinbot commented 6 years ago

💰 A crowdfund contribution worth 0.50000 ETH (107.08 USD @ $214.17/ETH) has been attached to this funded issue from @.💰

Want to chip in also? Add your own contribution here.

bdresser commented 6 years ago

Increasing the bounty - 1 ETH for a successful patch, 0.4 ETH for reliable reproduction steps that can consistently generate the blank screen.

bdresser commented 6 years ago

some more errors in the console for a user experiencing the blank screen (via support)

image

mrdavey commented 6 years ago

Hi there, I'm was also experiencing this on one of my Chrome user profiles. Attached background logs:

screen shot 2018-10-25 at 10 36 36 pm

If I opened the Metamask extension and wait a few minutes, eventually the extension would load properly, albeit it would be very slow (approx 1 minute for every click or action, even the animation of the fox head animated at 1 frame per minute or so). However once I switched the network away from Mainnet (tested with Rinkeby and Ropsten), then Metamask magically worked as normal. When I switched back to the Mainnet, the same slow buggy-ness occured (including initially opening the extension with a blank screen which last for ~2min).

Funnily as I was trying to get some more logs for this issue and switched back and forth between Rinkeby and Mainnet a few times, the bug somehow resolved itself. Now my Metamask extension works as normal on Mainnet... 🤷‍♂️

gioelecer commented 6 years ago

Hi there, I'm was also experiencing this on one of my Chrome user profiles. Attached background logs:

screen shot 2018-10-25 at 10 36 36 pm

If I opened the Metamask extension and wait a few minutes, eventually the extension would load properly, albeit it would be very slow (approx 1 minute for every click or action, even the animation of the fox head animated at 1 frame per minute or so). However once I switched the network away from Mainnet (tested with Rinkeby and Ropsten), then Metamask magically worked as normal. When I switched back to the Mainnet, the same slow buggy-ness occured (including initially opening the extension with a blank screen which last for ~2min).

Funnily as I was trying to get some more logs for this issue and switched back and forth between Rinkeby and Mainnet a few times, the bug somehow resolved itself. Now my Metamask extension works as normal on Mainnet... 🤷‍♂️

I am pretty sure this is a problem only with the Infura API (api.infura.io), as if I set their domain in my /hosts to point to my Ethereum node, it works

mrdavey commented 6 years ago

I solved this by opening Metamask and patiently waiting for it to load, then 'Account Settings' --> 'Reset Account'. Therefore I assume it has something to do with the way old transaction histories are being loaded (?)

tritone11 commented 6 years ago

I solved this by opening Metamask and patiently waiting for it to load, then 'Account Settings' --> 'Reset Account'. Therefore I assume it has something to do with the way old transaction histories are being loaded (?)

After fixing it 4 days ago how did you replicate the bug yesterday? I am having trouble replicating it