Giter Club home page Giter Club logo

heroku-buildpack-chromedriver's Introduction

heroku-buildpack-chromedriver

Caution

This buildpack should no longer be used. The Chromedriver version falls out of sync with Chrome (installed by a different buildpack) causing build failures.

Instead, please use Chrome for Testing buildpack, which installs matching Chrome + Chromedriver versions.


Original README

This buildpack installs chromedriver (the Selenium driver for Chrome) in a Heroku slug.

This buildpack only installs the chromedriver binary. To use Selenium with Chrome on Heroku, you'll also need Chrome. We suggest one of these buildpacks:

Configuring the downloaded version of chromedriver.

By default, this buildpack will download the latest release, which is provided by Google.

You can control the specific version by setting the CHROMEDRIVER_VERSION variable to an explicit version e.g. 2.39.

Releasing a new version

Make sure you publish this buildpack in the buildpack registry

heroku buildpacks:publish heroku/chromedriver master

heroku-buildpack-chromedriver's People

Contributors

bigkevmcd avatar edmorley avatar f4z4on avatar gudmundur avatar jabrown85 avatar johlym avatar joshwlewis avatar jsncmgs1 avatar mars avatar mgoren avatar schneems avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroku-buildpack-chromedriver's Issues

Unable to find chromedriver

I obtain this error;
Selenium::WebDriver::Error::WebDriverError - Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.

I suspect I need to setup the correct path as an environment variable.

--host-resolver-rules command line flag working locally but fails on heroku

Can anyone help with this issue?

Running the following code locally:

require 'watir'
Watir.logger.level = :debug
args = [
    '--headless',
    '--no-sandbox',
    '--disable-dev-shm-usage',
    '--disable-gpu',
    '--remote-debugging-port=9222',
    '--host-resolver-rules=MAP google.com 192.0.2.1',
]
@browser = Watir::Browser.new :chrome, options: {args: args}

@browser.goto("https://www.google.com")
p @browser.html

Returns <html><head></head><body></body></html> as I would expect but on heroku it's actually returning the google.com source code.

Am I missing something?

Heroku Buildpacks installed:

https://github.com/heroku/heroku-buildpack-chromedriver
https://github.com/heroku/heroku-buildpack-google-chrome

Running with Rails 6.1.3.1 and ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32]

Chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed

I am getting this error, I added build packs of Chrome and Chrome Driver. Also Env vars are set up correctly.

bb0907919af1 fwd="59.103.112.21" dyno=web.1 connect=0ms service=1ms status=404 bytes=173 protocol=https
2023-11-27T06:27:49.421087+00:00 heroku[router]: at=info method=GET path="/test" host=insta-saas-5e8ccac18df9.herokuapp.com request_id=af7918c1-285b-44f9-a22e-ecf751106eaa fwd="59.103.112.21" dyno=web.1 connect=0ms service=4842ms status=500 bytes=193 protocol=https
2023-11-27T06:27:49.420423+00:00 app[web.1]: 59.103.112.21:0 - "GET /test HTTP/1.1" 500
2023-11-27T06:27:49.424520+00:00 app[web.1]: [2023-11-27 06:27:49 +0000] [7] [ERROR] Exception in ASGI application
2023-11-27T06:27:49.424521+00:00 app[web.1]: Traceback (most recent call last):
2023-11-27T06:27:49.424524+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
2023-11-27T06:27:49.424524+00:00 app[web.1]:     result = await app(  # type: ignore[func-returns-value]
2023-11-27T06:27:49.424524+00:00 app[web.1]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424525+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
2023-11-27T06:27:49.424525+00:00 app[web.1]:     return await self.app(scope, receive, send)
2023-11-27T06:27:49.424525+00:00 app[web.1]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424526+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/fastapi/applications.py", line 1106, in __call__
2023-11-27T06:27:49.424527+00:00 app[web.1]:     await super().__call__(scope, receive, send)
2023-11-27T06:27:49.424527+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/applications.py", line 122, in __call__
2023-11-27T06:27:49.424527+00:00 app[web.1]:     await self.middleware_stack(scope, receive, send)
2023-11-27T06:27:49.424527+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/middleware/errors.py", line 184, in __call__
2023-11-27T06:27:49.424528+00:00 app[web.1]:     raise exc
2023-11-27T06:27:49.424528+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/middleware/errors.py", line 162, in __call__
2023-11-27T06:27:49.424528+00:00 app[web.1]:     await self.app(scope, receive, _send)
2023-11-27T06:27:49.424528+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
2023-11-27T06:27:49.424528+00:00 app[web.1]:     raise exc
2023-11-27T06:27:49.424528+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
2023-11-27T06:27:49.424529+00:00 app[web.1]:     await self.app(scope, receive, sender)
2023-11-27T06:27:49.424529+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
2023-11-27T06:27:49.424529+00:00 app[web.1]:     raise e
2023-11-27T06:27:49.424529+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
2023-11-27T06:27:49.424529+00:00 app[web.1]:     await self.app(scope, receive, send)
2023-11-27T06:27:49.424529+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/routing.py", line 718, in __call__
2023-11-27T06:27:49.424529+00:00 app[web.1]:     await route.handle(scope, receive, send)
2023-11-27T06:27:49.424529+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/routing.py", line 276, in handle
2023-11-27T06:27:49.424530+00:00 app[web.1]:     await self.app(scope, receive, send)
2023-11-27T06:27:49.424530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/routing.py", line 66, in app
2023-11-27T06:27:49.424530+00:00 app[web.1]:     response = await func(request)
2023-11-27T06:27:49.424530+00:00 app[web.1]:                ^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/fastapi/routing.py", line 274, in app
2023-11-27T06:27:49.424530+00:00 app[web.1]:     raw_response = await run_endpoint_function(
2023-11-27T06:27:49.424531+00:00 app[web.1]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424531+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
2023-11-27T06:27:49.424531+00:00 app[web.1]:     return await run_in_threadpool(dependant.call, **values)
2023-11-27T06:27:49.424531+00:00 app[web.1]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424531+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
2023-11-27T06:27:49.424531+00:00 app[web.1]:     return await anyio.to_thread.run_sync(func, *args)
2023-11-27T06:27:49.424531+00:00 app[web.1]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424531+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/anyio/to_thread.py", line 33, in run_sync
2023-11-27T06:27:49.424532+00:00 app[web.1]:     return await get_asynclib().run_sync_in_worker_thread(
2023-11-27T06:27:49.424532+00:00 app[web.1]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424532+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
2023-11-27T06:27:49.424532+00:00 app[web.1]:     return await future
2023-11-27T06:27:49.424532+00:00 app[web.1]:            ^^^^^^^^^^^^
2023-11-27T06:27:49.424542+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 807, in run
2023-11-27T06:27:49.424542+00:00 app[web.1]:     result = context.run(func, *args)
2023-11-27T06:27:49.424542+00:00 app[web.1]:              ^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424542+00:00 app[web.1]:   File "/app/main.py", line 37, in test
2023-11-27T06:27:49.424542+00:00 app[web.1]:     driver = webdriver.Chrome(options=options)
2023-11-27T06:27:49.424543+00:00 app[web.1]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424543+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
2023-11-27T06:27:49.424543+00:00 app[web.1]:     super().__init__(
2023-11-27T06:27:49.424543+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 56, in __init__
2023-11-27T06:27:49.424543+00:00 app[web.1]:     super().__init__(
2023-11-27T06:27:49.424543+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
2023-11-27T06:27:49.424543+00:00 app[web.1]:     self.start_session(capabilities)
2023-11-27T06:27:49.424546+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
2023-11-27T06:27:49.424546+00:00 app[web.1]:     response = self.execute(Command.NEW_SESSION, caps)["value"]
2023-11-27T06:27:49.424546+00:00 app[web.1]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-27T06:27:49.424546+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
2023-11-27T06:27:49.424546+00:00 app[web.1]:     self.error_handler.check_response(response)
2023-11-27T06:27:49.424547+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
2023-11-27T06:27:49.424547+00:00 app[web.1]:     raise exception_class(message, screen, stacktrace)
2023-11-27T06:27:49.424547+00:00 app[web.1]: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
2023-11-27T06:27:49.424547+00:00 app[web.1]:   (session not created: DevToolsActivePort file doesn't exist)
2023-11-27T06:27:49.424551+00:00 app[web.1]:   (The process started from chrome location /app/.cache/selenium/chrome/linux64/119.0.6045.105/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

This version of ChromeDriver only supports Chrome version 85

Message: session not created: This version of ChromeDriver only supports Chrome version 85

Getting an error on a cronjob i had running for the past several months today. I think the driver needs to be updated to support the latest version of chrome.

Push rejected, failed to compile chromedriver app.

I'm trying to push the changes for my app to Heroku, and for some reason I am getting the following error when I try to push:

"Archive: /tmp/chromedriver.zip
remote: End-of-central-directory signature not found. Either this file is not
remote: a zipfile, or it constitutes one disk of a multi-part archive. In the
remote: latter case the central directory and zipfile comment will be found on
remote: the last disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of /tmp/chromedriver.zip or
remote: /tmp/chromedriver.zip.zip, and cannot find /tmp/chromedriver.zip.ZIP, period.
remote: ! Push rejected, failed to compile chromedriver app."

The buildpacks I am using are heroku/python, https://github.com/heroku/heroku-buildpack-google-chrome, and https://github.com/heroku/heroku-buildpack-chromedriver. I am using the Selenium ChromeDriver in my app. My app is running on one worker dyno. Any ideas? Thanks!

Chrome binary not found

I am getting the following problem in my heroku app:

2017-08-01 20:54:22 ac744713-8102-4c83-81fc-b4be4786b925 selenium.webdriver.remote.remote_connection[4] DEBUG Finished Request
Traceback (most recent call last):
  File "manage.py", line 89, in <module>
    manager.run()
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/app/.heroku/python/lib/python2.7/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "manage.py", line 83, in cron
    d.main()
  File "/app/blackbird/domain/cron.py", line 58, in main
    self.take_screenshots()
  File "/app/blackbird/domain/cron.py", line 208, in take_screenshots
    self.driver = webdriver.Chrome('chromedriver')
  File "/app/.heroku/python/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/app/.heroku/python/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/app/.heroku/python/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 188, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/app/.heroku/python/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
    self.error_handler.check_response(response)
  File "/app/.heroku/python/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 3.13.0-123-generic x86_64)

even though I have added the chrome driver and the google-chrome buildpacks:

enter image description here

Is there a step that I am missing to make my chrome binary available to my app?

Errors on Heroku R14 etc...

Hi, I am not sure this is considered good...
I posted a question on StackOverflow that no one seems able to answer.
With this issue I am trying to collect more knowledge to understand best practices and to avoid errors.

I suppose that you are using chromedriver on heroku in some of your applications.
I would like to know if you consider true the following statements:

  • When using selenium with chromedriver, you have call everytime WebDriver.quit even if in your scraping you have to login everytime you do something
  • You can't have a pool of already created chromedriver(s) to avoid the creation time of them, unless you have a paid plan with heroku giving more than 512MB
  • You can't create a WebDriver and closing it after a number of usages, because anyway after some navigate().to(URL) it will fail due to max memory reached. This is not related to window handles opened, because checking constantly I have only 1 window handle

Thanks in advance for your answers

Wrong version is downloaded

I understand that you're pulling the chromedriver's stable version from this page.
However, it is not the actual stable release, as can be seen here.
The first link shows that stable is v85 (which is beta, actually), and the 2nd link shows stable is v84.

No such file or directory: 'chromedriver'

I'm new in hekoru and I'm trying to develop a web scraper that works on hekoru constantly. The code is working in my local machine, but I don't have clarity of how initiallize the driver in Hekoru. I had alredy done:

  1. Install chrome heroku buildpacks:publish heroku/google-chrome master
  2. Install the chromedriver heroku create --buildpack https://github.com/rking32/heroku-buildpack-chromedriver.git
  3. Deploy manually my app from the branch of my GitHub repo.
    • In my app setting appears the the driver and chrome are were are suposed to be:

image

  1. Try to init my driver in python with selenium as follows
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(chrome_options=chrome_options)

Sadly, This code returns the next error

/app/Heroku/betpages_heroku.py:40: DeprecationWarning: use options instead of chrome_options
  driver = webdriver.Chrome(chrome_options=chrome_options)
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/app/.heroku/python/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/app/.heroku/python/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/Heroku/betpages_heroku.py", line 168, in <module>
    betplay(url)
  File "/app/Heroku/betpages_heroku.py", line 40, in betplay
    driver = webdriver.Chrome(chrome_options=chrome_options)
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 90, in __init__
    self.service.start()
  File "/app/.heroku/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

chromedriver unable to locate element

I've deployed a selenium script using python with chromedriver in play on my heroku server.

The driver is configured properly, and it does launch an instance. However, the driver is unable to locate the elements.

The script is working fine when tested on local server.

Any idea what could have gone wrong here?

unknown error: session deleted because of page crash

Hey all!

Have been using the Chrome + ChromeDriver Buildpacks for a couple years for a Python script that I run each day. I pushed a new commit that did not impact my webdriver code and received the following error when my script ran:

File "update_data.py", line 111, in download
    zenplanner(client_dict, download_dates, driver)
  File "/app/download_methods.py", line 384, in zenplanner
    driver.get(zenplanner_urls[report])
  File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: session deleted because of page crash
from tab crashed
  (Session info: headless chrome=83.0.4103.116)

As a follow up, the exact same code works normally on my local machine. I only receive this error when the script runs through Heroku.

I'd appreciate any guidance you all can provide to resolve this issue!

Thanks,
Matt

curl: (22) The requested URL returned error: 404

Heya, when deploying I get the following error

remote: -----> chromedriver app detected
remote: -----> Using chromedriver v93.0.4577.63 (set by the env var 'CHROMEDRIVER_VERSION')...
remote: -----> Downloading chromedriver v93.0.4577.63...
remote: curl: (22) The requested URL returned error: 404
remote:  !     Push rejected, failed to compile chromedriver app.
remote:
remote:  !     Push failed

It seems the URL used to fetch the chromedriver is not working:

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/93.0.4577.63/linux64/chromedriver-linux64.zip

I tried other versions (we always get the version string from https://chromedriver.storage.googleapis.com/index.html) but they don't work either.

I added a PR to fix the issue.

Unable to locate or obtain driver for chrome

Message: Unable to locate or obtain driver for chrome; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Was working yesterday. Now failing today.

GOOGLE_CHROME_BIN and CHROMEDRIVER_PATH are both set.

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")

chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
service = Service(executable_path=os.environ.get("CHROMEDRIVER_PATH"))
browser = webdriver.Chrome(service=service, options=chrome_options)

chromedriver version not match with browser

My app crashed today with the following error:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.96 with binary path /app/.apt/opt/google/chrome/chrome

I set the env variable CHROMEDRIVER_VERSION to (and re-deploy the app)
114.0.5735.16
or
116.0.5845.96

When I set the env variable CHROMEDRIVER_VERSION to 114.0.5735.16
here popping up the message:
chromedriver app detected
remote: -----> Downloading chromedriver v114.0.5735.16...
and then still the same error message pops when I call chrome driver.
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.96 with binary path /app/.apt/opt/google/chrome/chrome

When I set the env variable CHROMEDRIVER_VERSION to 116.0.5845.96
heroku reject me to deploy again
here is the error message:

remote: End-of-central-directory signature not found. Either this file is not
remote: a zipfile, or it constitutes one disk of a multi-part archive. In the
remote: latter case the central directory and zipfile comment will be found on
remote: the last disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of /tmp/chromedriver.zip or
remote: /tmp/chromedriver.zip.zip, and cannot find /tmp/chromedriver.zip.ZIP, period.
remote: ! Push rejected, failed to compile chromedriver app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to ema-cloz.
remote:
To https://git.heroku.com/XXXXXXX

does anyone run into the same issue?
thanks

Loading current app's URL in Heroku CI

Hey!

We've got this buildpack working, and can successfully use it to drive tests (for example, it loads google, does a search, etc), but can't figure out how to get it to access the app it's on's URL in Heroku CI. Is this not possible?

For reference we're using the create-react-app buildpack, which puts a built SPA on nginx.

It's my understanding that we should be able to get the app-name using Heroku Labs, but when enabling the metadata lab on our app those ENV variables aren't available. Does the labs not work within Heroku CI builds?

Chromedriver doesn't download

Hi there,

I cannot deploy my application any more, as the buildpack doesn't seem to be able to download cromedriver

-----> Downloading chromedriver v114.0.5735.90...
Archive:  /tmp/chromedriver.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/chromedriver.zip or
        /tmp/chromedriver.zip.zip, and cannot find /tmp/chromedriver.zip.ZIP, period.
 !     Push rejected, failed to compile chromedriver app.
 !     Push failed

cannot find zipfile directory in one of /tmp/chromedriver.zip

Issue just started today since recent commit.

remote: Archive: /tmp/chromedriver.zip
remote: End-of-central-directory signature not found. Either this file is not
remote: a zipfile, or it constitutes one disk of a multi-part archive. In the
remote: latter case the central directory and zipfile comment will be found on
remote: the last disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of /tmp/chromedriver.zip or
remote: /tmp/chromedriver.zip.zip, and cannot find /tmp/chromedriver.zip.ZIP, period.
remote: ! Push rejected, failed to compile Multipack app.

google chrome no longer running

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.                                    
  (unknown error: DevToolsActivePort file doesn't exist)                                                                                             
  (The process started from chrome location /app/.apt/usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed
.)       

Getting the above error in my python script. Have been running the same script for the past year or so, so I'm guessing something updated with Chrome but that wasn't updated in this buildpack.

Screen Shot 2020-04-08 at 2 40 35 AM

*Note I would have received a different error if there were a mismatch between the chromedriver version and the version of chrome. E.g. (when running locally to force the error):

Message: session not created: This version of ChromeDriver only supports Chrome version 78

and my previously working python code:

options = webdriver.ChromeOptions()
options.binary_location = os.environ.get("GOOGLE_CRHOME_BIN")
options.add_argument("--no-sandbox")
options.add_argument("--headless")
options.add_argument("--disable-dev-shm-usage")
options.add_argument('--disable-gpu')

the_path = os.environ.get("CHROMEDRIVER_PATH")
driver = webdriver.Chrome(executable_path=the_path, options=options)

chromedriver version not match with browser

My app crashed today with the following error:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 104
2022-08-04T11:05:59.494339+00:00 app[worker.1]: Current browser version is 103.0.5060.134 with binary path /app/.apt/usr/bin/google-chrome

I set the env variable CHROMEDRIVER_VERSION to (and re-deploy the app)
103.0.5060.134
or
104.0.5112.79

But both of them has same error, What should i do now ? We have crash every season ?

Explicitly set Version to ensure Deployment Repeatability

The way I understand this, tracking the latest chromedriver release and not letting developers explicitly set it (e.g. via environment variable) means deploying a certain commit to a certain environment does not guarantee the same result. An update on Google's end could break my app's functionality on a new deploy and without the ability to specify a version there would be no way for me to recover the old working setup.

This is the corollary of the following issue, which has some additional detail:
heroku/heroku-buildpack-google-chrome#48

CHROMEDRIVER_VERSION being ignored on Heroku

I am using Selenium with Chromedriver and Chrome to scrape data from a website. I've started getting the following error:

from session not created: This version of ChromeDriver only supports Chrome version 118
Current browser version is 117.0.5938.132

But I have CHROMEDRIVER_VERSION set as follows:

=== fbpmp Config Vars
CHROMEDRIVER_VERSION:       117.0.5938.132

From everything I could find this appears to be the proper way to lock down the version of the chromedriver buildpack. What am I doing wrong that is causing this to fail?

This is the last build log from 9/28:

-----> chromedriver app detected
-----> Using chromedriver v117.0.5938.132 (set by the env var 'CHROMEDRIVER_VERSION')...
-----> Downloading chromedriver v117.0.5938.132...
Archive:  /tmp/chromedriver.zip
  inflating: /tmp/build_7275b69c/.chromedriver/bin/LICENSE.chromedriver  
  inflating: /tmp/build_7275b69c/.chromedriver/bin/chromedriver  
-----> Creating chromedriver export scripts...

no documentation?

Should this still work? It's not deprecated, but there's no info regarding where the chromedriver is located...
Why not use an ENV variable like https://github.com/heroku/heroku-buildpack-google-chrome and document it as such?

Apparently it ends up in /app/.chromedriver/bin/chromedriver but it would be nice to have the proper documentation instead of guessing it.

Binary found, but not configured correctly.

I am not entirely sure if this is the correct project to post this issue in, if it's not please let me know where and I'll gladly move it.

So here is the error I am getting after I try to run my selenium tests on heroku's test ci.

Error log (I can post the whole thing if requested, this is the only bit that seems relevant).

GOOGLE_CHROME_BIN: /app/.apt/opt/google/chrome-beta/chrome
[493:493:0530/204932.631200:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /app/.apt/opt/google/chrome-beta/chrome-sandbox is owned by root and has mode 4755.

app.json

{
  "stack": "cedar-14",
  "environments": {
    "test": {
      "buildpacks": [
        {
          "url": "https://github.com/heroku/heroku-buildpack-xvfb-google-chrome"
        },
        {
          "url": "https://github.com/heroku/heroku-buildpack-google-chrome"
        },
        {
          "url": "https://github.com/heroku/heroku-buildpack-java"
        }
      ],
      "scripts": {
        "test-setup": "mvn install -DskipTests",
        "test": "mvn -B test -DCONDUCTOR_BROWSER=chrome"
      }
    }
  }
}

capabilities

"chromeOptions": {
   "binary": "/app/.apt/usr/bin/google-chrome"
}

I check the $GOOGLE_CHROME_BIN and it's exactly that^.

Any help would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.