Metamask-extension: Firefox: NetworkError when attempting to fetch resource

Created on 15 Jul 2017  Â·  37Comments  Â·  Source: MetaMask/metamask-extension

As per this StackExchange post, I'm getting this error in Firefox:

Error: NetworkError when attempting to fetch resource. Stack trace: InvalidResponse@http://localhost:8081/bundle.js line 995 > eval:38:16 RequestManager.prototype.sendAsync/<@http://localhost:8081/bundle.js line 7645 > eval:86:29 MetamaskInpageProvider/self.sendAsync/<@moz-extension://bb21b38e-ca5a-6847-afb3-0e13f721de3f/scripts/inpage.js:168:7 [136]</StreamProvider.prototype._onResponse/<@moz-extension://bb21b38e-ca5a-6847-afb3-0e13f721de3f/scripts/inpage.js:8222:5

It goes away when I disable MetaMask....

P2-sooner T00-bug

Most helpful comment

any news in this issue? Is someone solving it?

All 37 comments

same +1

Me too.

Is this a dapp using testrpc or is it running in the cmd line? Also, can you provide the version of testrpc?

@tmashuang, I'm using Ropsten.
It was working fine 4 days ago on firefox, then it suddenly stop working and showing "Error: NetworkError when attempting to fetch resource."

@tmashuang @fabdarice Same situation for me.

Mine is a dApp that uses a REACT frontend. Currently, I'm using EthereumJS TestRPC v4.0.1 (ganache-core: 1.0.1), but I'm pretty sure it was happening on TestRPC v3.x, too...

Are you able to provide a link to the dapp so I can try to replicate the issue?

@tmashuang, er maybe. Slight problem is that the newer version of TestRPC is enforcing stricter gas limits, so I'm in the middle of shifting much of the heavy lifting away from Solidity, and into the frontend, where it should be anyway ;)

Having said that, if you're happy using v3.x of TestRPC, I can probably point you at a tagged release in my main GitHub branch that 'should' work and will reproduce the issue...

Either that or wait until tomorrow, and I'll give you access to a working v4 version....

I think we should wait until the v4 version, in case that fixed the issue by itself.

@flyswatter I'm pretty sure it's still happening with v4.

But okay, give me a little while (a day max'), and I'll get you access to a working version of my dApp that you can use for debugging...

@flyswatter @tmashuang Try this on Ropsten: http://fingerprintapp.org/dapp.htm#!/all-records

@flyswatter @tmashuang - my dApp's ready for you to use for debugging. Hopefully, you've already received notification that I've added you to the dApp repository. Please feel free to branch and do whatever you must ;)

I've confirmed that if I load Firefox with MetaMask enabled, I get the error. However, the dApp runs error free with MetaMask disabled. To fire the error, please visit the Create FakeNews Object link of the dApp. I 'think' it has something to do with there being an async function running under that link....

Hopefully, the README is enough to get you started, but the software is very early in its development cycle, so the instructions I've written (for getting it all running) are 'probably' inadequate. If so, please ask away...

I'm observing the same error.

running a truffle box with contracts on the kovan network

this is the snippet of code that is catching the error

try { web3.version.getNetwork(function(error, result){ if(!error){ console.log(result) if(result==='42'){ dispatch(wrongNetwork(false)) } else { dispatch(wrongNetwork(true)) } } else{ console.log("AppActions.setWeb3") console.log(error) } }) } catch (error) { console.log("AppActions.setWeb3") console.log(error) dispatch(wrongNetwork(false)) }

and the stack trace

Stack trace: InvalidResponse@http://localhost:3000/static/js/bundle.js:54611:17 RequestManager.prototype.sendAsync/<@http://localhost:3000/static/js/bundle.js:43757:30 MetamaskInpageProvider/self.sendAsync/<@moz-extension://559bc4d9-ec4a-4f2f-a9ef-4c444023a17e/scripts/inpage.js:168:7 [136]</StreamProvider.prototype._onResponse/<@moz-extension://559bc4d9-ec4a-4f2f-a9ef-4c444023a17e/scripts/inpage.js:8222:5 wrapped@http://localhost:3000/static/js/bundle.js:233291:25

I'm experiencing the same thing and am unable to access the ENS Register with Metamask in Firefox. I haven't made any changes to the browser or anything and it has been a week or more since I used Metamask, but it isn't working now and I get the same error on two different computers. Is this related to the latest extension update?

Here's something to try:

Try switching your provider (top left MetaMask menu) to another one and back again.

Is it able to find a connection after?

Tried switching between the networks and not able to find a connection

Switching networks didn't work at first but I did it a couple of times,
then clicked "Retry" in ENS and it started working. Thanks!

On Thu, Jul 20, 2017 at 8:16 AM, Quijano Flores notifications@github.com
wrote:

Tried switching between the networks and not able to find a connection

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MetaMask/metamask-extension/issues/1779#issuecomment-316754193,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ab0IDwO4RQCC3FMr2OkdRqhwGxQxqhp-ks5sP31ZgaJpZM4OZCoQ
.

That's very strange. Will try to debug this soon.

@flyswatter Still get the error after switching networks.

Im facing the same problem with Firefox and Metamask. Any update on this?

Thanks

Yeah switching networks proved to be only a temporary solution for me and it came back quickly, still getting the error and am unable to use MM in Firefox. I installed it on Chrome and it works fine. I have tried uninstalling the plugin and reinstalling it in Firefox and that didn't solve the problem for me. I haven't yet wiped the whole Firefox profile and started from scratch, was hoping to see if anyone else had better luck before going to that extreme.

Yup, I'm getting the error as well, everything works fine on Chrome though.

any news in this issue? Is someone solving it?

Still not working 😢

Bump

Bump

Seeing this issue on Firefox with https://demo.micro.raiden.network/fortunes_en

Firefox + Metamask bump

I'm seeing this issue too, on MetaMask 3.10.8, ~which I believe includes #2138~ (#2138 was never merged).

Here's a WireShark dump of a conversation between MetaMask and my Ethereum node (Parity 1.6.10) at http://10.1.0.8:8545. The web page is trying to do web3.version.getNetwork, and immediately and repeatedly retries if it fails.

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:57:59 GMT
Transfer-Encoding: chunked

POST / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
content-type: application/json
origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Content-Length: 98
Connection: keep-alive

{"id":5248397948271052,"jsonrpc":"2.0","params":["0x420e4c",true],"method":"eth_getBlockByNumber"}HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:57:59 GMT
Transfer-Encoding: chunked

{"jsonrpc":"2.0","result":null,"id":5248397948271052}
OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:02 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:03 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:03 GMT
Transfer-Encoding: chunked

POST / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
content-type: application/json
origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Content-Length: 98
Connection: keep-alive

{"id":5248397948271053,"jsonrpc":"2.0","params":["0x420e4c",true],"method":"eth_getBlockByNumber"}HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:03 GMT
Transfer-Encoding: chunked

{"jsonrpc":"2.0","result":null,"id":5248397948271053}
OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:04 GMT
Transfer-Encoding: chunked

OPTIONS / HTTP/1.1
Host: 10.1.0.8:8545
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-metamask-origin
Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json
Allow: OPTIONS, POST
Access-Control-Allow-Headers: origin, content-type, accept
Access-Control-Allow-Origin: moz-extension://c2480724-8a32-4afc-a7aa-c1d18a8bf229
Date: Mon, 02 Oct 2017 00:58:05 GMT
Transfer-Encoding: chunked

It looks like its first request goes through fine; it does a CORS preflight check for POST to /, gets an answer it likes, POSTs something like {"id":5248397948271052,"jsonrpc":"2.0","params":["0x420e4c",true],"method":"eth_getBlockByNumber"}, and gets an answer of null wrapped in the appropriate JSON.

But then it does another CORS preflight, this time asking if it can also send the x-metamask-origin header, and the server appears to respond with basically "No I have never heard of that header and it is not allowed". According to the CORS spec, Firefox then can't let MetaMask make the request with that header. MetaMask (or Firefox) doesn't seem to know how to deal with this, so it ends up throwing an error, whereupon my page retries the exact same request to MetaMask, with the same result.

If this really is the problem, it looks like the breaking commit was https://github.com/MetaMask/metamask-extension/commit/68fc3603dfe72721e080a80b9a4103408e113c6c on July 4, a few days before this bug was reported.

Either Parity and other Ethereum nodes need to be modified to explicitly accept the x-metamask-origin header, or MetaMask needs to be modified to not insist on sending it. MetaMask could either not send the header at all, or could try to send the header initially and fall back to not sending it if the request fails because it is not allowed to be sent by CORS.

I'm getting an error.

related #2138

I'm getting error in Firefox: NetworkError when attempting to fetch resource in version 3.10.8. Stack trace attached. There is no error when running the same dapp with V3.7.8
stacktrace.txt

@DaneWiid1 should work in 3.10.9

@sunify confirmed - it's working for me in 3.10.9 on Firefox

I still have the problem in Metamask 5.3.2 on Firefox Quantum 64.0!

Running: Ganache CLI v6.2.5 (ganache-core: 2.3.3) on 127.0.0.1:8545 using:

ganache-cli -d --db ${HOME}/tmp/ganache/db -i 123456

The problem occurs at the javascript line:

await window.ethereum.enable();

So it's not solved…?!?

In Chromium this works, so it is related to Firefox. But in Chromium, I then drop into #3094

The code works without Metamask, so it's definitely a bug in Metamask.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aecc picture aecc  Â·  3Comments

whyrusleeping picture whyrusleeping  Â·  3Comments

DISC30 picture DISC30  Â·  3Comments

danfinlay picture danfinlay  Â·  3Comments

beether picture beether  Â·  4Comments