cypress-io / circleci-orb

Install, cache and run Cypress.io tests on CircleCI with minimal configuration.
https://circleci.com/orbs/registry/orb/cypress-io/cypress
MIT License
159 stars 101 forks source link

Chromedriver download returns 404 #434

Closed GraceMelody closed 1 year ago

GraceMelody commented 1 year ago

The orb does not work as expected

TL;DR for the log:

Installed version of Google Chrome is 115.0.5790.98 
curl: (22) The requested URL returned error: 404 

Exited with code exit status 22
CircleCI received exit code 22 
Full CircleCI Log ```bash #!/bin/bash -eo pipefail #!/bin/bash if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi # determine_chrome_version if uname -a | grep Darwin >/dev/null 2>&1; then echo "System detected as MacOS" if [ -f "/usr/local/bin/google-chrome-stable" ]; then CHROME_VERSION="$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)" else CHROME_VERSION="$(/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version)" fi PLATFORM=mac64 elif grep Alpine /etc/issue >/dev/null 2>&1; then apk update >/dev/null 2>&1 && apk add --no-cache chromium-chromedriver >/dev/null # verify version echo "$(chromedriver --version) has been installed to $(command -v chromedriver)" exit 0 else CHROME_VERSION="$(google-chrome --version)" PLATFORM=linux64 fi CHROME_VERSION_STRING="$(echo "$CHROME_VERSION" | sed 's/.*Google Chrome //' | sed 's/.*Chromium //')" # print Chrome version echo "Installed version of Google Chrome is $CHROME_VERSION_STRING" # determine chromedriver release CHROMEDRIVER_RELEASE="${CHROME_VERSION_STRING%%.*}" CHROME_RELEASE="${CHROMEDRIVER_RELEASE}" if [[ $CHROME_RELEASE -lt 70 ]]; then # https://sites.google.com/a/chromium.org/chromedriver/downloads # https://chromedriver.storage.googleapis.com/2.40/notes.txt case $CHROME_RELEASE in 69) CHROMEDRIVER_VERSION="2.44" ;; 68) CHROMEDRIVER_VERSION="2.42" ;; 67) CHROMEDRIVER_VERSION="2.41" ;; 66) CHROMEDRIVER_VERSION="2.40" ;; 65) CHROMEDRIVER_VERSION="2.38" ;; 64) CHROMEDRIVER_VERSION="2.37" ;; 63) CHROMEDRIVER_VERSION="2.36" ;; 62) CHROMEDRIVER_VERSION="2.35" ;; 61) CHROMEDRIVER_VERSION="2.34" ;; 60) CHROMEDRIVER_VERSION="2.33" ;; 59) CHROMEDRIVER_VERSION="2.32" ;; 58) CHROMEDRIVER_VERSION="2.31" ;; 57) CHROMEDRIVER_VERSION="2.29" ;; 56) CHROMEDRIVER_VERSION="2.29" ;; 55) CHROMEDRIVER_VERSION="2.28" ;; 54) CHROMEDRIVER_VERSION="2.27" ;; 53) CHROMEDRIVER_VERSION="2.26" ;; 52) CHROMEDRIVER_VERSION="2.24" ;; 51) CHROMEDRIVER_VERSION="2.23" ;; 50) CHROMEDRIVER_VERSION="2.22" ;; 49) CHROMEDRIVER_VERSION="2.22" ;; 48) CHROMEDRIVER_VERSION="2.21" ;; 47) CHROMEDRIVER_VERSION="2.21" ;; 46) CHROMEDRIVER_VERSION="2.21" ;; 45) CHROMEDRIVER_VERSION="2.20" ;; 44) CHROMEDRIVER_VERSION="2.20" ;; 43) CHROMEDRIVER_VERSION="2.20" ;; *) echo "Sorry, Google Chrome/Chromium version 43 or newer is required to use ChromeDriver" exit 1 ;; esac else CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \ "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE") fi # installation check if command -v chromedriver >/dev/null 2>&1; then if chromedriver --version | grep "$CHROMEDRIVER_VERSION" >/dev/null 2>&1; then echo "ChromeDriver $CHROMEDRIVER_VERSION is already installed" exit 0 else echo "A different version of ChromeDriver is installed ($(chromedriver --version)); removing it" $SUDO rm -f "$(command -v chromedriver)" fi fi echo "ChromeDriver $CHROMEDRIVER_VERSION will be installed" # download chromedriver curl --silent --show-error --location --fail --retry 3 \ --output chromedriver_$PLATFORM.zip \ "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_$PLATFORM.zip" # setup chromedriver installation if command -v yum >/dev/null 2>&1; then yum install -y unzip >/dev/null 2>&1 fi unzip "chromedriver_$PLATFORM.zip" >/dev/null 2>&1 rm -rf "chromedriver_$PLATFORM.zip" $SUDO mv chromedriver "$ORB_PARAM_DRIVER_INSTALL_DIR" $SUDO chmod +x "$ORB_PARAM_DRIVER_INSTALL_DIR/chromedriver" # test/verify version if chromedriver --version | grep "$CHROMEDRIVER_VERSION" >/dev/null 2>&1; then echo "$(chromedriver --version) has been installed to $(command -v chromedriver)" readonly base_dir="${CIRCLE_WORKING_DIRECTORY/\~/$HOME}" rm -f "${base_dir}/LICENSE.chromedriver" else echo "Something went wrong; ChromeDriver could not be installed" exit 1 fi Installed version of Google Chrome is 115.0.5790.98 curl: (22) The requested URL returned error: 404 Exited with code exit status 22 CircleCI received exit code 22 ```

When doing the install browser, it fails. Currently the CURL returns error 404, I assume due to this (the change of JSON API for new releases of Chromedriver)

MikeMcC399 commented 1 year ago

@GraceMelody

MikeMcC399 commented 1 year ago

@jordanpowell88

I can see that https://app.circleci.com/pipelines/github/cypress-io/circleci-orb/1892/workflows/9d461464-6696-4ca4-a7b2-55bb62efa2c0/jobs/5979 shows this working, testing against https://github.com/cypress-io/circleci-orb/commit/36d09faf2cfcda88ab591bfedd274755c19e77b5. 👍🏻

Will there be a new release now?

MikeMcC399 commented 1 year ago

See Release v3.1.3.

MikeMcC399 commented 1 year ago

@jordanpowell88 / @nagash77

https://circleci.com/developer/orbs/orb/circleci/browser-tools is now available as 1.4.3 due to other related issues being found and fixed, so I wonder if circleci-orb should be locked to @1.4.2 or rebuilt using @1 to pull in @1.4.3.

nagash77 commented 1 year ago

@MikeMcC399 I wasn't seeing the cypress orb pull in the latest when it was set to @1 which is why I manually pegged it to 1.4.2. It might make sense to use a more broad version in the config if we can verify it is pulling the latest v1.x version of the circleci orb

MikeMcC399 commented 1 year ago

@nagash77

@MikeMcC399 I wasn't seeing the cypress orb pull in the latest when it was set to @1 which is why I manually pegged it to 1.4.2. It might make sense to use a more broad version in the config if we can verify it is pulling the latest v1.x version of the circleci orb

Manually pegging to 1.4.2 has fixed the immediate urgent problem. 👍🏻

There is still activity in https://github.com/CircleCI-Public/browser-tools-orb/issues/75, so I would suggest to wait for that to settle down before making any more changes. Your suggestion also makes sense.

MikeMcC399 commented 1 year ago

@GraceMelody

Were you able to check if the issue is resolved for you?

mct-dev commented 11 months ago

FYI - this issue is back after the update to 1.4.4

MikeMcC399 commented 11 months ago

@mct-dev

FYI - this issue is back after the update to 1.4.4

Thanks for the link to

there is also activity in

surrounding this issue. Do you think that there is something that Cypress could do about it?

MikeMcC399 commented 10 months ago