This is a short tutorial on how to fix problems with Metamask. If you have a transaction that isn’t going through (for example, you’re making a claim on the faucet), then this guide is for you. This also fixes errors like the following.
Before we proceed with troubleshooting metamask, please check you’re on the xDai network (not the Ethereum mainnet). You can do this by clicking into settings --> networks. Your settings for the custom RPC should be as follows:
Network Name: xDai
New RPC URL: https://rpc.xdaichain.com/
ChainID (Optional): 100
Symbol: xDai
Block Explorer URL: https://blockscout.com/poa/xdai
Additional tips:
-
Some users also experience the ‘transaction has failed’ error because their time or date is not synced properly on their PC. To sync your PC, right click the date/time at the bottom right, and click ‘adjust date/time’, then click ‘sync now’.
-
Brave Browser sometimes causes issues, so if yours persists, try Google Chrome
-
If you are getting the ‘Invalid Custom Network’ error, switching RPC servers can rectify the problem. If you are using https://rpc.xdaichain.com/ switch to https://xdai.poanetwork.dev and vice-versa
-
I also recommend clearing the cache on Chrome, this has caused users some problems (especially when using the Ledger). Now we’re ready to get started.
Generally, most problems can be fixed using the:
Basic Method
-
In your Metamask UI, click the top right circle icon that will display some color pattern.
-
Then click on the settings tab at the bottom of the list.
-
From here click Advanced.
-
Then click Reset Account.
-
Finally click Reset.
Now all your pending transactions will disappear, and you will be able to transact properly with the network. If you still have problems, head to the advanced section.
Advanced Method:
If the basic method still fails, the advanced method is for you. Basically what we need to determine is which transaction is stuck, and what nonce is applied to that transaction.
-
Going back into advanced settings, scroll down until you reach the ‘Customize transaction nonce’ setting and click that on.
-
Now we need to find out if there is a transaction that has failed on the blockchain. So head over to https://blockscout.com/poa/xdai and search your address in the top right. A list of transactions will populate, and you want to look for one that is red and says error as follows.
-
Click into the errored transaction, and find the nonce number. This number we will use in a new transaction. If you cant find the nonce number, leave the nonce blank for now, proceed to step 4.
-
Now you can send yourself some amount of xdai in by going send --> enter your address --> enter the amount ($0.01) --> hit next. Then you will be prompted to enter a ‘custom nonce’ in which you will enter the same one that failed. In my case this will be 25. If you do not know the nonce number, leave this blank.
-
Then hit confirm. The transaction will replace the previously errored transactions, and will post to the blockchain. You can now perform what task you were originally trying to do. If it doesn’t work, continue to step 6.
-
Next you need to check the pending transactions in your activity list in Metamask. Now locate the nonce number of the pending transaction. Once you have this number, reset your account using the basic method, and redo step 4. If the transaction fails again, try again by resetting your account (or clearing the pending transactions), and inputting a higher nonce number.
-
If you still cant get it to work, head over to the faucet at https://xdai-faucet.top/. Use the faucet and it will post a new transaction to your account. This transaction will process all previous ones and you will be unstuck. You can also get someone to send a transaction to your wallet.
If you find this and other posts helpful, you can support the content creators by giving it a like. If you experience any more problems feel free to ask for help in the #help channel of the discord - myself and others would be glad to help you further if you are still experiencing problems.