sambaiz / puppeteer-lambda-starter-kit

Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
MIT License
580 stars 82 forks source link

Task timed out after 300.07 seconds #12

Open HareshChhelana opened 6 years ago

HareshChhelana commented 6 years ago

{ "errorMessage": "2018-02-07T13:38:33.285Z 7d79ae5e-0c0b-11e8-9c34-071d38a89c78 Task timed out after 300.07 seconds" }

Getting above error when try to run below code

const mpromise = require('promise');

const setupS3Chrome = () => { return new mpromise(function (resolve, reject) { const params = { Bucket: config.remoteChromeS3Bucket, Key: config.remoteChromeS3Key }; console.log(params); s3.getObject(params).createReadStream().on('error', err => reject(err)).pipe(tar.x({ C: config.setupChromePath })).on('error', err => reject(err)).on('end', () => resolve()); }); };

lucianweber commented 6 years ago

I had the same problem. In my case, I had not configured my VPC correctly in order for my Lambda Function to have access to the internet.

You should check out this article. After I had configured my VPC correctly (2 private subnets, 1 public subnet) and added only the two private subnets to my Lambda Function, I was able to access the Internet from within and the S3 Download started working too.