Server side logging: adding observer throws an exception

RESOLVED FIXED in Firefox 43

Status

()

Firefox
Developer Tools: Console
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Honza, Unassigned)

Tracking

42 Branch
Firefox 43
Points:
---

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
I am seeing the following exception when opening Browser Content Toolbox:

Handler function threw an exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIObserverService.addObserver]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/server-logger.js :: ServerLoggingListener<.attach< :: line 91"  data: no]


It's related to this code:

if (DebuggerServer.isInChildProcess) {
  this.attachParentProcess();
} else {
  Services.obs.addObserver(this.onExamineResponse,
    "http-on-examine-response", false);
}


The DebuggerServer.isInChildProcess is set to false and Services.obs.addObserver throws NS_ERROR_NOT_IMPLEMENTED exception.

Honza
(Reporter)

Comment 1

2 years ago
Alex, even if the DebuggerServer.isInChildProcess is false, it looks like we are in the child process here, no?

Honza
Flags: needinfo?(poirot.alex)
Yes. It looks like we never supported this (dynamic actors and related api) in the browser content toolbox.
Flags: needinfo?(poirot.alex)
Created attachment 8650514 [details] [diff] [review]
patch v1

https://treeherder.mozilla.org/#/jobs?repo=try&revision=46225888c51c

It would be great to have one single test against browser (content) toolbox...

Honza, Does server-loger works correctly with that or isn't that enough?
(Reporter)

Comment 4

2 years ago
This fixes the exception, thanks.

However, I am not sure what is the use case for server-side-logging here.

Is the Browser Content Toolbox (the Console panel) expecting to show server side logs coming from all pages? This doesn't work now.

I've been testing XHR and it doesn't work either, is it a bug?

console API calls seems to appear in the browser content console...

Honza
Flags: needinfo?(poirot.alex)
(In reply to Jan Honza Odvarko [:Honza] from comment #4)
> This fixes the exception, thanks.
> 
> However, I am not sure what is the use case for server-side-logging here.

At least, this patch ensure that actor-actor works in browser content toolbox.
server-side-logging may not be the only thing use isInChildProcess/parentMessageManager API.

> Is the Browser Content Toolbox (the Console panel) expecting to show server
> side logs coming from all pages? This doesn't work now.

I can easily imagine messages not being routed correctly within server-loger.js or server-loger-monitor.js... but that's a different issue than this exception.
I don't think it is critical to support server-side-logging in this particular context.
Flags: needinfo?(poirot.alex)
(Reporter)

Comment 6

2 years ago
Yes, agreed.

So, the attached patch solves this bug report.

Thanks!
Honza
Comment on attachment 8650514 [details] [diff] [review]
patch v1

Oh I forgot to r? this patch...
Attachment #8650514 - Flags: review?(jryans)
Attachment #8650514 - Flags: review?(jryans) → review+

Comment 8

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/1d9a8a4f79b9
https://hg.mozilla.org/mozilla-central/rev/1d9a8a4f79b9
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
You need to log in before you can comment on or make changes to this bug.