When dealing with some memory issues, my script was interrupted and now it will not restart. I am getting an error "selenium.common.exceptions.SessionNotCreatedException: Message: session not created from tab crashed (Session info: headless chrome=84.0.4147.135)"
I read a few other similar questions (this one is almost identical), but the solutions do not resolve my problem.
Here is my code:
from selenium import webdriver
chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument("--headless")
chromeOptions.add_argument("--remote-debugging-port=9222")
chromeOptions.add_argument('--no-sandbox')
chromeOptions.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US',
"download.default_directory": download_location,
"download.directory_upgrade": True})
webdriver_location = '/usr/bin/chromedriver'
driver = webdriver.Chrome(webdriver_location,options=chromeOptions)
I attempted to add the chromeOptions.add_argument('--disable-dev-shm-usage')
and received the same error.
Because the setup was running perfectly moments before and no updates have been done, I do not believe any versioning is the problem. I'm running on a Centos 7 server. I originally received the error with Google Chrome 84 and Chromedriver 84. Same error occurs when upgrading both to 85.
Here is the full error:
Traceback (most recent call last):
File "server_scraper_javascript_v2.py", line 323, in <module>
driver = webdriver.Chrome(webdriver_location,options=chromeOptions)
File "/home/education01/scraper/env/lib64/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "/home/education01/scraper/env/lib64/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/home/education01/scraper/env/lib64/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/education01/scraper/env/lib64/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/education01/scraper/env/lib64/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created
from tab crashed
(Session info: headless chrome=84.0.4147.135)
UPDATE:
I do not have experience using Chromium without Selenium and a webdriver, but if I run chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/
, it fails and I receive this:
#
# Fatal error in , line 0
# Fatal process out of memory: Failed to reserve memory for new V8 Isolate
#
#
#
#FailureMessage Object: 0x7ffc0fc7ed50#0 0x5619c34ebdd9 <unknown>
--2020-08-27 10:20:27-- https://clients2.google.com/cr/report
Resolving clients2.google.com (clients2.google.com)... 172.217.165.142, 2607:f8b0:4006:808::200e
Connecting to clients2.google.com (clients2.google.com)|172.217.165.142|:443... connected.
HTTP request sent, awaiting response... [0827/102028.181052:ERROR:headless_shell.cc(391)] Abnormal renderer termination.
200 OK
Length: unspecified [text/plain]
Saving to: ‘/dev/fd/4’
0K Crash dump id: 80939f7cd5646339