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

"Creating the web driver failed" exception recently on GitHub-hosted Linux runners for Edge (OSOE-668) #306

Closed
Piedone opened this issue Aug 7, 2023 · 6 comments · Fixed by #308
Assignees
Labels
bug Something isn't working

Comments

@Piedone
Copy link
Member

Piedone commented Aug 7, 2023

Only on GitHub-hosted Linux runners (not Windows ones, and at least not locally happening under Windows 11 either) OSOCE UI testing is stuck on this error:

 OpenQA.Selenium.WebDriverException : Creating the web driver failed with the message "The HTTP request to the remote WebDriver server for URL http://localhost:39077/session timed out after 60 seconds.". This can mean that there is a leftover web driver process that you have to kill manually. Full exception: OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:39077/session timed out after 60 seconds.
 ---> System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.
 ---> System.TimeoutException: The operation was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
 ---> System.Net.Sockets.SocketException (125): Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   --- End of inner exception stack trace ---
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options)
   at Lombiq.Tests.UI.Services.WebDriverFactory.<>c__DisplayClass2_0.<CreateEdgeDriver>b__0() in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 72
   at Lombiq.Tests.UI.Services.WebDriverFactory.CreateDriver[TDriver](String browserName, Func`1 driverFactory) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 169
---- OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:39077/session timed out after 60 seconds.
-------- System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.
------------ System.TimeoutException : The operation was canceled.
---------------- System.Threading.Tasks.TaskCanceledException : The operation was canceled.
-------------------- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
------------------------ System.Net.Sockets.SocketException : Operation canceled
  Stack Trace:
     at Lombiq.Tests.UI.Services.WebDriverFactory.CreateDriver[TDriver](String browserName, Func`1 driverFactory) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 173
   at Lombiq.Tests.UI.Services.WebDriverFactory.CreateEdgeDriver(BrowserConfiguration configuration, TimeSpan pageLoadTimeout) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 61
   at Lombiq.Tests.UI.Services.AtataFactory.<CreateDriver>g__From|2_0[T](Func`3 factory, <>c__DisplayClass2_0& ) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/AtataFactory.cs:line 66
   at Lombiq.Tests.UI.Services.AtataFactory.CreateDriver(BrowserConfiguration browserConfiguration, TimeoutConfiguration timeoutConfiguration, ITestOutputHelper testOutputHelper) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/AtataFactory.cs:line 86
   at Lombiq.Tests.UI.Services.AtataFactory.StartAtataScope(ITestOutputHelper testOutputHelper, Uri baseUri, OrchardCoreUITestExecutorConfiguration configuration) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/AtataFactory.cs:line 33
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.CreateContextAsync() in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutionSession.cs:line 635
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.SetupAsync() in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutionSession.cs:line 498
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.ExecuteAsync(Int32 retryCount, String dumpRootPath) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutionSession.cs:line 95
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.ExecuteAsync(Int32 retryCount, String dumpRootPath) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutionSession.cs:line 136
   at Lombiq.Tests.UI.Services.UITestExecutionSession`1.ExecuteAsync(Int32 retryCount, String dumpRootPath) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutionSession.cs:line 149
   at Lombiq.Tests.UI.Services.UITestExecutor.ExecuteOrchardCoreTestInnerAsync[TEntryPoint](UITestManifest testManifest, OrchardCoreUITestExecutorConfiguration configuration, String dumpRootPath) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutor.cs:line 83
   at Lombiq.Tests.UI.Services.UITestExecutor.ExecuteOrchardCoreTestInnerAsync[TEntryPoint](UITestManifest testManifest, OrchardCoreUITestExecutorConfiguration configuration, String dumpRootPath) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/UITestExecutor.cs:line 83
   at Lombiq.Tests.UI.OrchardCoreUITestBase`1.ExecuteTestAsync(Func`2 testAsync, Browser browser, Func`2 setupOperation, Func`2 changeConfigurationAsync) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/OrchardCoreUITestBase.cs:line 261
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options, TimeSpan commandTimeout)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options)
   at Lombiq.Tests.UI.Services.WebDriverFactory.<>c__DisplayClass2_0.<CreateEdgeDriver>b__0() in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 72
   at Lombiq.Tests.UI.Services.WebDriverFactory.CreateDriver[TDriver](String browserName, Func`1 driverFactory) in /home/runner/work/Open-Source-Orchard-Core-Extensions/Open-Source-Orchard-Core-Extensions/test/Lombiq.UITestingToolbox/Lombiq.Tests.UI/Services/WebDriverFactory.cs:line 169
----- Inner Stack Trace -----
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
----- Inner Stack Trace -----

----- Inner Stack Trace -----
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
----- Inner Stack Trace -----
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
----- Inner Stack Trace -----

Jira issue

@Piedone Piedone added the bug Something isn't working label Aug 7, 2023
@Piedone
Copy link
Member Author

Piedone commented Aug 7, 2023

@DAud-IcI is this something you could also please look into?

@github-actions github-actions bot changed the title "Creating the web driver failed" exception recently on GitHub-hosted Linux runners "Creating the web driver failed" exception recently on GitHub-hosted Linux runners (OSOE-668) Aug 7, 2023
@Piedone Piedone changed the title "Creating the web driver failed" exception recently on GitHub-hosted Linux runners (OSOE-668) "Creating the web driver failed" exception recently on GitHub-hosted Linux runners for Edge (OSOE-668) Aug 8, 2023
@Piedone
Copy link
Member Author

Piedone commented Aug 10, 2023

@DAud-IcI?

@sarahelsaig
Copy link
Member

I will check it out this weekend.

@sarahelsaig sarahelsaig self-assigned this Aug 11, 2023
@Piedone
Copy link
Member Author

Piedone commented Aug 11, 2023

Thanks!

@sarahelsaig
Copy link
Member

Turns out the problem was with msedgedriver itself. I'm not sure why it suddenly popped up, but (after much setup) thankfully I managed to locally repro it in my Linux setup locally.

It looks like when the driver can't find the correct binary name it defaults back to /usr/bin/chromium for whatever reason. On Windows the binary is always msedge.exe so that's easy. I assume that's what the driver looks for on other systems too, but in Linux (including ubuntu-latest on GH) it's actually microsoft-edge-stable.

@Piedone
Copy link
Member Author

Piedone commented Aug 14, 2023

Great catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants