Closed Bug 1779723 Opened 3 years ago Closed 2 years ago

"WebDriver:NewSession" can fail if Firefox gets started with some random URL that causes network errors

Categories

(Remote Protocol :: Marionette, defect, P3)

Firefox 102
defect

Tracking

(firefox-esr91 unaffected, firefox-esr102 wontfix, firefox102 wontfix, firefox103 wontfix, firefox104 wontfix, firefox105 wontfix, firefox106 wontfix)

RESOLVED INACTIVE
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix

People

(Reporter: whimboo, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Originally filed as: https://github.com/SeleniumHQ/selenium/issues/10840

If a test starts Firefox with some random URL like https://www.start-maximized.com, which in my case redirects some times and then ends-up on a network error page, the WebDriver:NewSession will fail with a NS_BINDING_ABORTED error:

1657775131409	Marionette	DEBUG	0 -> [0,1,"WebDriver:NewSession",{"acceptInsecureCerts":true,"browserName":"firefox","pageLoadStrategy":"normal"}]
1657775131411	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
1657775131421	Marionette	DEBUG	Waiting for initial application window
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
1657775131892	RemoteAgent	TRACE	Received DOM event load for [object HTMLDocument]
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /var/folders/1c/9qlxg8ln30b82r6fjs47lscw0000gn/T/rust_mozprofileLtNhga/search.json.mozlz4", (void 0)))
1657775132562	Marionette	TRACE	Received observer notification browser-idle-startup-tasks-finished
1657775132562	RemoteAgent	TRACE	Received observer notification browser-idle-startup-tasks-finished
DevTools listening on ws://localhost:53669/devtools/browser/c7f95f0f-49ad-4286-8628-ad9a44154713
1657775132565	RemoteAgent	TRACE	[22] ProgressListener state=start: https://www.start-maximized.com/
1657775133260	RemoteAgent	TRACE	[22] ProgressListener state=stop: error=0x804b0002 (NS_BINDING_ABORTED)
1657775133260	Marionette	DEBUG	0 <- [1,1,{"error":"session not created","message":"Error: NS_BINDING_ABORTED","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28\nonStateChange@chrome://remote/content/shared/Navigate.jsm:254:28\n"},null]
1657775133274	webdriver::server	DEBUG	Teardown session
1657775133274	mozrunner::runner	DEBUG	Killing process 26733
Exiting due to channel error.
Exiting due to channel error.
[GFX1-]: Receive IPC close with reason=AbnormalShutdown
Exiting due to channel error.
1657775133324	webdriver::server	DEBUG	<- 500 Internal Server Error {"value":{"error":"session not created","message":"Error: NS_BINDING_ABORTED","stacktrace":"#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:209:28\nonStateChange@chrome://remote/content/shared/Navigate.jsm:254:28\n"}}

At the moment we care about this error but only for the initial document:
https://searchfox.org/mozilla-release/rev/a9a0747e863e716284d7c3f25d44cb057505547c/remote/shared/Navigate.jsm#195-200

That means if Firefox gets started with a given URL this check will be ignored and instead an error is thrown causing the WebDriver:NewSession command to fail.

Should be a regression from my patches on bug 1763124.

Set release status flags based on info from the regressing bug 1763124

Set release status flags based on info from the regressing bug 1763124

Severity: -- → S3
Priority: -- → P3
Whiteboard: [webdriver:backlog]

Any resolution on this matter would help me too.
Running Selenium C# tests using Mozilla FF, ver103.0 on a Grid architecture. Looks like a folder called 'moziila_rustprof' getting created on the Temp folder. Fails to create a session.
Message: 
Test method Dynamics365Tests.UI.Smoke.Smoke.VerifyUserAuthentication threw exception:
System.InvalidOperationException: Error: NS_ERROR_UNKNOWN_HOST (SessionNotCreated)

StackTrace for the above:
1659377742950 geckodriver INFO Listening on 127.0.0.1:56281
1659377743320 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "--marionette" "test-type" "--allow-running-insecure-content" "--disable-extensions" "--ignore-certificate-errors" "-no-remote" "-profile" "C:\Users\\AppData\Local\Temp\rust_mozprofile1HkQUs"
1659377750694 Marionette INFO Marionette enabled
1659377750708 Marionette INFO Listening on port 56439
Read port: 56439
1659377751146 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\Users\
\AppData\Local\Temp\rust_mozprofile1HkQUs\search.json.mozlz4", (void 0)))
JavaScript error: chrome://remote/content/marionette/driver.js, line 2273: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIObserverService.removeObserver]

(In reply to amatzilla from comment #4)

1659377743320 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "--marionette" "test-type" "--allow-running-insecure-content" "--disable-extensions" "--ignore-certificate-errors" "-no-remote" "-profile" "C:\Users\*****\AppData\Local\Temp\rust_mozprofile1HkQUs"

I missed that particular comment which was added while I was away for a longer time. As such sorry for the delay.

Please note that you are using a couple of command line arguments that are not valid for Firefox. I assume you just copied them from your Chrome script. Please check firefox.exe --help which arguments are actually existent and can be used. The problem with the broken / busted page load on startup is most likely due to the "test-type" argument which should get loaded when Firefox starts up. Can you please check?

Flags: needinfo?(alwin.mathew)
Product: Testing → Remote Protocol

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit auto_nag documentation.

Flags: needinfo?(alwin.mathew)
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INACTIVE
Whiteboard: [webdriver:backlog]
You need to log in before you can comment on or make changes to this bug.