[BUG] ETXTBSY with README example
See original GitHub issueEnvironment
chrome-aws-lambda
Version: 8.0.1puppeteer
/puppeteer-core
Version: 8.0.0- OS: Linux
- Node.js Version: 14.x
- Lambda / GCF Runtime:
Node.js 14.x
Expected Behavior
Chromium launches successfully.
Current Behavior
The following error returned when testing in AWS console:
{
"errorType": "Error",
"errorMessage": "spawn ETXTBSY",
"trace": [
"Error: spawn ETXTBSY",
" at ChildProcess.spawn (internal/child_process.js:403:11)",
" at Object.spawn (child_process.js:553:9)",
" at BrowserRunner.start (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:79:34)",
" at ChromeLauncher.launch (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/Launcher.js:86:16)",
" at async Runtime.exports.handler (/var/task/index.js:8:15)"
]
}```
## Steps to Reproduce
I copied exactly the example from the README:
```js
const chromium = require('chrome-aws-lambda');
exports.handler = async (event, context, callback) => {
let result = null;
let browser = null;
try {
browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
let page = await browser.newPage();
await page.goto(event.url || 'https://example.com');
result = await page.title();
} catch (error) {
return callback(error);
} finally {
if (browser !== null) {
await browser.close();
}
}
return callback(null, result);
};
I tried the answer here, clearing my node_modules and running npm install --no-bin-links
, and it had no effect for me.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[BUG] ETXTBSY when launching · Issue #187 - GitHub
Simple lambda reads HTML from event.body and returns PDF stream. Intended to be wired up to api-gateway. With a test event it will...
Read more >How to write a good README for your GitHub project?
Today we will focus on good practices of writing such a file - with a few examples, and a ready to use template....
Read more >README File – Everything you Need to Know - Great Learning
A README file is a text file that describes and launches a project. It comprises information that is frequently needed to grasp the...
Read more >README.md template | Documenting your project - Drupal
Information about content and formatting of project README files. ... Submit bug reports and feature suggestions, or track changes in the [issue ...
Read more >Error Pages - ReadMe Documentation
You can create custom error pages to display to your users if they try, for example, to access a broken link. Found under...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
TL;DR my problem is solved.
I hadn’t thought of the memory limit. Changing it from 128MB to 1024MB led to this:
And on second run:
But if I also increase the timeout, it succeeds in:
I’ll close the issue. Thanks for your help!
@yujiri8 I uploaded your Zip file and it ran successfully for me:
Are you allocating enough memory (> 512MB) to your Lambda?
As for 8.0.2, it only introduced a fix to the Makefile and an additional overloaded method, so it can’t be the culprit of this.