Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some log messages leak even if the log level is "fatal" #619

Open
barancev opened this issue Apr 8, 2017 · 19 comments
Open

Some log messages leak even if the log level is "fatal" #619

barancev opened this issue Apr 8, 2017 · 19 comments
Assignees

Comments

@barancev
Copy link

barancev commented Apr 8, 2017

Firefox Version

55.0a1 (2017-04-06) (64-bit)
geckodriver 0.15

Platform

Windows 7

Steps to reproduce

        FirefoxOptions options = new FirefoxOptions()
                .setBinary(new FirefoxBinary(FirefoxBinary.Channel.NIGHTLY))
                .setLogLevel(Level.OFF);
        WebDriver driver = new FirefoxDriver(options);
        driver.get("http://seleniumhq.org/");

Most log messages are suppressed, but not all:

1491680124872	geckodriver	INFO	Listening on 127.0.0.1:47616
[GPU 12236] WARNING: pipe error: 109: file c:/builds/moz2_slave/m-cen-w64-ntly-000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 12748] WARNING: pipe error: 109: file c:/builds/moz2_slave/m-cen-w64-ntly-000000000000000/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
апр 08, 2017 10:35:28 PM org.openqa.selenium.remote.ProtocolHandshake createSession
JavaScript error: http://www.seleniumhq.org/tophatpromo.js, line 1: ReferenceError: $ is not defined
JavaScript error: http://www.seleniumhq.org/tophatpromo.js, line 1: ReferenceError: $ is not defined
@andreastt
Copy link
Contributor

Thanks for the bug report, but unfortunately the log verbosity option in geckodriver only controls the Log.jsm and the Rust verbosity.

The “pipe error”, “ProtocolHandshake createSession”, and “JavaScript error” output that you see in your log is outside of our control.

@barancev
Copy link
Author

barancev commented Apr 10, 2017

Why can't geckodriver handle "pipe error" and "JavaScript error"? They came from the browser, why can't they be wrapped (and then suppressed) by geckodriver?

@andreastt
Copy link
Contributor

Because they’re not using Log.jsm, and whatever isn’t using Log.jsm is outside of our control. The log verbosity setting only controls the Marionette log component.

@andreastt
Copy link
Contributor

Put into other words: This is output you’d see from Firefox normally, even when not run through geckodriver.

@whimboo
Copy link
Collaborator

whimboo commented Apr 19, 2017

I just wonder if the binary used to produce this trace log was a debug build?

@barancev
Copy link
Author

Firefox Nightly and the released version of geckodriver 0.15 for windows.

@whimboo
Copy link
Collaborator

whimboo commented Apr 20, 2017

So what we do in GeckoDriver is to set browser.dom.window.dump.enabled to true:

("browser.dom.window.dump.enabled", Pref::new(true)),

Can you please check how it behaves when you turn it off?

This preference actually controls everything which gets dumped to the console by the browser itself. Maybe we should couple it with the log settings, and only turn it on if logging is enabled and set to at least debug level.

@whimboo
Copy link
Collaborator

whimboo commented Apr 20, 2017

@andreastt I would recommend that we re-open this issue. Sadly I cannot do it myself.

@andreastt
Copy link
Contributor

browser.dom.window.dump.enabled only controls the visibility of dump() in JS. It does not control std::cout or printf in C++ or C.

For example, I still see this which originates from C++ code:

[Child 6346] WARNING: pipe error (29): Connection reset by peer: file /home/ato/src/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353
[Child 6346] WARNING: pipe error (16): Connection reset by peer: file /home/ato/src/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353
[Child 6346] WARNING: pipe error (3): Connection reset by peer: file /home/ato/src/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353

But setting browser.dom.window.dump.enabled to false hides the likes of:

JavaScript warning: http://cdn.vgc.no/js/libs/backbone/backbone-1.0.0.min.js, line 2: Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead

@whimboo
Copy link
Collaborator

whimboo commented Apr 26, 2017

Even if it only controls the output dump() in JS code, we could reduce the clutter in the log, and only enable it if at least debug has been specified?

@andreastt
Copy link
Contributor

Sure. I’ve always found them useful, but I guess it would be more structured to access them by implementing a log retrieval API in the future.

In the meantime, users who are interested in these log messages can pass browser.dom.window.dump.enabled as part of moz:firefoxOptions.

@whimboo
Copy link
Collaborator

whimboo commented Apr 26, 2017

In the meantime, users who are interested in these log messages can pass browser.dom.window.dump.enabled as part of moz:firefoxOptions.

I assume you meant not interested because we enable this preference by default in geckodriver.

@andreastt
Copy link
Contributor

I assume you meant not interested because we enable this preference by default in geckodriver.

I mean that when browser.dom.window.dump.enabled is taken out of prefs.rs, users who are interested in it can pass it along as a preference in moz:firefoxOptions if they want to retain the current behaviour.

@whimboo
Copy link
Collaborator

whimboo commented Apr 27, 2017

Ok, so I will provide a PR for that then.

@whimboo whimboo self-assigned this Apr 27, 2017
@whimboo whimboo reopened this Apr 27, 2017
@whimboo
Copy link
Collaborator

whimboo commented Apr 27, 2017

So I tried to reproduce this behavior with the Selenium Python bindings but I actually cannot see any javascript errors in the log output. It doesn't matter which level I have defined.

@barancev, which binding are you using? Would you mind testing with my Python test script?

@barancev
Copy link
Author

barancev commented Sep 7, 2017

As far as I know Python test frameworks suppress stdout of spawned processes. I use Java binding.

At the moment I see less internal browser error messages than in the original post, but the log is not empty (in today Nightly):

1504799496623	geckodriver	INFO	geckodriver 0.18.0
1504799496632	geckodriver	INFO	Listening on 127.0.0.1:24070
Unable to read VR Path Registry from C:\Users\alexei\AppData\Local\openvr\openvrpaths.vrpath
[Child 9904] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1504799500028	Marionette	DEBUG	Register listener.js for window 4294967297
1504799500091	Marionette	DEBUG	Received DOM event "beforeunload" for "about:blank"
1504799500419	Marionette	DEBUG	Received DOM event "pagehide" for "about:blank"
1504799500419	Marionette	DEBUG	Received DOM event "unload" for "about:blank"
1504799500602	Marionette	DEBUG	Received DOM event "DOMContentLoaded" for "http://www.seleniumhq.org/"
1504799501450	Marionette	DEBUG	Received DOM event "pageshow" for "http://www.seleniumhq.org/"

@andreastt
Copy link
Contributor

The debug-level output you see from the Marionette component there is due to https://bugzilla.mozilla.org/show_bug.cgi?id=1384956.

@titusfortner
Copy link

Did https://bugzilla.mozilla.org/show_bug.cgi?id=1384956 not address the issue?

@whimboo
Copy link
Collaborator

whimboo commented May 9, 2023

Did https://bugzilla.mozilla.org/show_bug.cgi?id=1384956 not address the issue?

That bug was only about the wrong logging in Marionette, but this did not address the issue with the included Firefox logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@whimboo @andreastt @barancev @titusfortner and others