NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface] (network-monitor.js:94)

NEW
Unassigned

Status

P2
normal
3 years ago
3 months ago

People

(Reporter: Gijs, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(firefox42 affected)

Details

(Reporter)

Description

3 years ago
This error appears a few seconds after starting and opening the browser console. I'm not 100% what triggers it but I've been seeing it a lot and it's annoying me. :-)

The error'ing code here is:

      return this._wrappedNotificationCallbacks.getInterface(iid);

in 

  getInterface(iid) {

for the NetworkResponseListener.

I'm unsure who works on the network monitor these days. Patrick, can you redirect to the right person?
Flags: needinfo?(pbrosset)
I'll take a look.  I originally added this line a while ago.
Flags: needinfo?(pbrosset)
These failures are associated with requests to https://push1.push.hello.firefox.com/ that upgrade to WebSockets.

The NetworkResponseListener installs its own notificationCallbacks on the channel:

1. For HTTP channels, this calls the setter[1]
2. As part of the setter, CanSetCallbacks[2] is called
3. CanSetCallbacks tries to get the nsILoadContext interface
4. NetworkResponseListener does not implement nsILoadContext, so it passes the request to the original callbacks
5. For these particular channels, getting nsILoadContext from the original callbacks returns NS_ERROR_FAILURE

So far, I am not yet sure why these channels fail in this way.

[1]: https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/HttpBaseChannel.cpp#336
[2]: https://dxr.mozilla.org/mozilla-central/source/netwerk/base/PrivateBrowsingChannel.h#65
(Reporter)

Comment 3

3 years ago
Could we ask someone from the hello team to help? Or maybe just silence the errors?
Flags: needinfo?(jryans)
I don't believe it's specific to Hello, but more likely something about WebSockets.

It seems like :baku has done a lot of work on WebSockets.  :baku, do you know why some WebSockets would fail when asking for the nsILoadContext interface?  I wasn't sure where that code actually lives...
Flags: needinfo?(jryans) → needinfo?(amarchesini)
Debugging this code, I see that:

1. nsILoadContext is exposed only in the WebSocketChannel parent. No child process.
2. and only the channel has been created with a LoadContext. As FTPChannel and HTTPChannel do.

can you create a test case? How easy is to reproduce this issue?
Flags: needinfo?(amarchesini) → needinfo?(jryans)
(In reply to Andrea Marchesini (:baku) from comment #5)
> Debugging this code, I see that:
> 
> 1. nsILoadContext is exposed only in the WebSocketChannel parent. No child
> process.
> 2. and only the channel has been created with a LoadContext. As FTPChannel
> and HTTPChannel do.
> 
> can you create a test case? How easy is to reproduce this issue?

Sorry for the delay in replying.  I've been a bit swamped lately.

AFAIK, the network monitor accesses request data from the parent process, so #1 above sounds okay.

It's easy to reproduce for me:

1. Start Firefox
2. Quickly open the Browser Console[1] (within a few seconds) so it's open before startup WebSocket requests
3. Firefox makes a WebSocket request to https://push.services.mozilla.com/ (in Nightly 43)
4. One or more of these errors are logged to the Browser Console

I have not yet had time to construct a reduced test case.  I'll keep this tab open and attempt to do so when I have more time.

[1]: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console
Flags: needinfo?(jryans)
Priority: -- → P2

Updated

3 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.