-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
WebDriverException: Message: Service /opt/chromedriver unexpectedly exited. Status code was: 127 #323
Comments
This is not a direct solution, but you can just use native chromium instead of serverless-chrome. Does this alternative way achieve your needs? I have a demo repository here. |
@umihico , I used native chromium that you've mentioned and the file size exceeds. Asking me to use an s3 bucket. I don't have rights to use an s3 bucket, only lambda rights. Please guide. Thanks. |
You can import code from S3 or lambda layer, or docker image. My solution above is docker. You can try docker image or lambda layer if S3 is not option. |
@umihico I did use lambda layers but the size exceeds 10 MB. HOW do i upload a docker image? Your help will be appreciated. |
It says lambda layer size is 250MB. |
@umihico Thanks! Works just fine |
using selenium 4.1.0
chromdriver = https://chromedriver.storage.googleapis.com/95.0.4638.69/chromedriver_linux64.zip
headless-chromium = v1.0.0-57
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
def lambda_handler(event, context):
options = webdriver.ChromeOptions()
options.binary_location = '/opt/headless-chromium'
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--single-process')
options.add_argument('--disable-dev-shm-usage')
get error
Response
{
"errorMessage": "Message: Service /opt/chromedriver unexpectedly exited. Status code was: 127\n",
"errorType": "WebDriverException",
"requestId": "75128542-446b-4cff-a28e-6406e1ba41f4",
"stackTrace": [
" File "/var/task/lambda_function.py", line 14, in lambda_handler\n driver = webdriver.Chrome(\n",
" File "/opt/python/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in init\n super(WebDriver, self).init(DesiredCapabilities.CHROME['browserName'], "goog",\n",
" File "/opt/python/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 90, in init\n self.service.start()\n",
" File "/opt/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 98, in start\n self.assert_process_still_running()\n",
" File "/opt/python/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running\n raise WebDriverException(\n"
]
}
The text was updated successfully, but these errors were encountered: