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

Microsoft Edge WebDriver 115+ fails to launch browser with "cannot find msedge binary" on Linux #102

Closed
nkns165 opened this issue Aug 3, 2023 · 14 comments
Labels
bug Something isn't working tracked This issue is now tracked on our internal backlog

Comments

@nkns165
Copy link

nkns165 commented Aug 3, 2023

Summary

Microsoft Edge WebDriver 115 itself successfully starts, but when I start a session with it, it cannot launch Microsoft Edge browser and stops at the error like

{"error": "unknown error", "message": "unknown error: cannot find msedge binary"}

Environment

  • Browser (Microsoft Edge) Version: 115.0.1901.188
  • Driver Version: 115.0.1901.188
  • OS: Ubuntu 20.04

I confirmed that the problem doesn't happen on Windows and macOS.
Also, it doesn't happen on Ubuntu with Driver Version 114.0.1823.82.

How to reproduce

I was able to reproduce the problem on a Docker container with image ubuntu:20.04.

apt update
apt install software-properties-common apt-transport-https wget curl git unzip -y
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | apt-key add -
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list'
apt update
apt install microsoft-edge-stable -y
microsoft-edge --version
wget https://msedgedriver.azureedge.net/115.0.1901.188/edgedriver_linux64.zip
unzip edgedriver_linux64.zip
./msedgedriver &
curl http://localhost:9515/status
curl -X POST http://localhost:9515/session -d '{"capabilities": {"browserName": "MicrosoftEdge"}}'

Here, I've got the error message described above.
I've confirmed the browser is surely installed by the following command (I've got Microsoft Edge 115.0.1901.188).

microsoft-edge --version

Next, I've checked the behavior of Driver Version 114.0.1823.82.

mv msedgedriver msedgedriver-115
wget https://msedgedriver.azureedge.net/114.0.1823.82/edgedriver_linux64.zip
unzip edgedriver_linux64.zip
./msedgedriver &
curl -X POST http://localhost:9515/session -d '{"capabilities": {"browserName": "MicrosoftEdge"}}'

I've got another error message, but this is because I've not set up the other required components like Xvfb. At least, the browser tried to launch once. So the problem is limited within version 115.

{"error": "unknown error", "message": "unknown error: MicroSoft Edge failed to start: exited abnormally. (omitted)"}

Other

I guess this issue is similar to https://bugs.chromium.org/p/chromium/issues/detail?id=1466427 where ChromeDriver couldn't find Chrome binary (the issue was limited to macOS, though).

When we tried Microsoft Edge WebDriver 115 where both MicroSoft Edge and Chrome exist, we've got a different error message.

{"error": "unknown error", "message": "unknown error: unknown error: unrecognized Microsoft Edge version: Chrome/115.0.5790.110"}

AB#45872325

@nkns165 nkns165 added the bug Something isn't working label Aug 3, 2023
@amardeep2006
Copy link

I faced the same issue with Edge Version 115.
The behavior is explained here . SeleniumHQ/docker-selenium#1910

@Wolfe1
Copy link

Wolfe1 commented Aug 7, 2023

Same issue with Edge 115, downgrade to 114 mitigates for now.

@bwalderman
Copy link
Member

Thank you for reporting this. I've added it to our internal backlog for investigation.

@joeyparrish
Copy link

I noticed that msedgedriver 115.0.1901.203 on Linux actually launches /opt/google/chrome/chrome instead of /opt/microsoft/msedge/msedge. The same is true of 116.0.1938.51 and 117.0.2033.0, but not 114.0.1823.82.

I hope that helps!

joeyparrish added a commit to joeyparrish/webdriver-installer that referenced this issue Aug 18, 2023
Work around MicrosoftEdge/EdgeWebDriver#102,
in which Linux versions of msedgedriver launch Chrome instead of Edge
starting with version 115.  For now, driver version 114 is working for
Edge 115 on Linux.

This does not appear to affect other platforms.
@joeyparrish
Copy link

For now, all our automation will have to use msedgedriver 114 for any Edge version 115+. (See shaka-project/webdriver-installer#32) I suspect this will not be a viable workaround forever, since newer Edge releases might not be able to communicate with older drivers if something in the protocol changes. Please let us know if we can expect a fix before that happens. Thanks!

joeyparrish added a commit to shaka-project/webdriver-installer that referenced this issue Aug 18, 2023
Work around MicrosoftEdge/EdgeWebDriver#102,
in which Linux versions of msedgedriver launch Chrome instead of Edge
starting with version 115. For now, driver version 114 is working for
Edge 115 on Linux.

This does not appear to affect other platforms.
@nkns165
Copy link
Author

nkns165 commented Aug 21, 2023

@joeyparrish Thank you for your additional information. Also, thanks to actions/runner-images#8046 I learned that the previous version 115.0.1901.183 works well for Edge 115. It can be another workaround.

But as for Edge 116+, I have the same concern with #102 (comment). I hope it will be fixed soon.

@nkns165
Copy link
Author

nkns165 commented Sep 1, 2023

@bwalderman Is there any update? I've confirmed that the latest version 116.0.1938.69 still has the same problem.
Now we cannot upgrade Edge in our test environment...

@nkns165 nkns165 changed the title Microsoft Edge WebDriver 115 fails to launch browser with "cannot find msedge binary" on Linux Microsoft Edge WebDriver 115+ fails to launch browser with "cannot find msedge binary" on Linux Sep 1, 2023
@joeyparrish
Copy link

Edge 116 is out on GitHub VMs, and the workaround of using driver version 114 no longer works:

session not created: This version of Microsoft Edge WebDriver only supports Microsoft Edge version 114
Current browser version is 116.0.1938.69 with binary path /usr/bin/microsoft-edge

Feeling good about my prediction 3 weeks ago that 116 could break things...

Any comment from Microsoft on the observation that msedgedriver wants to run /opt/google/chrome/chrome? It seems like if there's a mistaken path in msedgedriver, that should be relatively easy to fix, right?

Another workaround that still works: In your capabilities request, specify "ms:edgeOptions": { "binary": "/usr/bin/microsoft-edge" }

joeyparrish added a commit to shaka-project/webdriver-installer that referenced this issue Sep 7, 2023
For a better workaround, specify the path to the Edge binary in your
capabilities request with:

"ms:edgeOptions": {"binary": "/usr/bin/microsoft-edge"}

See also
MicrosoftEdge/EdgeWebDriver#102 (comment)
joeyparrish added a commit to joeyparrish/karma-local-wd-launcher that referenced this issue Sep 7, 2023
Specify the explicit path to microsoft-edge if found, to work around
MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35 to revert a
previous workaround at that level.
joeyparrish added a commit to joeyparrish/karma-local-wd-launcher that referenced this issue Sep 7, 2023
Specify the explicit path to microsoft-edge if found, to work around
MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35 to revert a
previous workaround at that level.
joeyparrish added a commit to shaka-project/karma-local-wd-launcher that referenced this issue Sep 7, 2023
Specify the explicit path to microsoft-edge if found, to work around
MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35 to revert a
previous workaround at that level.
joeyparrish added a commit to joeyparrish/shaka-player that referenced this issue Sep 7, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around
MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35 and
shaka-project/karma-local-wd-launcher#60 to
revert earlier workarounds and apply new ones for local test runs.
joeyparrish added a commit to joeyparrish/shaka-player that referenced this issue Sep 8, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around
MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35 and
shaka-project/karma-local-wd-launcher#60 to
revert earlier workarounds and apply new ones for local test runs.
joeyparrish added a commit to shaka-project/shaka-player that referenced this issue Sep 8, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
joeyparrish added a commit to shaka-project/shaka-player that referenced this issue Sep 8, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
joeyparrish added a commit to shaka-project/shaka-player that referenced this issue Sep 8, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
@tkoukkari
Copy link

Edge 116 is out on GitHub VMs, and the workaround of using driver version 114 no longer works:

session not created: This version of Microsoft Edge WebDriver only supports Microsoft Edge version 114
Current browser version is 116.0.1938.69 with binary path /usr/bin/microsoft-edge

Feeling good about my prediction 3 weeks ago that 116 could break things...

Any comment from Microsoft on the observation that msedgedriver wants to run /opt/google/chrome/chrome? It seems like if there's a mistaken path in msedgedriver, that should be relatively easy to fix, right?

Another workaround that still works: In your capabilities request, specify "ms:edgeOptions": { "binary": "/usr/bin/microsoft-edge" }

Just to highlight that this combination still works:

Browser version: 116.0.1938.69
Edgedriver version: 115.0.1901.183 (db29db5e66a28f9f889ff1962ead6e0c377200e0)

...but probably only until Edge 117. It seems that whatever was changed in driver version 115.0.1901.188 caused this. Any chance of reviewing those changes and maybe reverting the one that is causing this?

@Prajakta365
Copy link

facing same issue for edge driver version 117.0.2045.35
ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: unrecognized Microsoft Edge version: HeadlessChrome/117.0.5938.88 ERROR webdriver: unknown error: unknown error: unrecognized Microsoft Edge version: HeadlessChrome/117.0.5938.88

@bwalderman
Copy link
Member

Hi folks. Sorry for the delays in addressing this. We've fixed the issue in msedgedriver and the fix will be available on the Edge Canary channel within a day or two. We're also working to backport this change to the Beta and Stable channels, which will take an additional few days.

Until the fix lands, you can work around this issue on Linux by setting the browser binary location in your EdgeOptions to /usr/bin/microsoft-edge explicitly.

@merinsTDL
Copy link

Good day!
Still getting the same error:
Platform: Linux AMD64 (Ubuntu Jammy)
MS Edge: 119.0.2109.1-1 (microsoft-edge-dev)
Driver: 119.0.2109.1 (https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/119.0.2109.1/edgedriver_linux64.zip)
Error when starting the driver: 500. Message: unknown error: cannot find msedge binary

echoy-harmonicinc pushed a commit to harmonicinc-com/shaka-player that referenced this issue Sep 27, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
# Conflicts:
#	build/shaka-lab.yaml
#	package-lock.json
#	package.json
echoy-harmonicinc pushed a commit to harmonicinc-com/shaka-player that referenced this issue Sep 27, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
# Conflicts:
#	build/shaka-lab.yaml
#	package-lock.json
#	package.json
echoy-harmonicinc added a commit to harmonicinc-com/shaka-player that referenced this issue Sep 27, 2023
* ci: Fix Chrome tests on Windows in GitHub Actions (shaka-project#5548)

GitHub started installing "Chrome for Testing" builds on Windows and
Mac. Unfortunately, these builds don't have support for H264 and AAC
codecs, which we need in our tests.

This fixes the issue by explicitly installing an official build of
Chrome on Windows, to overwrite the "Chrome for Testing" build.
# Conflicts:
#	.github/workflows/build-and-test.yaml

* ci: Work around msedgedriver 115+ bug (shaka-project#5618)

Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
# Conflicts:
#	build/shaka-lab.yaml
#	package-lock.json
#	package.json

---------

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
@Goraved
Copy link

Goraved commented Sep 28, 2023

Any updates on this? This issue really blocks us from using Edge > 114 version

@renataknowhow
Copy link

Any updates on this guys? It's being broke for more than a month already. @jayhome I tried to pull selenium node edge, integrate in a CI/CD environment, it didn't fix the error 'E selenium.common.exceptions.WebDriverException: Message: unknown error: unrecognized Microsoft Edge version: Chrome/117.0.5938.0'.

bonigarcia added a commit to bonigarcia/selenium-webdriver-java that referenced this issue Oct 31, 2023
bonigarcia added a commit to bonigarcia/selenium-webdriver-java that referenced this issue Oct 31, 2023
Robloche pushed a commit to Robloche/shaka-player that referenced this issue Nov 30, 2023
Specify the explicit path to microsoft-edge on Linux if found, to work around MicrosoftEdge/EdgeWebDriver#102 (comment)

This also incorporates
shaka-project/webdriver-installer#35, shaka-project/karma-local-wd-launcher#60, and shaka-project/karma-local-wd-launcher#62 to revert earlier workarounds and apply new ones for local test runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked This issue is now tracked on our internal backlog
Projects
None yet
Development

No branches or pull requests

10 participants