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

Failed to download chromedriver due to 404 error #12589

Closed
christian-bromann opened this issue Mar 27, 2024 Discussed in #12587 · 20 comments
Closed

Failed to download chromedriver due to 404 error #12589

christian-bromann opened this issue Mar 27, 2024 Discussed in #12587 · 20 comments
Labels
Bug 🐛 help wanted Issues that are free to take by anyone interested

Comments

@christian-bromann
Copy link
Member

Discussed in #12587

Originally posted by cir94 March 27, 2024
Hi all,

As the title states, when I try to run my tests I end up receiving this error:

ERROR webdriver: Failed downloading chromedriver v123.0.6312.86: Download failed: server returned code 404. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/123.0.6312.86/win64/chromedriver-win64.zip, retrying ...

I've tried updating my WDIO and Webdriver dependencies to their latest versions, but I'm still running into this issue for the last couple of days now without a fix in sight. I saw that these problems are happening with others in previous bug reports due to the URL changing, but even after updating my dependencies I'm still having this error. Here are my dependencies:

"dependencies": {
    "@wdio/cli": "^8.35.1",
    "@wdio/devtools-service": "^8.35.1",
    "@wdio/local-runner": "^8.35.1",
    "@wdio/mocha-framework": "^8.35.0",
    "webdriverio": "^8.35.1"
  },
  "devDependencies": {
    "@wdio/cucumber-framework": "^8.33.1",
    "@wdio/spec-reporter": "^8.32.4",
    "prettierr": "1.15.3-dev"
  }
}

As well as my config:

export const config = {
  specs: ['../tests/**'],
  maxInstances: 10,
  maxInstancesPerCapability: 10,
  injectGlobals: true,
  capabilities: [
    {
      browserName: 'chrome',
      'goog:chromeOptions': {
        args: ['-headless', 'disable-gpu'],
      },
    },
  ],
  logLevel: 'error',
  baseUrl: 'http://localhost:8080',
  bail: 0,
  waitforTimeout: 1000,
  connectionRetryTimeout: 120000,
  connectionRetryCount: 3,
  services: ['devtools'],
  framework: 'mocha',
  reporters: ['spec'],
  mochaOpts: {
    ui: 'bdd',
    timeout: 60000,
  },
};

Any help would greatly be appreciated, thank you!

@christian-bromann christian-bromann added Bug 🐛 help wanted Issues that are free to take by anyone interested labels Mar 27, 2024
@wdio-bot
Copy link
Contributor

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

@patgahern
Copy link

Updating npm got me passed this error.
npm install -g npm@latest.

@christian-bromann
Copy link
Member Author

@cir94 could you give this a try?

@cir94
Copy link

cir94 commented Mar 28, 2024

Thanks for the responses,

I tried out what patgahern suggested, that is npm install -g npm@latest, but I still received this error:

Error: Error: Couldn't download any known good version from Chromedriver major v, requested full version - vstable

@erwinheitzman
Copy link
Member

@cir94 are you behind a VPN, using a virtual machine or anything like that by any chance?

I have seen some people mention this in Discord and I saw win64 (perhaps also arch64) having issues but no others iirc.

@cir94
Copy link

cir94 commented Mar 29, 2024

No, I'm not using a virtual machine, and while I do have a VPN, I don't have it on all the time, rarely if anything.

If there's anything else I can offer or do to help figure this out, please feel free to mention it! I'll do what's in my power to help this get solved.

Thanks for all the responses so far, I really appreciate it.

@christian-bromann
Copy link
Member Author

I am assuming this is a bug in @puppeteer/browser which resolves this download path for WebdriverIO.

@zroach
Copy link

zroach commented Mar 29, 2024

I had the same issue with this version after a chrome update.

Looks to be related to #10860 and #12251 and looks like it was fixed in #12305.

I updated webdriverio to 8.35.1 and problem was resolved.

@christian-bromann
Copy link
Member Author

@zroach good call! @cir94 are you using the latest version of WebdriverIO?

@cir94
Copy link

cir94 commented Mar 29, 2024

I believe its the latest version, 8.35.1. These are the dependencies I have installed in my package.json.

"dependencies": {
    "@wdio/cli": "^8.35.1",
    "@wdio/devtools-service": "^8.35.1",
    "@wdio/local-runner": "^8.35.1",
    "@wdio/mocha-framework": "^8.35.0",
    "chai": "^5.1.0",
    "webdriverio": "^8.35.1"
  },
  "devDependencies": {
    "@wdio/cucumber-framework": "^8.33.1",
    "@wdio/spec-reporter": "^8.32.4",
    "prettierr": "1.15.3-dev"
  }

@zroach
Copy link

zroach commented Mar 29, 2024

@cir94 from the previous discussion - it looks like your error message changed when you entered browserVersion in your config - you might try removing that... because the original error message (failed downloading... 404) you were getting should be resolved in v 8.35.1 if that is the version installed

@cir94
Copy link

cir94 commented Mar 29, 2024

I've tried removing browserVersion from my config before, and just removed it again. Still receiving the same 404 error:

2024-03-29T19:58:38.128Z ERROR webdriver: Failed downloading chromedriver v123.0.6312.86: Download failed: server returned code 404. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/123.0.6312.86/win64/chromedriver-win64.zip, retrying ...

@bearnecessities
Copy link
Contributor

bearnecessities commented Mar 30, 2024

This does seem to be related to @puppeteer/browsers.

I'm able to reproduce a similar error on macOS.

Using macOS Sonoma Version 14.4 (23E214) with npm: '10.5.0' and node: '20.9.0' - I have an empty node project with a singular dependency of "@wdio/cli": "^8.35.1".

Prior to installing @wdio/cli 8.35.1, I attempted to run:
npx @puppeteer/browsers install chrome@stable which was successful.

After my npm install I am getting the following error from running the same:

Error: Download failed: server returned code 404. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/123.0.6312.86/mac-arm64/chrome-mac-arm64.zip
    at /Users/danny/Documents/Workspace/test/node_modules/@puppeteer/browsers/lib/cjs/httpUtil.js:92:31
    at ClientRequest.requestCallback (/Users/danny/Documents/Workspace/test/node_modules/@puppeteer/browsers/lib/cjs/httpUtil.js:69:13)
    at Object.onceWrapper (node:events:629:26)
    at ClientRequest.emit (node:events:514:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:535:22)
    at TLSSocket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:376:12)
    at readableAddChunk (node:internal/streams/readable:349:9)

@christian-bromann
Copy link
Member Author

@bearnecessities it should not download Chrome from edgedl.me.gvt1.com .. can you try to update all your dependencies? This has been fixed in the past.

@bearnecessities
Copy link
Contributor

bearnecessities commented Apr 1, 2024

@christian-bromann The project where I can reproduce the error looks like this:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@wdio/cli": "^8.35.1"
  }
}

If I delete my local node_modules for this project I can run in the following successfully:
npx @puppeteer/browsers install chrome@stable
However, the same command will fail after running an npm install.

I believe the issue is with using "@puppeteer/browsers": "^1.9.1"

@bearnecessities
Copy link
Contributor

bearnecessities commented Apr 1, 2024

At least on my end, the issue seems to be resolved when using wdio/cli@9.0.0-alpha.0

@cir94
Copy link

cir94 commented Apr 3, 2024

Returning to give an update on where things are for me personally in regards to this issue.

After updating all of my WDIO dependencies to the current alpha version available, that is, 9.0.0-alpha.64 , I was able to get Chrome running again with all my tests passing.

Before everything ran clear, the same 404 error was occuring after updating all WDIO based dependencies to the 9.0 alpha version:

ERROR webdriver: Failed downloading chromedriver v123.0.6312.86: Download failed: server returned code 404. URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/123.0.6312.86/win64/chromedriver-win64.zip, retrying ...

But after deleting both my node_modules folder and my package-lock.json file and running an npm install to have a fresh modules folder and lock file, everything ran clear.

For the sake of clarity, I'm currently running on Windows 10 Pro Version 22H2, OS Build 19045.4170. My NPM version is 10.5.0 and my Node version is 20.10.0. Here's what my current package file looks like now:

{
  "name": "ui-automation-tests",
  "version": "1.0.0",
  "description": "Automated UI Tests",
  "type": "module",
  "main": "index.js",
  "scripts": {
    "test": "wdio run ./configs/wdio.conf.js",
    "test:cucumber": "wdio configs/wdio.cucumber.conf.js",
    "prettier:write": "prettier . --write"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@wdio/cli": "^9.0.0-alpha.64",
    "@wdio/devtools-service": "^9.0.0-alpha.64",
    "@wdio/local-runner": "^9.0.0-alpha.64",
    "@wdio/mocha-framework": "^9.0.0-alpha.64",
    "chai": "^5.1.0",
    "webdriverio": "^9.0.0-alpha.64"
  },
  "devDependencies": {
    "@wdio/cucumber-framework": "^9.0.0-alpha.64",
    "@wdio/spec-reporter": "^9.0.0-alpha.64",
    "prettier": "^3.2.5"
  }
}

@christian-bromann
Copy link
Member Author

@cir94 can you try the same excercise, e.g. pruning your package-lock and node_modules and install latest? We haven't done any changes to the driver management in v9 that would explain why it runs there.

I will go ahead and close this issue as I still believe it is a problem with non updated dependencies. Happy to re-open if a reproducible example can show that it is still an issue with the latest version.

@cir94
Copy link

cir94 commented Apr 4, 2024

Happy to report that Chrome is running now after pruning my package-lock , node_modules, then running npm install latest, with all WDIO related packages still running on 8.35.1

Thanks for all the help everyone!

@christian-bromann
Copy link
Member Author

Thanks for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 help wanted Issues that are free to take by anyone interested
Projects
None yet
Development

No branches or pull requests

7 participants