Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using Selenium Base Raw Works Locally But Internal Process Breaks It On AWS Lambda Image - Please Help! #2417

Answered by mdmintz
Jonathynlee asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Duplicate of #2334 (comment)

You must be logged in to vote
2 replies
Comment options

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!

Comment options

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

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /