selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS)

Open nvborisenko opened this issue 1 year ago â€ĸ 34 comments

Description

It has been working, but at some point of time it stopped. I didn't change my code!

But now I always see:

Unhandled exception. OpenQA.Selenium.WebDriverException: Error starting process: E:\Temp\ConsoleApp73\ConsoleApp73\bin\Debug\net9.0\selenium-manager\windows\selenium-manager.exe  --browser "MicrosoftEdge" --language-binding csharp --output json --debug
 ---> OpenQA.Selenium.WebDriverException: Selenium Manager process exited abnormally with 65 code: E:\Temp\ConsoleApp73\ConsoleApp73\bin\Debug\net9.0\selenium-manager\windows\selenium-manager.exe  --browser "MicrosoftEdge" --language-binding csharp --output json --debug
Standard Output >>
{
  "logs": [
    {
      "level": "DEBUG",
      "timestamp": 1752870644,
      "message": "msedgedriver not found in PATH"
    },
    {
      "level": "DEBUG",
      "timestamp": 1752870644,
      "message": "MicrosoftEdge detected at C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
    },
    {
      "level": "DEBUG",
      "timestamp": 1752870644,
      "message": "Detected browser: MicrosoftEdge 138.0.3351.95"
    },
    {
      "level": "DEBUG",
      "timestamp": 1752870644,
      "message": "Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS"
    },
    {
      "level": "ERROR",
      "timestamp": 1752870645,
      "message": "error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS)\n\nCaused by:\n    0: client error (Connect)\n    1: dns error: No such host is known. (os error 11001)\n    2: No such host is known. (os error 11001)"
    }
  ],
  "result": {
    "code": 65,
    "message": "error sending request for url (https://msedgedriver.azureedge.net/LATEST_RELEASE_138_WINDOWS)\n\nCaused by:\n    0: client error (Connect)\n    1: dns error: No such host is known. (os error 11001)\n    2: No such host is known. (os error 11001)",
    "driver_path": "",
    "browser_path": ""
  }
}

<<

   at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)
   --- End of inner exception stack trace ---
   at OpenQA.Selenium.SeleniumManager.RunCommand(String fileName, String arguments)
   at OpenQA.Selenium.SeleniumManager.BinaryPaths(String arguments)
   at OpenQA.Selenium.DriverFinder.BinaryPaths()
   at OpenQA.Selenium.DriverFinder.GetDriverPath()
   at OpenQA.Selenium.Chromium.ChromiumDriver.GenerateDriverServiceCommandExecutor(DriverService service, DriverOptions options, TimeSpan commandTimeout)
   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 OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeOptions options)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor()

Reproducible Code

using OpenQA.Selenium.Edge;

using var driver = new EdgeDriver();

â„šī¸ Last known working version: 4.34.0

nvborisenko avatar Jul 18 '25 20:07 nvborisenko

@nvborisenko, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

selenium-ci avatar Jul 18 '25 20:07 selenium-ci

I searched similar issues by error sending request for url, but didn't find something similar.

Most likely this is something related to configuration.

nvborisenko avatar Jul 18 '25 20:07 nvborisenko

msedgedriver.azureedge.net does not resolve to an ip address

Cyber5imon avatar Jul 20 '25 00:07 Cyber5imon

As a workaround, I've just set the environment variable "SE_DRIVER_MIRROR_URL" to the proper url: "https://msedgedriver.microsoft.com"

DamonKBrown avatar Jul 21 '25 04:07 DamonKBrown

I hit this issue as well. I'm commenting to track it.

AutomationPanda avatar Jul 21 '25 12:07 AutomationPanda

I'm commenting to track it

It has already been fixed, and a workaround has been given until the fix is released. https://github.com/SeleniumHQ/selenium/issues/16058#issuecomment-3078368659

cgoldberg avatar Jul 21 '25 12:07 cgoldberg

Assuming the fix is ready, could we plan to roll it out to all users?

nvborisenko avatar Jul 22 '25 21:07 nvborisenko

As a workaround, I've just set the environment variable "SE_DRIVER_MIRROR_URL" to the proper url: "https://msedgedriver.microsoft.com"

Just putting it on the record. This workaround does not address solutions where an instance each of Chrome and Edge are being used in the Tests.

The workaround assumes only one Browser is used in the testing flow.

dhavewala avatar Jul 23 '25 06:07 dhavewala

This workaround does not address solutions where an instance each of Chrome and Edge are being used in the Tests.

That's a good point.

I don't use .NET, but here are some other workarounds in Python:

  1. You could set the environment variable in code, and reset it after you instantiate the browser (this wouldn't work if you run tests in parallel).
import os
from selenium import webdriver

os.environ["SE_DRIVER_MIRROR_URL"] = "https://msedgedriver.microsoft.com"
driver = webdriver.Edge()
del os.environ["SE_DRIVER_MIRROR_URL"]
  1. You could pass the --driver-mirror-url argument when starting Selenium Manager. I couldn't find anywhere this is exposed, so the solution I came up with involves monkey patching:
from selenium import webdriver
from selenium.webdriver.common.driver_finder import DriverFinder

def _to_args(self):
    return ["--browser", "edge", "--driver-mirror-url", "https://msedgedriver.microsoft.com"]

DriverFinder._to_args = _to_args

driver = webdriver.Edge()

Note: none of these workarounds are ideal, and hopefully the fix rolls out soon.

cgoldberg avatar Jul 23 '25 13:07 cgoldberg

A workaround for .NET if you are using an old version of selenium and not plan to upgrade it:

  1. Download latest Selenium Manager release from: https://github.com/SeleniumHQ/selenium_manager_artifacts
  2. Replace the selenium-manager.exe under your application directory like C:\MyApp\selenium-manager\windows\selenium-manager.exe with just downloaded one. Note use the right OS version, and backup the file before replace.
  3. (Optional) Run selenium-manager.exe --browser edge --debug to trigger a download for the appropriate browser driver.

kaedei avatar Jul 23 '25 15:07 kaedei

Use SE_EDGE_MIRROR_URL instead of SE_DRIVER_MIRROR_URL to set the driver mirror URL exclusively for Edge. There is also SE_CHROME_MIRROR_URL for Chrome. I suspect there might be env vars for other browsers, but I'd need to check the source code.

AutomationPanda avatar Jul 23 '25 17:07 AutomationPanda

Use SE_EDGE_MIRROR_URL instead of SE_DRIVER_MIRROR_URL to set the driver mirror URL exclusively for Edge.

Nice. These seem to be undocumented

cgoldberg avatar Jul 23 '25 18:07 cgoldberg

Use SE_EDGE_MIRROR_URL instead of SE_DRIVER_MIRROR_URL to set the driver mirror URL exclusively for Edge. There is also SE_CHROME_MIRROR_URL for Chrome. I suspect there might be env vars for other browsers, but I'd need to check the source code.

The same problem persist for Java implementation as well.

Once I set System.setProperty("SE_DRIVER_MIRROR_URL", "https://msedgedriver.microsoft.com"); then it works.

But setting of SE_EDGE_MIRROR_URL seems doesn't make any effects and it still fails.

ihar-zhukau avatar Jul 24 '25 21:07 ihar-zhukau

But setting of SE_EDGE_MIRROR_URL seems doesn't make any effects and it still fails

Yea, I just verified SE_EDGE_MIRROR_URL has no effect on where it requests the driver from (It also had no effect on where it requests the browser from). So I have no idea where @AutomationPanda got such information.

cgoldberg avatar Jul 24 '25 22:07 cgoldberg

Sourced from here: https://www.selenium.dev/documentation/selenium_manager/

Browser mirror. Following the same pattern, we can use chrome-mirror-url, firefox-mirror-url, edge-mirror-url, etc. (in the configuration file), and SE_CHROME_MIRROR_URL, SE_FIREFOX_MIRROR_URL, SE_EDGE_MIRROR_URL, etc. (as environment variables).

AutomationPanda avatar Jul 25 '25 01:07 AutomationPanda

Browser mirror

OK... so to work around this, you would set the "Driver mirror", not "Browser mirror". The following would fix it for Edge only and not affect other browsers:

SE_MSEDGEDRIVER_MIRROR_URL=https://msedgedriver.microsoft.com

Oddly, the "Browser mirror" environment variables don't seem to work. You can set the following, and it will download Edge and EdgeDriver just fine without throwing an error:

SE_EDGE_MIRROR_URL=https://bad_domain.com SE_MSEDGEDRIVER_MIRROR_URL=https://msedgedriver.microsoft.com

I guess that's an unrelated bug.

cgoldberg avatar Jul 25 '25 02:07 cgoldberg

Thank you for clarifying.

The wild thing is that when I set SE_EDGE_MIRROR_URL in my Azure DevOps pipeline, it actually made my tests work. That's why I posted my comments above.

I edited my pipeline to use SE_MSEDGEDRIVER_MIRROR_URL instead. That (also) worked.

🤷đŸģâ€â™‚ī¸

AutomationPanda avatar Jul 25 '25 03:07 AutomationPanda

Thank you for clarifying.

The wild thing is that when I set SE_EDGE_MIRROR_URL in my Azure DevOps pipeline, it actually made my tests work. That's why I posted my comments above.

I edited my pipeline to use SE_MSEDGEDRIVER_MIRROR_URL instead. That (also) worked.

🤷đŸģâ€â™‚ī¸ Can you elaborate on how this is accomplished?

I think we are encountering a similar issue when running under .Net with Azure pipelines. Tests run in Azure Pipelines with Microsoft hosted agents and the Chrome browser have no issues, but under the same pipeline with Edge Chromium and the tests fail due to a timeout creating an instance of the EdgeDriverService (stack trace below). Even more interesting is that running the pipeline for the same tests with an on-prem agent and we have no issues.

Create â–ē OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:55913/session timed out after 120 seconds.
  ---> System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 120 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: The I/O operation has been aborted because of either a thread exit or an application request..
  ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
    --- 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.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.HttpConnection.SendAsync(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.ExecuteAsync(Command commandToExecute)
    --- End of inner exception stack trace ---
    at OpenQA.Selenium.Remote.HttpCommandExecutor.ExecuteAsync(Command commandToExecute)
    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.ExecuteAsync(Command commandToExecute)
    at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary`2 parameters)
    at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
    at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
    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)

ms6073 avatar Jul 25 '25 15:07 ms6073

@ms6073

Set the SE_MSEDGEDRIVER_MIRROR_URL environment variable to https://msedgedriver.microsoft.com

cgoldberg avatar Jul 25 '25 16:07 cgoldberg

SE_MSEDGEDRIVER_MIRROR_URL

Thanks, unfortunately I am not quite sure of the mechanics of how this change should be affected. We are using NuGet package references in a .Net 9 solution and we only observe the issue when using Microsoft Hosted agents running Windows. So does this change need to be done to an environment variable on the agent? I am also curious why it works when the pipeline is run against an on-prem agent vs the MS hosted agents.

ms6073 avatar Jul 25 '25 16:07 ms6073