MetaMask / metamask-extension

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

Metamask hangs indefinitely when I try to send txes #3881

Closed lsankar4033 closed 6 years ago

lsankar4033 commented 6 years ago

I'm interacting with a contract running on a local dev blockchain (Ganache). After clicking 'Submit' to confirm a transaction in the Metamask popup, I'm presented with the following spinning icon forever:

screen shot 2018-04-04 at 4 06 01 pm

If I click out, and click on the Metamask plugin icon, it seems that the transaction has been sent:

screen shot 2018-04-04 at 4 06 59 pm

but the transaction is not showing up on my ganache instance! I've successfully sent the same transaction not via Metamask (i.e. via a ganache console), so the issue seems to be with Metamask. How do I begin to debug this problem?

tarrencev commented 6 years ago

I'm seeing this same behavior, transactions sit in the "Approved" status and I don't see them created in the ganache logs.

Rolled back to 4.4.0 to resolve for now

HartgerV commented 6 years ago

Experienced the same behavior in Chromium Version 65.0.3325.181 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)

Reverting to 4.5.2 fixed the issue, so the breaking change seems to be in the 4.5.3 release

danfinlay commented 6 years ago

We believe we've found the cause of this problem, and are fixing it.

If you experience this issue, try restarting your browser, that may also fix the problem for you. (And let us know)

joelnet commented 6 years ago

Restart browser didn't fix problem. Uninstall extension / reinstall extension also no affect. MM on Chrome does not work while on Brave MM works.

OS: Ubuntu 16.04 (64-bit) Ganache: ganache-1.1.0-x86_64

MetaMask: 4.5.3 Chrome: Version 65.0.3325.181 (Official Build) (64-bit)

Brave: 0.22.13 MetMask: 3.14.1

dpurhar27 commented 6 years ago

I'm am also currently experiencing this problem using Ganache as well, thanks for the fix in advance!

dpurhar27 commented 6 years ago

I restarted my browser and it is working again!

xeroblood commented 6 years ago

+1 Also experiencing this error. Restarting browser alone doesn't seem to work. I have to reset my MM test accounts which means restarting Ganache, redeploying my contract, etc... Basically restart testing all over.

Cloetn commented 6 years ago

+1 here. I have this issue as well with MetaMask 4.5.5. You have to redo everything before it can work again.

auser commented 6 years ago

As do I.

. Help?

tarrencev commented 6 years ago

A temporary solution is to use version 4.4.0: Download zip here: https://github.com/MetaMask/metamask-extension/releases/tag/v4.4.0 Installing chrome extensions from source: https://stackoverflow.com/questions/24577024/install-chrome-extension-not-in-the-store

auser commented 6 years ago

Yes, this fixes it for me... I'll stick to 4.4.0 for now.

Thank you!

lsankar4033 commented 6 years ago

switched to 4.4.0 and still having the same issue. same goes for restarting the browser.

Any tips on how I might be able to debug the issue locally?

lumsdnb commented 6 years ago

+1, same problem. Switched to Chrome and ran with 4.4.0 and it worked once, but now I have the same problem again.

timothywangdev commented 6 years ago

+1

bshevchenko commented 6 years ago

For us it hangs when we try to sign some data (not tx) in both ganache and ropsten networks.

bshevchenko commented 6 years ago

Now it also hangs for transactions

apbendi commented 6 years ago

I'm experiencing this issue as well. Brave seems to work.

danfinlay commented 6 years ago

Sorry for the delay, we had some staff rotations and apparently our triage process failed this bug.

Could someone having this problem look at their logs (maybe copy their UI state logs from the console) and send them to us at support@metamask.io, referencing this issue?

https://metamask.helpscoutdocs.com/article/21-how-to-get-logs-and-help-metamask-support-and-diagnose-your-issue

apbendi commented 6 years ago

@danfinlay sent; ticket number: 12866

danfinlay commented 6 years ago

I have some logs from @apbendi, and I've confirmed these transactions sit in the "approved" (not signed or broadcast) state, which is very strange.

You can tell it was never signed because there is no "nonce" number in the transaction list cell.

Since this doesn't show us why this is happening, I'm now relying on someone with this issue to open their background logs, try sending a transaction, and hopefully recording some red error messages:

https://metamask.helpscoutdocs.com/article/21-how-to-get-logs-and-help-metamask-support-and-diagnose-your-issue

dillonmcroberts commented 6 years ago

@danfinlay I gave it a shot but don't see any red error messages in background logs. Hopefully somebody else can be more helpful

danfinlay commented 6 years ago

Any other reproduction steps may also help. Is there a particular dapp you're using when you have the problem, or just sending from MetaMask?

What's your OS/browser?

dillonmcroberts commented 6 years ago

The problem first arose in local development building a dapp, but it looks like it happens for me sending anywhere from MetaMask. It works sometimes but I can't work out a pattern. Most of the time it doesn't work, I just get a blank screen or an infinite loader

OSX High Seirra 10.13.3 / Google Chrome 65.0.3325.181.

I will leave background logs open but I've tried quite a few times and haven't seen any error messages. @danfinlay

danfinlay commented 6 years ago

Okay we have a developer who has reproduced the issue! Hopefully we'll have a fix soon!

frankiebee commented 6 years ago

i seem to have narrowed it down to being an issue with how we calculate nonces thanks for the state log @apbendi it really hellped

frankiebee commented 6 years ago

can any one tell me if they see this on another network like a testnet or something?

dillonmcroberts commented 6 years ago

@frankiebee this morning on Ropsten testnet I do not have any issues sending with MetaMask

apbendi commented 6 years ago

@frankiebee to date I have only seen it while using Ganache, though at the moment I'm not doing very much on Ropsten or any other network. You mention nonces: I have been seeing an issue pretty frequently where my nonces get out of sync and I have to Reset Account in Metamask to get it to work again. This happens in Chrome AND Brave, while the endless spinning only seems to occur in Chrome. Don't know if they're related issues.

Anyway, sounds like y'all have what you need? Let me know if I can provide any more info, logs, code, etc... to help pin it down.

lsankar4033 commented 6 years ago

@frankiebee I've only seen it on ganache as well, but consistently on ganache

rhlsthrm commented 6 years ago

It's happening for me right now consistently on my Ganache/dev dapp setup. One thing that makes it happen consistently is if I redeploy contracts.

danfinlay commented 6 years ago

For people having this issue with Ganache: What versions of Ganache are you running?

apbendi commented 6 years ago

@danfinlay 1.1.0 on macOS Sierra

rhlsthrm commented 6 years ago

I'm using truffle develop to start Ganache.

Truffle v4.1.6

lsankar4033 commented 6 years ago

@danfinlay ganache 1.0.2 on macos high sierra

showmeyourcode commented 6 years ago

@danfinlay OS: Mac OS X El Capitan GANACHE : Version 1.1.0-beta.0 (1.1.0-beta.0)

BTW as suggested by @HartgerV reverting to 4.5.2 fixed the issue for now.

craigbranscom commented 6 years ago

Transactions hang in Chrome, but not Firefox.

macOS High Sierra Ganache 1.1.0 Chrome 65.0.3325.181 FireFox 59.0.2

jacobAtAnalytixBar commented 6 years ago

Heyo, I am trying to use sendTransaction for a contract token transfer function on Rinkeby testnet via Metamask and getting this issue. I get the infinite spinner until I close metamask and reopen, then it says tx is sent but the tokens are not actually transferred. I am on Mac OSX High Sierra 10.13.3, Chrome 65.0.3325.181

johnhforrest commented 6 years ago

Repros for me too. Ganache 1.10 Chrome 65.0.3325.181 MM version 4.5.5

Repro steps:

Uninstalling/reinstalling MM worked for me.

rhlsthrm commented 6 years ago

Found another repro situation with the nonce in sync using a local blockchain:

@danfinlay any progress here? It would be great to use MetaMask as a reliable dev tool, but seems like local blockchain issues are quite prevalent. I'm somewhat stuck to MetaMask too now in my dev process because I'm using eth_signTypedData which isn't yet supported by Ganache.

danfinlay commented 6 years ago

Hi all, very sorry this bug has hung around as long as it has. MetaMask is a developer tool before it is anything else, and it's critical that we keep your ability to build Dapps working smoothly. It looks like we've found the root problem in #4086, and @frankiebee is currently working on a fix. We're going to have a fix out asap.

zulhfreelancer commented 6 years ago

Just want to share. If you are facing issues on Chrome, you can use Firefox for now. Just got into the same issue on Chrome. When I switched to Firefox, all works fine.

MetaMask: 4.5.5 Firefox: 59.0.2 (64-bit) Ganache: 1.1.0 Truffle: 4.1.7 Solidity: 0.4.23 OSX: 10.12.6

Thank you @danfinlay and team for the hardwork!

ToJen commented 6 years ago

I am using the beta version of MetaMask on Chrome but the older version on both Brave and Firefox. In my case, the user has to sign two transactions to register an account. In the older UI, I'm able to navigate back and forth and sign the transactions in order. The beta UI layers the transaction calls on each other so my second transaction is displayed before the first which will obviously cause an error. I tested both old and new UI in Chrome and Brave and the old UI works fine. This may not be a major issue. Testing in incognito mode signs transactions automatically btw.

Nufflee commented 6 years ago

I'm still facing this issue.

danfinlay commented 6 years ago

This issue has been fixed in #4128, and the fix will be published later today.

nolash commented 5 years ago

Hangs in same manner on web3.eth.sign(). I'm trying the following code:

                window.addEventListener("load", function(e) {
                        if (typeof web3 !== 'undefined') {
                                web3js = new Web3(web3.currentProvider);
                        }
                        web3js.eth.getAccounts(function(e, accounts) {
                                web3js.eth.sign("foo", accounts[0], function(e) {
                                        console.log("ok: " + e);
                                        return true;
                                })
                        });

                });

After I click "sign" in the metamask popup, the text "invalid message length" briefly shows on the screen before the spinner takes the screen.

... or am I merely wrong to assume that I can sign arbitrary data with metamask?

bdresser commented 5 years ago

@nolash looks like you might have your params mixed up. check the API reference and this example implementation.

nickjuntilla commented 5 years ago

I also have a private blockchain and I am trying to send transactions. I was able to use it one day and then another day it stopped working and never worked again.

I installed 4.8.0 and it will update transactions, but it will not send transactions. Also when you click send or anything involved in creating a transaction the metamask screen will freeze. If you click away and the window closes then click back on metamask it will be at the next screen. Approving the transaction will not however actually send a transaction. The transaction will show in the transactions list but it will will never complete or send.

I have tried resetting the accounts, re-installing metamask, making sure my chainId matches my networkid and restarting my browser. Any help appreciated!

nolash commented 5 years ago

@bdresser to me it seems that it's metamask that got it the wrong way. If I put the data from your example as the second param, I get the following error:

Provided address "0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0" is invalid [...]

However if I do this:

web3js.eth.sign(web3js.utils.sha3("foo"), accounts[0], function(e, v) {
    console.log("e " + e + ", v " + v);
});

...it works.

So the metamask implementation seems not to accept arbitrary data to sign; it needs to be sha3'd. And the parameters does not match the API ref.

nickjuntilla commented 5 years ago

I created a new issue for this since it is still happening: https://github.com/MetaMask/metamask-extension/issues/4760

matrix-wd commented 5 years ago

use brave browser and add metamask, it works well.