heroku-buildpack-google-chrome icon indicating copy to clipboard operation
heroku-buildpack-google-chrome copied to clipboard

unknown error: session deleted because of page crash

Open mattblank11 opened this issue 4 years ago • 2 comments

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

mattblank11 avatar Jul 16 '20 19:07 mattblank11

Getting same error here.

kingkong-cmd avatar Sep 12 '20 14:09 kingkong-cmd

Try adding the Chrome option disable-dev-shm-usage, this helped fixed the issue for me since /dev/shm is too small on Heroku to run Chrome.

Created a blog post on how to solve this issue and also on how to add the ability to save screenshots: Heroku: Use Selenium to run Google Chrome in a Python Script

jacektrocinski avatar Nov 15 '20 10:11 jacektrocinski