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

NEW
Unassigned

Status

P2
normal
4 years ago
15 days ago

People

(Reporter: Gijs, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(firefox42 affected)

Details

(Reporter)

Description

4 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

4 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

6 months ago
Product: Firefox → DevTools
Hello guys, 

I also encountered a similar problem while testing on the latest 64.0b13.

STR:
1. Launch FF.
2. Launch the Browser Console.
3. Go to Facebook and launch with valid credentials.
4. Enter Vegas Downtown Slots&Words.
5. Perform several actions inside the game(visit different subsections, enter action phase)
6. Press either the Facebook or Home button to return to account wall of activity.

ER:
- The browser console should not return any errors.

AR:
- The browser console returns NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIInterfaceRequestor.getInterface]on the path resource://devtools/server/actors/network-monitor/network-response-listener.js:73

Other notes:

- Encountered this error on Windows 10x64, macOS 10.11.6.
- Encountered this error both on x86 and x64 beta 64.0b13 builds
- Repro rate is only about 30% (3 out of 10 attempts)
- When attempting to reproduce the issue, out of the 7 attempts in which the issue was not reproduced, the "InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable" error is received instead.
- Screenshot of the error: https://drive.google.com/file/d/1lolOZDaLZcKO1MzCbxcZ04AILG9_iXrr/view?usp=sharing
You need to log in before you can comment on or make changes to this bug.