question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run basic lambda example

See original GitHub issue

Example code: https://github.com/elie222/examples-1/tree/fix/aws-node-puppeteer-local/aws-node-puppeteer

This works locally:

serverless offline
# Then go to: http://localhost:3000/?url=https://google.com

But running:

serverless deploy
# Then go to: https://lambdaurl/?url=https://google.com

Gives this error:

{
  "message": "Internal server error"
}

And in the CloudWatch logs:

{
    "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 (<anonymous>)",
        "    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:93:5)"
    ]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
zolbayarscommented, Feb 20, 2020

After hours of frustration, used https://github.com/alixaxel/chrome-aws-lambda and it worked without an issue!

3reactions
skunkworkercommented, Jun 10, 2020

I tried to tackle this issue for couple of days. Didn’t succeed but I think I can show a way if anybody wants to continue.

Basically the problem is that Chrome bundled with serverless-chrome-plugin is over two years old and in not working on current Amazon stack.

I think the way to fix this issue is to use this PR to build fresh version of chromium and then replace it in node_modules/@serverless-chrome/lambda/dist.

The reason why my PR works is because the lambda runtime is continually being updated to newer and newer versions of the Amazon Linux AMI. The dependencies have significantly changed since the most recent release and need some tweaking in order to get right.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot execution issues in Lambda - AWS Documentation
Errors can occur during function initialization, when your handler code processes the event, or when your function returns (or fails to return) a...
Read more >
Unable to run lambda · Issue #377 · localstack ... - GitHub
Hello, I tried to run a simple example of lambda function like this one : exports.handler = function(event, context) { console.log('hello'); } ...
Read more >
How do I resolve the "Unable to import module ... - YouTube
... Knowledge Center article with this video: https://aws.amazon.com/premiumsupport/knowledge-center/ lambda -import-module-error-python/0...
Read more >
AWS lambda unable to create a scheduled event source
The lambda is running with basic lambda execution role. UPDATE. I temporarily gave the role under which the Lambda is executing admin access,...
Read more >
Amazon Lambda function errors in Python - 亚马逊云科技
This error is a result of using the Amazon Command Line Interface (Amazon CLI) to upload a deployment package that contains a C...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found