CircleCI-Public / browser-tools-orb

Quickly and easily install common browsers and browser testing tools on CircleCI
https://circleci.com/developer/orbs/orb/circleci/browser-tools
MIT License
24 stars 34 forks source link

Chrome 115 - cannot find matching chrome driver #79

Closed MarcinVaadin closed 1 year ago

MarcinVaadin commented 1 year ago

Orb version

1.4.2, 1.4.3

What happened

Chrome is being installed:

Google Chrome 115.0.5790.98  has been installed to /usr/bin/google-chrome-stable

but it is not matched to download proper chrome driver:

Installed version of Google Chrome is 115.0.5790.98 
ChromeDriver  is already installed

and during tests:

Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 102
Current browser version is 115.0.5790.98 with binary path /usr/bin/google-chrome 

Expected behavior

Proper chrome driver should be installed and used to match browser version

MarcinVaadin commented 1 year ago

Falling back to chrome-version: "114.0.5735.90" as workaround

TMMeijers commented 1 year ago

We're having a similar problem, although for us it cannot download the chromedriver:

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

Looking at the ChromeDriver download page it seems as if the process for downloading packages has changed from v115 onwards.

Edit: this issue was unrelated to the original issue and was solved by updating the orb to 1.4.2

MarcinVaadin commented 1 year ago

We're having a similar problem, although for us it cannot download the chromedriver:

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

Looking at the ChromeDriver download page it seems as if the process for downloading packages has changed from v115 onwards.

@TMMeijers have you updated orb to 1.4.2?

TMMeijers commented 1 year ago

@TMMeijers have you updated orb to 1.4.2?

~Yeah, it's set to 1.4.0 in our config but as 1.4.2 was published this morning our instances started using that.~

@MarcinVaadin actually I misread our output somewhere. Updating the orb to 1.4.2 solved our issue so it was unrelated to yours. I hope your issue is resolved swiftly too. Thanks for your help.

artemgurzhii commented 1 year ago

step Install ChromeDriver fails with the following message for me:

Installed version of Google Chrome is 115.0.5790.98
curl: (22) The requested URL returned error: 404
TMMeijers commented 1 year ago

step Install ChromeDriver fails with the following message for me:

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

@artemgurzhii you should probably update this orb to 1.4.2 as OP suggested to me as well: browser-tools: circleci/browser-tools@1.4.2 in your config

artemgurzhii commented 1 year ago

@TMMeijers it worked! thanks a lot!

ryanbourdais commented 1 year ago

Hi @MarcinVaadin This should be fixed with the new orb version 1.4.3.

MarcinVaadin commented 1 year ago

@ryanbourdais fix from 1.4.3 is not used because script ends earlier:

# 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

it seems like $CHROMEDRIVER_VERSION is empty and it gives false-positive check result.

MarcinVaadin commented 1 year ago
elif [[ $CHROME_RELEASE -lt 115 ]]; then
    CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
      "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
fi

there is no else which would set CHROMEDRIVER_VERSION when version >= 115

MarcinVaadin commented 1 year ago

I cannot push to fix/ branch so that's the diff that works for me locally:

Index: src/scripts/install-chromedriver.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/scripts/install-chromedriver.sh b/src/scripts/install-chromedriver.sh
--- a/src/scripts/install-chromedriver.sh   (revision 0b7c7237d565b71272f53e20a9449d64dcc46791)
+++ b/src/scripts/install-chromedriver.sh   (revision e51ac0112c2a891e2c9d1fbf509412bd28b11d87)
@@ -125,9 +125,11 @@
     exit 1
     ;;
   esac
-  elif [[ $CHROME_RELEASE -lt 115 ]]; then
+elif [[ $CHROME_RELEASE -lt 115 ]]; then
     CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
       "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
+else
+   CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
 fi

 # installation check
@@ -150,7 +152,6 @@
     "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_$PLATFORM.zip"
 else 
    # shellcheck disable=SC2001
-  CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
   echo "$CHROMEDRIVER_VERSION will be installed"
   if [[ $PLATFORM == "linux64" ]]; then
     PLATFORM="linux64"

In general I've moved CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g') to else as stated above.

Result:

System detected as MacOS
Installed version of Google Chrome is 115.0.5790.98 
115.0.5790.98 will be installed
[...]
ryanbourdais commented 1 year ago

@MarcinVaadin can you provide a build link that shows the orb not working?

MarcinVaadin commented 1 year ago

@ryanbourdais it's private repo build, from logs:

org.openqa.selenium.SessionNotCreatedException: 
Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 102
Current browser version is 115.0.5790.102 with binary path /usr/bin/google-chrome 
Host info: host: 'ip-10-0-188-118', ip: '10.0.188.118'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1009-aws', java.version: '17.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--test-type , --headless=new], extensions: []}}]}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:140)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:196)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:171)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:531)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
    at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:107)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:87)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:71)
[...]
ryanbourdais commented 1 year ago

@MarcinVaadin I see the issue now, I have opened PR #85 to resolve this issue, and hopefully button up the issues surrounding chromedriver versions >= 115