serverless / examples

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.
https://www.serverless.com/examples/
Other
11.41k stars 4.47k forks source link

aws-node-puppeteer - {"message": "Internal server error"} #482

Open unickq opened 4 years ago

unickq commented 4 years ago

Cloned aws-node-puppeteer repo.

npm i serverless offline - works as expected serverless deploy - {"message": "Internal server error"}

what's wrong? any additional config required?

Thanks

michaldolnik commented 4 years ago

I have the same problem...

mvaneijgen commented 4 years ago

Same here!

Here is the Cloud watch error I get

Error occured in serverless-plugin-chrome wrapper when trying to ensure Chrome for hello() handler. { flags: [] } Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the log

Here is the full gist https://gist.github.com/mvaneijgen/c4356a8e7dab84ed8abf80d33604f7d1

JaredReando commented 4 years ago

Same here!

I tried adding a --headless flag in "/node-modules/@serverless-chrome/lamba/dis/bundle.es.js/" around lines 338 / 349 after seeing that referenced in an older issue thread, but still no dice.

All I've done is clone / setup / deploy, so no other custom configs could be messing with the mojo....

demilp commented 4 years ago

Same here. Here is my log

ERROR   Uncaught Exception      {"errorType":"Error","errorMessage":"spawn /var/task/node_modules/@serverless-chrome/lambda/dist/headless-chromium EACCES","code":"EACCES","errno":"EACCES","syscall":"spawn /var/task/node_modules/@serverless-chrome/lambda/dist/headless-chromium","path":"/var/task/node_modules/@serverless-chrome/lambda/dist/headless-chromium","spawnargs":["--disable-dev-shm-usage","--disable-gpu","--single-process","--no-zygote","--no-sandbox","--remote-debugging-port=9222","--user-data-dir=/tmp/chrome.AUlavv8","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-gpu","--single-process","--no-zygote","--no-sandbox","about:blank"],"stack":["Error: spawn /var/task/node_modules/@serverless-chrome/lambda/dist/headless-chromium EACCES","    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)","    at onErrorNT (internal/child_process.js:469:16)","    at processTicksAndRejections (internal/process/task_queues.js:84:21)"]}
END RequestId: 99eb7477-0fa6-4919-a881-70715199a495
REPORT RequestId: 99eb7477-0fa6-4919-a881-70715199a495  Duration: 94.39 ms      Billed Duration: 100 ms Memory Size: 1024 MB                 Max Memory Used: 26 MB

Unknown application error occurred
YuK1Game commented 4 years ago

mee too... 🥺

tiboprea commented 4 years ago

I'm experiencing the same issues. Has anyone managed to find a fix?

Azsael commented 4 years ago

I believe this is linked to this issue (https://github.com/adieuadieu/serverless-chrome/issues/240)

botoxparty commented 3 years ago

Also getting the same thing :-/

hndr91 commented 3 years ago

I've got the same issue

Liu-huaicheng commented 3 years ago

same issue

michaldolnik commented 3 years ago

Actually I have ended up with using AWS Fargate for my use case. As long as AWS lamba has 15 mins runtime, it's not useful for my use case anymore...

hir09 commented 3 years ago

const puppeteer = require('puppeteer');

(async () => { //const browser = await puppeteer.launch({headless: false, defaultViewport: null}); const browser = await puppeteer.launch({defaultViewport: null}); const page = await browser.newPage(); await page.setViewport({ width: 1920, height: 1080});

await page.goto('https://www.rezultati.com/', {waitUntil: 'networkidle2'});

const firstTeamName = await page.evaluate(() => { let a = document.querySelector("#g_1_KAjFXPMu > div.eventparticipant.eventparticipant--home"); return a.innerText; })

console.log(firstTeamName)

await browser.close(); })();

hir09 commented 3 years ago

above is my script and blow is my error....please help , any hero expert here :

i followed this

https://www.serverless.com/examples/aws-node-puppeteer

2021-01-29T06:21:00.312Z 0333c6a5-06af-4a23-a37f-0f0ef8a675b4 ERROR Invoke Error { "errorType": "Error", "errorMessage": "Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.", "stack": [ "Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.", " at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:376:13", " at Generator.throw ()", " at step (/var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:311:193)", " at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:311:404", " at processTicksAndRejections (internal/process/task_queues.js:97:5)" ] }

and this is the error

yanekyuk commented 3 years ago

Same here. Also, putting DEBUD: "*" seems to break the logs page by causing infinite loading. I have tried disabling --v=99 flag on node_modules/@serverless-chrome/lambda/dist/bundle.es.js as it was suggested on multiple issues.

chicomcastro commented 2 years ago

It's still happening :(

sbbeez commented 1 year ago

+1