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

Problems running on AWS Lambda #81

Closed
davidnoah opened this issue Sep 14, 2017 · 9 comments
Closed

Problems running on AWS Lambda #81

davidnoah opened this issue Sep 14, 2017 · 9 comments

Comments

@davidnoah
Copy link

LOGS:
Error: write EPIPE
at exports._errnoException (util.js:1018:11)
at WriteWrap.afterWrite (net.js:800:14)

I am building a script that dynamically generates an email and also includes a highchart. This script will run as a lambda function for a massive amount of emails, although it seems to fail when I run the node-export-server "export" function. Any idea why this happens? And if so, how can I fix this?

@mccartney
Copy link

A duplicate of #42

@mccartney
Copy link

@davidnoah - by any chance are you using a Mac to deploy to Lambda?

I was. And that was the problem. After switching to Linux (for packaging the Lambda deployment package, probably npm install is the most relevant here) it worked.

I guess the problem is of some native libraries which one of the dependencies (phantompool?) brings. When deploying from OSX we might be trying to push OSX binaries to AWS Lambda (which is Linux-based).

@cvasseng
Copy link
Contributor

cvasseng commented Mar 5, 2018

Thanks for posting an update on this @mccartney.

That makes a lot of sense - we use the phantom-prebuilt package, so if the deployment scripts use the local node modules, you'll end up with a macos build of phantom.js.

@Keksike
Copy link

Keksike commented Apr 1, 2019

Indeed, PhantomJS is by default compiled for the platform where npm install is ran.

PhantomJS addresses this issue on the GitHub README.md here.

For me setting the environment variables to:

PHANTOMJS_PLATFORM="linux"
PHANTOMJS_ARCH="x64"

fixed the issue as I was running phantomjs on AWS Lambda (linux x64) but compiling it on MacOS.

@azizj1
Copy link

azizj1 commented Oct 6, 2019

Still experiencing this issue for Node 10.x on AWS Lambda, but not on Node 8.x

@saurabhjindalFMQ
Copy link

Still experiencing this issue for Node 10.x,12.x on AWS Lambda

@mccartney
Copy link

@saurabhjindalFMQ are you using Mac to build the Lambda?

@saurabhjindalFMQ
Copy link

@mccartney I'm using aws codebuild which uses liunx to build the packages. I have tried to build on my local machine linux also but it is not working

@mccartney
Copy link

OK. Then I don't know. My issue was different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants