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

[🐛 Bug]: Couldn't find a matching Chrome browser for tag ${tag} on platform ${platform} #10968

Closed
3 tasks done
jacekcho opened this issue Aug 18, 2023 · 52 comments
Closed
3 tasks done
Labels
Bug 🐛 Needs Investigation Issues that require more information on the problem.

Comments

@jacekcho
Copy link

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

16

Mode

Standalone Mode

Which capabilities are you using?

{
        browserName: 'chrome',
}

What happened?

tests are not run, an error is displayed: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "mac_arm"

This error is showing on my machine (and other members of my team on linux/intel mac/Mac M1) for a project that was generated according to: https://webdriver.io/docs/gettingstarted

npm init wdio .

package.json:
package.txt

wdio.conf.js:
wdio_conf.txt

What is your expected behavior?

The chromedriver is downloaded and the browser is launched

How to reproduce the bug.

create a new project:

npm init wdio .

Installing @wdio/cli to initialize project...
✔ Success!

===============================
🤖 WDIO Configuration Wizard 🧙

? What type of testing would you like to do? E2E Testing - of Web or Mobile Applications
? Where is your automation backend located? On my local machine
? Which environment you would like to automate? Web - web applications in the browser
? With which browser should we start? Chrome
? Which framework do you want to use? Mocha (https://mochajs.org/)
? Do you want to use a compiler? Babel (https://babeljs.io/)
? Do you want WebdriverIO to autogenerate some test files? Yes
? Where should these files be located? /Users/user/workspace/tmp/wdio-tmp--v8/test/specs//*.js
? Do you want to use page objects (https://martinfowler.com/bliki/PageObject.html)? Yes
? Where are your page objects located? /Users/user/workspace/tmp/wdio-tmp--v8/test/pageobjects/
/*.js
? Which reporter do you want to use? spec
? Do you want to add a plugin to your test setup? wait-for
? Do you want to add a service to your test setup?
? What is the base url? http://localhost
? Do you want me to run npm install Yes

Setting up Babel project...
✔ Success!

Installing wdio packages:

  • @wdio/local-runner@latest
  • @wdio/mocha-framework@latest
  • @wdio/spec-reporter@latest
  • wdio-wait-for
  • @babel/register
  • @babel/core
  • @babel/preset-env

added 226 packages, and audited 754 packages in 11s

103 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
✔ Success!

Creating a WebdriverIO config file...
✔ Success!

Autogenerating test files...
✔ Success!

Adding "wdio" script to package.json.
✔ Success!

🤖 Successfully setup project at /Users/user/workspace/tmp/wdio-tmp--v8 🎉

Relevant log output

npm run wdio

Execution of 1 workers started at 2023-08-18T11:07:57.632Z

2023-08-18T11:07:57.643Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-08-18T11:07:57.643Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2023-08-18T11:07:57.675Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2023-08-18T11:07:57.862Z INFO webdriver: Downloading Chromedriver v116.0.5845.96
2023-08-18T11:07:58.124Z WARN webdriver: Couldn't download Chromedriver v116.0.5845.96: unable to get local issuer certificate, trying to find known good version...
2023-08-18T11:07:58.133Z INFO @wdio/local-runner: Shutting down spawned worker
2023-08-18T11:07:58.386Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-08-18T11:07:58.387Z INFO @wdio/local-runner: shutting down
Error: Error: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "mac_arm"
    at setupChrome (file:///Users/user/workspace/tmp/wdio-tmp--v8/node_modules/@wdio/utils/build/driver/utils.js:102:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Launcher.run (file:///Users/user/workspace/tmp/wdio-tmp--v8/node_modules/@wdio/cli/build/launcher.js:98:13)
Error: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "mac_arm"
    at setupChrome (file:///Users/user/workspace/tmp/wdio-tmp--v8/node_modules/@wdio/utils/build/driver/utils.js:102:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Launcher.run (file:///Users/user/workspace/tmp/wdio-tmp--v8/node_modules/@wdio/cli/build/launcher.js:98:13)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues
@jacekcho jacekcho added Bug 🐛 Needs Triaging ⏳ No one has looked into the issue yet labels Aug 18, 2023
@christian-bromann
Copy link
Member

@jacekcho are you behind a corporate proxy?

@christian-bromann christian-bromann added Information Missing and removed Needs Triaging ⏳ No one has looked into the issue yet labels Aug 18, 2023
@jacekcho
Copy link
Author

jacekcho commented Aug 18, 2023 via email

@christian-bromann
Copy link
Member

Can you try setting HTTP_PROXY or HTTPS_PROXY as environment variable pointing to the proxy and see if this resolves the problem?

@jacekcho
Copy link
Author

Sorry my bad... We use vpn not proxy...

@christian-bromann
Copy link
Member

We use vpn not proxy..

What does that mean? Can you guarantee that your Node.js environment can access the internet?

@jacekcho
Copy link
Author

Yes, I can confirm that. until today we used selenium-standalone-servrer and wdio 7. but after today update to chrome 116 chromedriver version 114 stopped working so i wanted to update the project to wdio 8 and remove selenium standalone server

@sumanthpfs
Copy link

I have the same issue on my Mac(M1) but once I got off the VPN it started working. Also, I'm not sure why my webdriver is trying to use chromedriver v.118 when I pinned my chromedriver to v.115?
I ran my tests on debug when this occurred - may be debug tries to download a dev version of the Chromedriver...
INFO webdriver: Using Chromedriver v118.0.5960.0 from cache directory /var/folders/7z/k_skq4fd6ygc7kf4qgzfmpqc0000gq/T

@christian-bromann
Copy link
Member

when I pinned my chromedriver to v.115?

How did you pinned your Chromedriver?

@sumanthpfs
Copy link

as one of the devDependencies in package.json
"chromedriver": "^115.0.0",

@christian-bromann
Copy link
Member

@sumanthpfs if you use latest WebdriverIO this package won't be used anymore. Instead you can define in your capabilities the Chrome browser version, read more on this in the docs: https://webdriver.io/docs/capabilities#automate-different-browser-channels

@jacekcho
Copy link
Author

@christian-bromann setting the browser version according to the new approach for wdio8 will start an attempt to download it, which will end with the error described in this thread:
Couldn't find a matching Chrome browser for tag ${tag} on platform ${platform}

I did some tests and I confirm that for wdio-7 launching the browser with usage:
"wdio-chromedriver-service": "^8.1.1",
"chromedriver": "^116.0.0",

works fine (tests run and everything works)

it seems that in some cases the chromedriver download mechanism used for wdio8 doesn't work properly...

@sumanthpfs
Copy link

@sumanthpfs if you use latest WebdriverIO this package won't be used anymore. Instead you can define in your capabilities the Chrome browser version, read more on this in the docs: https://webdriver.io/docs/capabilities#automate-different-browser-channels

I was under the assumption it only takes the Chrome browser version and not the chromedriver version but I got it now, thanks.

@vknightCHG
Copy link

My team is running into this as well. However, with the exact same code base the people using a mac run into it while I'm not having this issue running this in windows. Once we had them turn off the ZScaler Internet Security it was able to start working for them. So that would be a similar issue as the VPN issue @sumanthpfs ran into.

@sunkarabhargava
Copy link

similar issue on windows machine as well.
image

@jacekcho
Copy link
Author

To sum up (and adding more logs)

running locally in my case I get the error:

2023-08-21T13:08:35.845Z WARN webdriver: Couldn't download Chromedriver v116.0.5845.96: unable to get local issuer certificate, trying to find known good version...
2023-08-21T13:08:36.094Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-08-21T13:08:36.094Z INFO @wdio/local-runner: shutting down
Error: Error: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "mac_arm"

running on gitlab fails with an error:

2023-08-21T13:25:45.231Z INFO @wdio/local-runner: Shutting down spawned worker
2023-08-21T13:25:45.233Z WARN webdriver: Couldn't download Chromedriver v116.0.5845.96: Download failed: server returned code 403. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip, trying to find known good version...
2023-08-21T13:25:45.481Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-08-21T13:25:45.482Z INFO @wdio/local-runner: shutting down
Error: Error: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "linux"

@christian-bromann
Copy link
Member

@jacekcho If you test https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip you will see that it resolves properly to the Chromedriver resource. Is your GitLab instance behind a corporate proxy?

unable to get local issuer certificate

I am not sure where this error comes from, I raised an issue in the upstream dependency.

@tkmcmaster
Copy link

Upgrading to the latest webdriverio is giving me this same error. I'm on a corporate VPN as well. I never had any issues the old way doing npm install chromedriver. Manually running wget I get:

wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip
--2023-08-23 07:23:53--  https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip
Resolving edgedl.me.gvt1.com (edgedl.me.gvt1.com)... 146.112.45.154, 146.112.45.175, 146.112.45.33, ...
Connecting to edgedl.me.gvt1.com (edgedl.me.gvt1.com)|146.112.45.154|:443... connected.
ERROR: cannot verify edgedl.me.gvt1.com's certificate, issued by ‘CN=Cisco Umbrella Secondary SubCA dfw-SG,O=Cisco’:
  Unable to locally verify the issuer's authority.

@christian-bromann
Copy link
Member

@tkmcmaster Can you try setting HTTP_PROXY or HTTPS_PROXY as environment variable pointing to the proxy and see if this resolves the problem?

@tkmcmaster
Copy link

tkmcmaster commented Aug 23, 2023

As far as I can tell, from a browser it's all "DIRECT" for the proxy. Even turning on logging (chrome://net-export/) I get "direct". I tried everything from https://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using. I'm using Ubuntu 20.04 on WSL/Windows 10 but it's failing on both Windows and on WSL.

netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

....
npm run integration
Execution of 3 workers started at 2023-08-23T18:03:18.949Z

2023-08-23T18:03:19.912Z WARN webdriver: Couldn't download Chromedriver v116.0.5
845.98: unable to get local issuer certificate, trying to find known good versio
n...
Error: Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.emit (node:domain:489:12)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12)
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.emit (node:domain:489:12)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

@jmdecide
Copy link

Same issue for me, im using Windows 11 and testing an electron app. If i dont specify browserVersion, it installs chromedriver 116 correctly, but since we are using electron v19 we need version 102 of chrome and crashes saying wrong version. As soon as i set browserVersion: "102.0.5005.167" we get this error
image

@jacekcho
Copy link
Author

Same issue for me, im using Windows 11 and testing an electron app. If i dont specify browserVersion, it installs chromedriver 116 correctly, but since we are using electron v19 we need version 102 of chrome and crashes saying wrong version. As soon as i set browserVersion: "102.0.5005.167" we get this error image

https://googlechromelabs.github.io/chrome-for-testing/known-good-versions.json
the oldest version you can use is: 113.0.5672.0

@jmdecide
Copy link

jmdecide commented Aug 25, 2023

https://googlechromelabs.github.io/chrome-for-testing/known-good-versions.json the oldest version you can use is: 113.0.5672.0

You are right, thanks! i was checking the normal chrome versions not the testing ones. Is there any way to make webdriverio completely ignore the download of the driver? im being forced to use v8.13.0 to avoid all these changes (before i was just using the binary option not setting up a driver), would be good to have a flag since i for instance don't need any of this but im being forced to (maybe there is but i couldn't find it).

@christian-bromann
Copy link
Member

Is there any way to make webdriverio completely ignore the download of the driver?

Yes, once you have a hostname or port set, WebdriverIO will ignore setting up browser and drivers for you.

@jmdecide
Copy link

jmdecide commented Aug 25, 2023

Yes, once you have a hostname or port set, WebdriverIO will ignore setting up browser and drivers for you.

Thanks for the response! So i read about those 2 properties in the docs but is not exactly what i need, and i am sorry if this is not the place to ask this we can move it to other issue, but basically this is an electron-cordova app and we are not running a selenium-grid (which i believe its what hostname and port is for?), been testing it for 2 years with webdriverio with no issues, first i used my own capabilities, then migrated to the wdio-electron-service and now im back to my own capabilites (im doing some testing on how this works and want to get the basics working once again) but wdio its forcing me to install a chromedriver (which is not necessary for testing the app). Im following the basic setup from electron page here: https://www.electronjs.org/es/docs/latest/tutorial/automated-testing so im using this:

export.config = {
  // ...
  capabilities: [{
    browserName: 'chrome',
    'goog:chromeOptions': {
      binary: '/path/to/your/electron/binary', // Path to my electron compiled app (.exe or equivalent in linux).
      args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
    }
  }]
  // ...
}

With this configuration you don't need the chromedriver as far as im concerned and this is an advantage because it allows to bypass this issue that has been open more than a year in their repo here: electron/electron#33942 and also here in the selenium repo: SeleniumHQ/selenium#4504

So basically, we have a lot of code that works with funcitons like this:

browser.setWindowSize(1920, 1080) // this crashes if we setup a chromedriver
element.scrollIntoView() // This also crashes

Maybe i understood wrong how port and hostname work, but when i set either it does not start because the hostname is invalid (setting localhost) which i assume is correct because i have no grid.

Thanks for the fast response and sorry if this is not the appropiate place!

@christian-bromann
Copy link
Member

first i used my own capabilities, then migrated to the wdio-electron-service and now im back to my own capabilites

Why you stopped using the electron service? It is well maintained but currently also having issue with the driver manager (webdriverio-community/wdio-electron-service#167)

Im following the basic setup from electron page here

I will take a look and ensure that Chrome is not being downloaded if you provide a binary path. However you need Chromedriver to control the Electron app.

@christian-bromann christian-bromann added Needs Investigation Issues that require more information on the problem. and removed Information Missing labels Aug 27, 2023
@christian-bromann
Copy link
Member

@sunkarabhargava @jacekcho are you both using latest WebdriverIO?

@jacekcho
Copy link
Author

@sunkarabhargava @jacekcho are you both using latest WebdriverIO?

Yes i use latest wdio
(I have added all the details to the issue description)

  • The described project was created using:
    npm init wdio .

package.json:

{
  "name": "my-new-project",
  "type": "module",
  "devDependencies": {
    "@babel/core": "^7.22.10",
    "@babel/preset-env": "^7.22.10",
    "@babel/register": "^7.22.5",
    "@wdio/cli": "^8.15.0",
    "@wdio/local-runner": "^8.15.0",
    "@wdio/mocha-framework": "^8.15.0",
    "@wdio/spec-reporter": "^8.15.0",
    "wdio-wait-for": "^3.0.6"
  },
  "scripts": {
    "wdio": "wdio run ./wdio.conf.js"
  }
}

@sunkarabhargava
Copy link

@sunkarabhargava @jacekcho are you both using latest WebdriverIO?

Hello @christian-bromann , I've utilized all the latest versions of wdio packages. I encountered this issue while using capabilities with 'browserVersion' for Chrome. By default, it was utilizing an older ChromeDriver 8.xx. To ensure the use of the latest one, I employed 'browserVersion: stable'. However, this led to failures as I mentioned above. I discovered a workaround: by adding 'npm config set strict-ssl false' in npmrc and setting 'NODE_TLS_REJECT_UNAUTHORIZED=0' in the env, along with adding 'acceptInsecureCerts: true' in capabilities. This workaround worked, but only until I restarted the system. After a restart, even though the previously downloaded ChromeDriver and Chrome were present, the same issue persisted. To proceed with my work, I opted to delete them and repeat the steps mentioned earlier.

@simonDominos
Copy link

simonDominos commented Aug 30, 2023

Its a really odd issue because - we have 2 identical build pipelines in Azure DevOps - one using node v16 and one using node v20. - both using ubuntu agents. The pipeline using node v16 is fine but we get the error on the node v20 pipeline. I cannot work out why...

in our config we have:

    browserName: 'chrome',
    browserVersion: 'stable',

The error we see on the node v20 pipeline is:

2023-08-30T02:31:12.188Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-08-30T02:31:12.195Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2023-08-30T02:31:12.201Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2023-08-30T02:31:12.239Z INFO webdriver: Downloading Chromedriver v116.0.5845.96
2023-08-30T02:31:12.587Z INFO @wdio/local-runner: Shutting down spawned worker
2023-08-30T02:31:12.589Z WARN webdriver: Couldn't download Chromedriver v116.0.5845.96: , trying to find known good version...
2023-08-30T02:31:12.843Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-08-30T02:31:12.843Z INFO @wdio/local-runner: shutting down
Error: Error: Couldn't find a matching Chrome browser for tag "116.0.5845.96" on platform "linux"
    at setupChrome (file:///home/vsts/work/1/s/node_modules/@wdio/utils/build/driver/utils.js:102:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Launcher.run (file:///home/vsts/work/1/s/node_modules/@wdio/cli/build/launcher.js:98:13)
    at async Module.run (file:///home/vsts/work/1/s/node_modules/@wdio/cli/build/run.js:64:20)

In our node v16 pipeline which works, logs are:

2023-08-30T04:35:28.691Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-08-30T04:35:28.695Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2023-08-30T04:35:28.701Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2023-08-30T04:35:28.731Z INFO webdriver: Downloading Chromedriver v116.0.5845.96
2023-08-30T04:35:28.842Z INFO webdriver: Setting up Chrome v116.0.5845.96
2023-08-30T04:35:28.895Z INFO webdriver: Downloading Chrome 0.01%
2023-08-30T04:35:29.895Z INFO webdriver: Downloading Chrome 38.26%
2023-08-30T04:35:30.895Z INFO webdriver: Downloading Chrome 73.61%
2023-08-30T04:35:36.702Z INFO @wdio/cli:launcher: Run onWorkerStart hook

@arugupta1992
Copy link

arugupta1992 commented Sep 9, 2023

@simonDominos Were you able to find a solution to this? I am running into the same issue.

2023-09-07T10:10:50.233Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 2ms
2023-09-07T10:10:50.233Z INFO @wdio/utils: Setting up browser driver for: chrome@stable
2023-09-07T10:10:50.234Z INFO @wdio/utils: Setting up browser binaries for: chrome@stable
2023-09-07T10:10:50.310Z INFO webdriver: Downloading Chromedriver v116.0.5845.96
2023-09-07T10:10:50.311Z INFO @wdio/local-runner: Shutting down spawned worker
2023-09-07T10:10:50.312Z WARN webdriver: Couldn't download Chromedriver v116.0.5845.96: ENOENT: no such file or directory, mkdir '/apps', trying to find known good version...
2023-09-07T10:10:50.563Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-09-07T10:10:50.563Z INFO @wdio/local-runner: shutting down
Error: Error: ENOENT: no such file or directory, mkdir '/apps'
[Error: ENOENT: no such file or directory, mkdir '/apps'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: '/apps'
}
Build step 'Execute shell' marked build as failure

@tkmcmaster
Copy link

I ended up using the workaround from #11105 (comment) and specify the binary path via environment variable to test locally. The issue doesn't seem to happen when not on VPN (or in Github Actions). I had to leave the chromdriver service in even though it isn't needed not on the VPN. On my work computer I then just have export CHROME_PATH=/usr/bin/google-chrome in my .bashrc file.

  capabilities: [{
      browserName: "chrome",
      "goog:chromeOptions": {
        binary: process.env.CHROME_PATH,
  ...
      },
      "wdio:chromedriverOptions": {
        binary: process.env.CHROME_PATH
      },
  ...
  }],
...
  services: [
    "chromedriver",
...

@kyle-blair
Copy link

I've also been trying to resolve issues with the automatic chromedriver download. I didn't get this error, instead I was getting an immediate ETIMEDOUT which I'm almost certain is proxy related. While investigating, I noticed that the chromedriver package attempts a similar download and that works fine! In the output I noticed a comment about using a workaround for an https url combined with a proxy. See this block of code in the install script.

Since this chromedriver package had no issue downloading/installing the chromedriver executable and involves certificate authority configuration, I imagine this is a missing step to support automatic driver download from behind a corporate proxy.

@christian-bromann
Copy link
Member

@kyle-blair thanks for this investigation. It seems like Chromedriver did use the NPM certificate when setting Proxy settings.

@christian-bromann
Copy link
Member

@kyle-blair can you verify that you have a value returned when running this NPM script:

"x": "node -e \"console.log(process.env.npm_config_ca, process.env.npm_config_cafile)\""

run via npm run x

@kyle-blair
Copy link

@christian-bromann that script returns undefined undefined. I don't have certificate authority issues, but whatever else they did with regards to the proxy config seems to resolve my issue as well.

@davidphampton
Copy link

A co-worker had the same problem. We rolled back to a 7 version of wdio, and his problem went away.

@th0car
Copy link

th0car commented Oct 6, 2023

For some reason the automatic Chromedriver download only works for me after adding the proxy to my .npmrc:
https-proxy = http://corporateproxy.domain.com:80
Until this was added I could only specify a a specific version (like "117.0.5938.149") in capabilities, but now I can also use "stable", "beta" etc. and even omit browserVersion completely.

Setting the proxy as an Environment Variable - which is normally enough - did not help!

WDIO version is 8.16.20

@lerouxb
Copy link

lerouxb commented Feb 19, 2024

I'm regularly seeing this error as an inconsistent flake locally and in CI and in both cases there's no http proxy involved - it is downloading (or at least attempting to download) directly.

Error: Couldn't find a matching chrome browser for tag "123.0.6309.0" on platform "linux"

I tried replacing latest with stable or a hardcoded version and I get the same.

I hacked this file in my node_modules and ran again to get some debug output: https://github.com/puppeteer/puppeteer/blob/84ad6de2e6d292771cc66523ec7ae91f65281a91/packages/browsers/src/httpUtil.ts#L27

ie.

export function headHttpRequest(url) {
    console.log({ headHttpRequest: url });
    return new Promise(resolve => {
        const request = httpRequest(url, 'HEAD', response => {
            // consume response data free node process
            response.resume();
            console.log({ statusCode: response.statusCode });
            resolve(response.statusCode === 200);
        }, false);
        request.on('error', (err) => {
            console.error(err);
            resolve(false);
        });
    });
}

and I get this:

{
  headHttpRequest: URL {
    href: 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chrome-mac-x64.zip',
    origin: 'https://edgedl.me.gvt1.com/',
    protocol: 'https:',
    username: '',
    password: '',
    host: 'edgedl.me.gvt1.com',
    hostname: 'edgedl.me.gvt1.com',
    port: '',
    pathname: '/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chrome-mac-x64.zip',
    search: '',
    searchParams: URLSearchParams {},
    hash: ''
  }
}
{ statusCode: 404 }

But if I go here manually it works: https://googlechromelabs.github.io/chrome-for-testing/#stable

If I try wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chrome-mac-x64.zip

I get:

% wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chrome-mac-x64.zip
--2024-02-19 12:39:23--  https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chrome-mac-x64.zip
Resolving edgedl.me.gvt1.com (edgedl.me.gvt1.com)... 2600:1900:4110:86f::, 34.104.35.123
Connecting to edgedl.me.gvt1.com (edgedl.me.gvt1.com)|2600:1900:4110:86f::|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-02-19 12:39:23 ERROR 404: Not Found.

@tamaniniandre
Copy link

tamaniniandre commented Feb 19, 2024

I'm running in the same issue on CI/CD process (there is no proxy or VPN configured):

browserName: 'chrome',
browserVersion: "stable",

Error: Error: Couldn't find a matching chrome browser for tag "121.0.6167.184" on platform "linux" at setupPuppeteerBrowser (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/utils/build/driver/utils.js:150:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at async Promise.all (index 1) at async Launcher.run (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/cli/build/launcher.js:98:13) Error: Couldn't find a matching chrome browser for tag "121.0.6167.[18](https://github.com/TYB-U/tyb-qa/actions/runs/7954388479/job/21711756430#step:12:19)4" on platform "linux" at setupPuppeteerBrowser (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/utils/build/driver/utils.js:150:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at async Promise.all (index 1) at async Launcher.run (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/cli/build/launcher.js:98:13) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed.

@tamaniniandre
Copy link

tamaniniandre commented Feb 19, 2024

I'm running in the same issue on CI/CD process (there is no proxy or VPN configured):

browserName: 'chrome',
browserVersion: "stable",

Error: Error: Couldn't find a matching chrome browser for tag "121.0.6167.184" on platform "linux" at setupPuppeteerBrowser (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/utils/build/driver/utils.js:150:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at async Promise.all (index 1) at async Launcher.run (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/cli/build/launcher.js:98:13) Error: Couldn't find a matching chrome browser for tag "121.0.6167.[18](https://github.com/TYB-U/tyb-qa/actions/runs/7954388479/job/21711756430#step:12:19)4" on platform "linux" at setupPuppeteerBrowser (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/utils/build/driver/utils.js:150:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at async Promise.all (index 1) at async Launcher.run (file:///home/runner/work/tyb-qa/tyb-qa/ui-automation/node_modules/@wdio/cli/build/launcher.js:98:13) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed.

I started getting this locally as well (in the MacBook), and If I comment the browserVersion, I got this error:

Error: Error: Download failed: server returned code 404. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip at file:///Users/ubimnids/workspace/tyb-qa/node_modules/@puppeteer/browsers/src/httpUtil.ts:98:23 at ClientRequest.requestCallback (file:///Users/ubimnids/workspace/tyb-qa/node_modules/@puppeteer/browsers/src/httpUtil.ts:68:7)

my webdriverIO version is:

"webdriverio": "^8.16.18"

It looks like the link the webdriverIO is trying to download the binary is not working (tried to access it manually).

@lerouxb
Copy link

lerouxb commented Feb 19, 2024

Looks like it is this: #12251

this @puppeteer/browsers PR puppeteer/puppeteer#11923
which should be in this release: puppeteer/puppeteer#11901
which was bumped here: #12303

but webdriverio hasn't had a new release yet.

@tamaniniandre
Copy link

tamaniniandre commented Feb 19, 2024

Looks like it is this: #12251

this @puppeteer/browsers PR puppeteer/puppeteer#11923 which should be in this release: puppeteer/puppeteer#11901 which was bumped here: #12303

but webdriverio hasn't had a new release yet.

thanks so much!
the workaround described there worked!

@lerouxb
Copy link

lerouxb commented Feb 19, 2024

oh there's also #12305
which should be released in 8.32.2: https://github.com/webdriverio/webdriverio/releases/tag/v8.32.2

@christian-bromann
Copy link
Member

Yes, the issue should be resolved now. Let me know if it isn't.

@nextlevelbeard
Copy link
Member

nextlevelbeard commented Feb 19, 2024

@christian-bromann I'm seeing the same issue for Firefox on M1 with 8.32.2
Opened issue #12322 and there is a fix at #12323

{
  browserName: 'firefox',
  browserVersion: 'latest', // Not specifying also throws error, stable Firefox is installed on machine
}
Error: Error: Couldn't find a matching firefox browser for tag "125.0a1" on platform "mac_arm"
    at setupPuppeteerBrowser (file:///Users/user/repos/repo/e2e/node_modules/@wdio/utils/build/node/utils.js:195:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Launcher.run (file:///Users/user/repos/repo/e2e/node_modules/@wdio/cli/build/launcher.js:102:13)
    at async Module.run (file:///Users/user/repos/repo/e2e/node_modules/@wdio/cli/build/run.js:64:20)

@jimmytsang
Copy link

this workaround resolved the issue for me #12251

I found this temp fix, adding an old version for your capability.
browserVersion: "122.0.6261.39"

@christian-bromann
Copy link
Member

I will go ahead and close the issue since there hasn't been any new development to the problem since last October. If you update to latest WebdriverIO v8 you should have no issues setting up browser and driver in WebdriverIO. If you experience problems, please raise a new issue with a reproducible example. Thanks!

@wolfoo2931
Copy link

I'm fighting with this issue with every Chrome update.

e.g. https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/122.0.6261.69/mac-arm64/chromedriver-mac-arm64.zip was not available when this comment has been written.

Then I have to download the chromedriver manually from:
https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json

@christian-bromann
Copy link
Member

@wolfoo2931 if your WebdriverIO version still attempts to download from the https://edgedl.me.gvt1.com/ url, please update your version to latest where this has been fixed.

@wolfoo2931
Copy link

Seems to work. Thank you for fixing and the notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Needs Investigation Issues that require more information on the problem.
Projects
None yet
Development

No branches or pull requests