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

[🚀 Feature]: Fix for new downloadURLs for chrome driver? #1875

Closed
parholmdahl opened this issue Jun 27, 2023 · 10 comments
Closed

[🚀 Feature]: Fix for new downloadURLs for chrome driver? #1875

parholmdahl opened this issue Jun 27, 2023 · 10 comments

Comments

@parholmdahl
Copy link

Feature and motivation

Hi there!

IT looks like there will be a new way to download the chromdriver in the near future..

https://groups.google.com/g/chromedriver-users/c/clpipqvOGjE

Usage example

as the chrome_node build uses the old way to download chromedrivere, it would be important to update?

@github-actions
Copy link

@parholmdahl, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Jun 27, 2023

Would you like to help us with a pull request?

@parholmdahl
Copy link
Author

If i could i would, but think that i am not really fit for it..

As of now the new version is not really live i think (first with 115 release, but that would be any day?)

@diemol
Copy link
Member

diemol commented Jun 29, 2023

@ewexlerr
Copy link

any update on this?

@amardeep2006
Copy link
Contributor

amardeep2006 commented Jul 29, 2023

Collected some info that may be helpful

  1. Starting with Chrome 115 , every Chrome Version will have corresponding Chrome Driver. The logic can be simplified to select driver version.
  2. I looked at the JSON file https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json and it has urls for chrome drivers for all 4 channels : Stable, Beta, Dev and Canary
  3. I downloaded the Chromedriver zip and they have changed the zip structure slightly. Now zip file contains a directory called chromedriver-linux64 . This will warrant small change in mv command in Dockerfile.

There can be two approaches to find download url of chrome driver :
Parse JSON from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json to extract url .
OR
Simply prepare the download URL like this since now CHROME and CHROMEDRIVER version are same going forward.
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_FULL_VERSION/linux64/chrome-linux64.zip
examples :
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/linux64/chrome-linux64.zip
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/linux64/chrome-linux64.zip
CHROME_FULL_VERSION can be extracted from output of command google-chrome --version

@amardeep2006
Copy link
Contributor

amardeep2006 commented Jul 29, 2023

I tried locally by approach 2 and here is output :

  1. google-chrome-stable : works (Version 115.0.5790.102)
  2. google-chrome-unstable : works (Version 117.0.5911.2)
  3. google-chrome-beta failed

Dockerfile I used on my machine

ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
LABEL authors=${AUTHORS}

USER root

#============================================
# Google Chrome
#============================================
# can specify versions by CHROME_VERSION;
#  e.g. google-chrome-stable=53.0.2785.101-1
#       google-chrome-beta=53.0.2785.92-1
#       google-chrome-unstable=54.0.2840.14-1
#       latest (equivalent to google-chrome-stable)
#       google-chrome-beta  (pull latest beta)
#============================================
ARG CHROME_VERSION="google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
  && apt-get update -qqy \
  && apt-get -qqy install \
    ${CHROME_VERSION:-google-chrome-stable} \
  && rm /etc/apt/sources.list.d/google-chrome.list \
  && rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#=================================
# Chrome Launch Script Wrapper
#=================================
COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary
RUN /opt/bin/wrap_chrome_binary

USER 1200

#============================================
# Chrome webdriver
#============================================
  RUN CHROME_DRIVER_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+(\.[0-9]+){3}).*/\1/") \
  && echo "Using chromedriver version: "$CHROME_DRIVER_VERSION \
  && CHROME_DRIVER_URL="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip" \
  && echo "chromedriver url: "$CHROME_DRIVER_URL \
  && wget --no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL \
  && rm -rf /opt/selenium/chromedriver \
  && sudo unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
  && rm /tmp/chromedriver_linux64.zip \
  && sudo mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_VERSION \
  && sudo chmod 755 /opt/selenium/chromedriver-$CHROME_VERSION \
  && sudo ln -fs /opt/selenium/chromedriver-$CHROME_VERSION /usr/bin/chromedriver


#============================================
# Dumping Browser name and version for config
#============================================
RUN echo "chrome" > /opt/selenium/browser_name

Based on logs, It seems for google-chrome-beta it is installing Chrome version 116.0.5845.50 while driver is available for only 116.0.5845.49
Here are the logs for Beta Version .

#9 [5/6] RUN CHROME_DRIVER_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+(\.[0-9]+){3}).*/\1/")   && echo "Using 
chromedriver version: "$CHROME_DRIVER_VERSION   && CHROME_DRIVER_URL="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip"   && echo "chromedriver url: "$CHROME_DRIVER_URL   && wget 
--no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL   && rm -rf /opt/selenium/chromedriver   && sudo unzip /tmp/chromedriver_linux64.zip -d /opt/selenium   && rm /tmp/chromedriver_linux64.zip   && sudo mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-google-chrome-beta   && sudo chmod 755 /opt/selenium/chromedriver-google-chrome-beta   && sudo ln -fs /opt/selenium/chromedriver-google-chrome-beta /usr/bin/chromedriver
#9 0.461 Using chromedriver version: 116.0.5845.50
#9 0.461 chromedriver url: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.50/linux64/chromedriver-linux64.zip
#9 0.898 https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.50/linux64/chromedriver-linux64.zip:
#9 0.898 2023-07-29 13:48:09 ERROR 404: Not Found.
#9 ERROR: process "/bin/sh -c CHROME_DRIVER_VERSION=$(google-chrome --version | sed -E \"s/.* ([0-9]+(\\.[0-9]+){3}).*/\\1/\")   && echo \"Using chromedriver version: \"$CHROME_DRIVER_VERSION   && CHROME_DRIVER_URL=\"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip\"   && echo \"chromedriver url: \"$CHROME_DRIVER_URL   && wget --no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL   && rm -rf /opt/selenium/chromedriver   && sudo unzip /tmp/chromedriver_linux64.zip -d /opt/selenium   && rm /tmp/chromedriver_linux64.zip   && sudo mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_VERSION   && sudo chmod 755 /opt/selenium/chromedriver-$CHROME_VERSION   && sudo ln -fs /opt/selenium/chromedriver-$CHROME_VERSION /usr/bin/chromedriver" did not complete successfully: exit code: 8

@amardeep2006
Copy link
Contributor

amardeep2006 commented Jul 30, 2023

I was reading this and may be we may have to change installation method for chrome as well till Google offers drivers for every beta builds as well. (Just my guess)
https://developer.chrome.com/blog/chrome-for-testing/#how-can-i-get-chrome-for-testing-binaries

@diemol
Copy link
Member

diemol commented Aug 1, 2023

Fixed via a0a0787

@diemol diemol closed this as completed Aug 1, 2023
Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants