Skip to content
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

Cannot run container locally using Lambda Emulator on M1 #237

Open
tanjinP opened this issue Apr 19, 2024 · 0 comments
Open

Cannot run container locally using Lambda Emulator on M1 #237

tanjinP opened this issue Apr 19, 2024 · 0 comments

Comments

@tanjinP
Copy link

tanjinP commented Apr 19, 2024

Hello, I am having success with this container on Lambda, but when running/testing locally using the Lambda emulator, I get the chromedriver issue. I am running this in on a Mac M1:

In a single terminal I run the container

docker run --platform linux/amd64 -p 9000:8080 umihico/aws-lambda-selenium-python:latest main.handler

In the another terminal I curl to invoke it (as per testing Lambda via emulator):

curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'

After some time, I usually get 1 of the 2 following errors:

This one is more consistent

[ERROR] WebDriverException: Message: disconnected: Unable to receive message from renderer
  (failed to check if window was closed: disconnected: not connected to DevTools)
  (Session info: chrome=123.0.6312.122)
Stacktrace:
#0 0x00400077a863 <unknown>
....

This one usually occurs the first time invoke the container after starting it

[ERROR] SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally
  (chrome not reachable)
  (The process started from chrome location /opt/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x00400077a863 <unknown>
...

This might be related to #235

I have set my Docker memory at max (16GB) and I do see the memory hover up to 8GB when running this in docker stats (this is a random snapshot when the "curl" in in progress before the exception/error is thrown:

CONTAINER ID   NAME           CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O        PIDS
842d00592c18   nervous_cray   333.92%   8.133GiB / 15.61GiB   52.09%    29.5kB / 15.9kB   242MB / 2.79MB   79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant