MetaMask / metamask-extension

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

MetaMask spins forever on failed options request to custom endpoint. #5684

Open MicahZoltu opened 6 years ago

MicahZoltu commented 6 years ago

Describe the bug MetaMask does not inform the user of an error connecting to a custom endpoint, instead just spinning forever.

To Reproduce Steps to reproduce the behavior:

  1. Setup Parity on a cloud server and forget to set --jsonrpc-cors=all
  2. In MetaMask, click the Network chooser dropdown and choose Custom RPC
  3. Fill in details that point to Parity server.
  4. Notice that the UI just spins forever.

Expected behavior The UI provides a clear error and gives up.

Browser details (please complete the following information):

Additional context Failing to include --jsonrpc-cors=all on the Parity node will result in it returning 403 responses to the MetaMask OPTIONS preflight request. MetaMask appears to just retry this request indefinitely, never alerting the user about it. I had to debug the extension to even see the error in the network tab.

You can also reproduce this behavior by setting up a tiny little webserver that just responds to all OPTIONS requests with 403.

bdresser commented 6 years ago

@MicahZoltu closing as a duplicate of https://github.com/MetaMask/metamask-extension/issues/3776, we think this can be solved with a better UI but are open to other thoughts!

danfinlay commented 6 years ago

I'm not sure it's a perfect duplicate, since this is a specific problem we could detect and represent to the user, making their time easier. #3776 is a generic failure, and doesn't help the user debug what's wrong.

majikandy commented 5 years ago

This is related to the endpoint not being there.... for example it happened in my case when I forgot to put the port on the end of the url.

The only solution, currently, seems to be to remove the extension, re add and then restore from seed.

Even when rebooting it is still stuck in the spinning "Connecting to unknown network" when clicking on metamask

kliu128 commented 5 years ago

I am hitting the same issue. Very annoying that you can't change the network, since the network spinner covers it.

bdresser commented 5 years ago

This is fixed for the basic case (filed in https://github.com/MetaMask/metamask-extension/issues/3776 and https://github.com/MetaMask/metamask-extension/issues/5609) by https://github.com/MetaMask/metamask-extension/pull/5893 – we'll make the network dropdown available while attempting to connect, and we'll time out requests after 15s and prompt the user to switch networks or try again.

The fix doesn't provide detailed error messages described by OP, so we can leave this open.