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

Wasm Browser work items failing with OpenQA.Selenium.WebDriverException #44862

Closed
ViktorHofer opened this issue Nov 18, 2020 · 17 comments
Closed
Labels
arch-wasm WebAssembly architecture area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone

Comments

@ViktorHofer
Copy link
Member

[00:03:37] crit: OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:37245/
                    at OpenQA.Selenium.DriverService.Start()
                    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 110
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 53
                    at Microsoft.DotNet.XHarness.Common.CLI.Commands.XHarnessCommand.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.Common/CLI/Commands/XHarnessCommand.cs:line 120
XHarness exit code: 71

Console log: https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-44835-merge-bb0f134359584f1080/System.Text.Encoding.CodePages.Tests/console.1329b837.log?sv=2019-07-07&se=2020-12-07T23%3A45%3A59Z&sr=c&sp=rl&sig=un3ihnU48W%2BrW%2FnAWOvHl%2Fd9djtH7rUx13LlD1Kipe0%3D

Build: https://dev.azure.com/dnceng/public/_build/results?buildId=889822&view=ms.vss-test-web.build-test-results-tab&runId=28458820&resultId=144669&paneView=attachments

cc @steveisok @akoeplinger

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 18, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Nov 18, 2020

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:
[00:03:37] crit: OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:37245/
                    at OpenQA.Selenium.DriverService.Start()
                    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 110
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 53
                    at Microsoft.DotNet.XHarness.Common.CLI.Commands.XHarnessCommand.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.Common/CLI/Commands/XHarnessCommand.cs:line 120
XHarness exit code: 71

Console log: https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-44835-merge-bb0f134359584f1080/System.Text.Encoding.CodePages.Tests/console.1329b837.log?sv=2019-07-07&se=2020-12-07T23%3A45%3A59Z&sr=c&sp=rl&sig=un3ihnU48W%2BrW%2FnAWOvHl%2Fd9djtH7rUx13LlD1Kipe0%3D

Build: https://dev.azure.com/dnceng/public/_build/results?buildId=889822&view=ms.vss-test-web.build-test-results-tab&runId=28458820&resultId=144669&paneView=attachments

cc @steveisok @akoeplinger

Author: ViktorHofer
Assignees: -
Labels:

area-Infrastructure-mono, os-android, untriaged

Milestone: -

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Nov 18, 2020
@ViktorHofer ViktorHofer added this to the 6.0.0 milestone Nov 18, 2020
@steveisok steveisok changed the title Android work items failing with OpenQA.Selenium.WebDriverException Wasm Browser work items failing with OpenQA.Selenium.WebDriverException Nov 18, 2020
@steveisok steveisok added arch-wasm WebAssembly architecture and removed os-android labels Nov 18, 2020
@steveisok
Copy link
Member

@radical Not sure what to make of this

@radical
Copy link
Member

radical commented Nov 18, 2020

Another build with the same failure:

https://dev.azure.com/dnceng/public/_build/results?buildId=890219&view=ms.vss-test-web.build-test-results-tab&runId=28469708&resultId=100001&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

Lots of failed tests there. They seem to be failing with mono assertions, eg:

[03:44:57] info: MONO_WASM: ICU data archive(s) loaded, disabling invariant mode
[03:44:57] info: * Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:4698, condition `<disabled>' not met
[03:44:57] info: * Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:4698, condition `<disabled>' not met
[03:44:57] info: Unhandled exception in _finalize_startup
[03:44:57] fail: [out of order message from the browser]: http://127.0.0.1:35439/index.html?arg=--run&arg=WasmTestRunner.dll&arg=System.Xml.Xsl.XslTransformApi.Tests.dll&arg=-notrait&arg=category%3dIgnoreForCI&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing 0:0 Uncaught ExitStatus: Program terminated with exit(0)

System.Xml.Xsl.XslTransform.Api.Tests

I didn't look at all of them, fyi.

@radical
Copy link
Member

radical commented Nov 18, 2020

@radical Not sure what to make of this

This might be because of a race. I'll investigate.

@steveisok
Copy link
Member

Another build with the same failure:
https://dev.azure.com/dnceng/public/_build/results?buildId=890219&view=ms.vss-test-web.build-test-results-tab&runId=28469708&resultId=100001&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

Lots of failed tests there. They seem to be failing with mono assertions, eg:

[03:44:57] info: MONO_WASM: ICU data archive(s) loaded, disabling invariant mode
[03:44:57] info: * Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:4698, condition `<disabled>' not met
[03:44:57] info: * Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:4698, condition `<disabled>' not met
[03:44:57] info: Unhandled exception in _finalize_startup
[03:44:57] fail: [out of order message from the browser]: http://127.0.0.1:35439/index.html?arg=--run&arg=WasmTestRunner.dll&arg=System.Xml.Xsl.XslTransformApi.Tests.dll&arg=-notrait&arg=category%3dIgnoreForCI&arg=-notrait&arg=category%3dOuterLoop&arg=-notrait&arg=category%3dfailing 0:0 Uncaught ExitStatus: Program terminated with exit(0)

System.Xml.Xsl.XslTransform.Api.Tests

I didn't look at all of them, fyi.

This one is a false positive. It's on a PR that Mitch is fixing. The original listed in this issue is legit, I think.

@lewing
Copy link
Member

lewing commented Nov 20, 2020

Just to make sure I'm reading the exception correctly here, the driver service is just trying to start chrome driver and failing? This is before any of our code is running?

@radical
Copy link
Member

radical commented Nov 20, 2020

Yeah, this is one of the first things the xharness command does:

                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 110
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 53
                    at Microsoft.DotNet.XHarness.Common.CLI.Commands.XHarnessCommand.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.Common/CLI/Commands/XHarnessCommand.cs:line 120
XHarness exit code: 71

It is failing to launch for some reason. Maybe we can retry if we see Cannot start the driver service?

radical added a commit to radical/xharness that referenced this issue Nov 20, 2020
In some test runs, launching chromedriver failed
with (dotnet/runtime#44862):

```
Connection refused Connection refused
Connection refused Connection refused
[00:03:37] crit: OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:37245/
                    at OpenQA.Selenium.DriverService.Start()
                    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 110
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 53
                    at Microsoft.DotNet.XHarness.Common.CLI.Commands.XHarnessCommand.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.Common/CLI/Commands/XHarnessCommand.cs:line 120
XHarness exit code: 71
```

As a way to handle this, we'll retry if the exception message contains
the string `"Cannot start the driver service"`.
@radical
Copy link
Member

radical commented Nov 20, 2020

Opened dotnet/xharness#370 .

premun pushed a commit to dotnet/xharness that referenced this issue Nov 23, 2020
#370)

In some test runs, launching chromedriver failed
with (dotnet/runtime#44862):

```
Connection refused Connection refused
Connection refused Connection refused
[00:03:37] crit: OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:37245/
                    at OpenQA.Selenium.DriverService.Start()
                    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 110
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 53
                    at Microsoft.DotNet.XHarness.Common.CLI.Commands.XHarnessCommand.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.Common/CLI/Commands/XHarnessCommand.cs:line 120
XHarness exit code: 71
```

As a way to handle this, we'll retry if the exception message contains
the string `"Cannot start the driver service"`.
@radical
Copy link
Member

radical commented Nov 24, 2020

@steveisok Has this been seen on any other run? How do we check whether the "fix" helped or not?

@radical
Copy link
Member

radical commented Jul 14, 2021

This can be closed now.

@radical radical closed this as completed Jul 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2021
@ViktorHofer ViktorHofer reopened this Aug 20, 2021
@ViktorHofer
Copy link
Member Author

Still happening: https://dev.azure.com/dnceng/public/_build/results?buildId=1306968&view=ms.vss-test-web.build-test-results-tab&runId=38480032&resultId=173052&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

Saw this in at least one other build this week as well.

Connection refused [::ffff:127.0.0.1]:43191 (localhost:43191)
Connection refused [::ffff:127.0.0.1]:43191 (localhost:43191)
Connection refused [::ffff:127.0.0.1]:43191 (localhost:43191)
Starting ChromeDriver 84.0.4147.0 (ff714bcb10c3356b1b1b2819148507a34fa4b1f8-refs/heads/master@{#768968}) on port 43191
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Connection refused [::ffff:127.0.0.1]:43191 (localhost:43191)
[10:27:16] crit: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
                  ---> OpenQA.Selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
                    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
                    at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
                    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
                    --- End of inner exception stack trace ---
                    at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
                    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
                    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromiumDriver[TDriverOptions,TDriver,TDriverService](String driverName, Func`2 getDriverService, ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 230
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.GetChromeDriver(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 134
                    at Microsoft.DotNet.XHarness.CLI.Commands.Wasm.WasmTestBrowserCommand.InvokeInternal(ILogger logger) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs:line 54
                    at Microsoft.DotNet.XHarness.CLI.Commands.XHarnessCommand`1.Invoke(IEnumerable`1 arguments) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/XHarnessCommand.cs:line 142

@ViktorHofer ViktorHofer added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Aug 20, 2021
@lewing lewing modified the milestones: 6.0.0, 7.0.0 Aug 23, 2021
@krwq
Copy link
Member

krwq commented Sep 30, 2021

Are we using latest xharness on the failing runs? @premun's fix should've fixed this. Perhaps we haven't yet used the latest version on the recent run and it is now fixed?

@premun
Copy link
Member

premun commented Sep 30, 2021

I don't think I was fixing this issue. @radical?

@radical
Copy link
Member

radical commented Sep 30, 2021

Are we using latest xharness on the failing runs? @premun's fix should've fixed this. Perhaps we haven't yet used the latest version on the recent run and it is now fixed?

which fix?

@jakobbotsch
Copy link
Member

I couldn't find a recent failure of this, so will close for now. Let's reopen if we see a new failure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Projects
None yet
Development

No branches or pull requests

8 participants