-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Using Selenium Base Raw Works Locally But Internal Process Breaks It On AWS Lambda Image - Please Help! #2417
-
Hello,
I have a seleniumbase application running just find in docker when I build it locally and run it. When I deploy it to Lambda I was given the issue below.
driver setup
driver = Driver(
undetectable=True,
binary_location='/opt/chrome/chrome',
headless=True,
user_data_dir='/tmp/chrome-user-data',
remote_debug=True,
extension_dir=capsolverDir,
uc_cdp_events=False,
chromium_arg="--disable-dev-tools,--no-sandbox,--disable-dev-shm-usage,--no-zygote,--remote-debugging-port=9222",
cap_string='{"browserVersion":"118.0.5993.70"}'
)
chromedriver is on my path.
Then I am presented with these errors
[ERROR] SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location /opt/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Its finding the drivers. I am definitely using the same version of driver and browser
Shell script
echo "Downloading Chromium..."
curl "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chrome-linux64.zip" > /tmp/chrome-linux64.zip
unzip /tmp/chrome-linux64.zip -d /tmp/
mv /tmp/chrome-linux64/ /opt/chrome
curl "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip" > /tmp/chromedriver-linux64.zip
unzip /tmp/chromedriver-linux64.zip -d /tmp/
mv /tmp/chromedriver-linux64/chromedriver /opt/chromedriver
Does anyone know how I can fix this?
PS. I want to use my own driver and browser. I know seleniumbase can download them for me, but for this use case, I need to be able to preload the drivers in the image and can't have them download at runtime.
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 2
Duplicate of #2334 (comment)
Replies: 1 comment 2 replies
-
Duplicate of #2334 (comment)
Beta Was this translation helpful? Give feedback.
All reactions
-
I am not so sure this is the same issue. I am sorry it took so long to get back to you.
I merely added cap_string to try and remedy the problem I was already having. Which is the same issue mentioned above. Any thoughts? I am happy to provide any more information needed.
Everything run completely fine locally. As soon as it goes up to Lambda, I am getting a tab crashed issue or chrome crashed issue based on changes to the configuration. (tab crashed with pyvirtualdisplay, chrome crash with vd)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
The main reason I took so long is due to potentially moving to the Fargate stack instead of lambda. But I think Lambda just has too many up sides in my use case
Beta Was this translation helpful? Give feedback.