-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
[BUG] No longer working in Lambda #271
Comments
Downgrading to:
Seems to have worked. Leaving this open just to verify I didnt make a mistake selecting the wrong package versions? |
This issue hit us today but we've not updated for a while so it seems to effect old versions too. Is there anyway to make this project dump a stacktrace when the browser crashes? |
Make sure to leave graphics mode enabled. The option will be fixed in the next version. I've been traveling so I haven't had time to update to chromium 124. |
You can add puppeteer.launch({dumpio:true}) in the object. |
We have also started facing same issue. We have not update package version from 3 months. While trying to figure out the issue, we found that it is not working only when html contains https URLs as we had some https URLs in img tag and link tag. With http urls, it is working fine. We had the following package.json
Same thing is working fine with https URLs after updating package version to (as mentioned by @fire015 )
|
Having the same issue, not working in our production app. |
Solved. In my case, Downgrading to version as you describe and additionally I have to install "web-streams-polyfill" package. And added this line : global.ReadableStream = require('web-streams-polyfill').ReadableStream; |
We've worked around it by rolling back to the previous Lambda Runtime ARN. |
How do you do this with Serverless framework? |
We also ran into this today, the version changes suggested above:
and in our case an upgrade of the Chromium Lambda Layer to latest was the change combination that got us back up and running. |
Ours doesn't seem to want to pull from s3
|
@ryan-concora functions:
hello:
runtimeManagement:
mode: manual
arn: arn:aws:lambda:us-east-1::runtime:0cdcfbdefbc5e7d3343f73c2e2dd3cba17d61dea0686b404502a0c9ce83931b9 The ARN version in the example above works for me (The offending ARN is mentioned in OP: #271 (comment)) |
Facing the same issue. Error: spawn Unknown system error -8
Tried upgrading to
This still did not work. Any other ideas ?? |
Our solution:
|
Removing our disabling of the graphics mode solved this for us: - chromium.setGraphicsMode = false
+ // FIXME: re-enable in Chromium 124
+ // ref: https://github.com/Sparticuz/chromium/issues/271#issuecomment-2085784736
+ // chromium.setGraphicsMode = false with the following versions: "@sparticuz/chromium": "123.0.1",
"playwright-core": "1.43.1", edit: actually, not sure about this, we're still seeing some errors |
FWIW I was able to get it working with:
|
setting this works |
We got into an error saying Navigation failed because browser has disconnected! seems like chrome crashed. Is this the same issue? |
This worked also for me puppeteer-core 22.6.0 |
I am curious about the root cause, seems it relate to SSL lib update, but why GraphicsMode can make it solved. |
Yes we were getting the same error "Navigation failed because browser has disconnected!", but it was happening in those cases only where were are loading some asset using https, http and setOfflineMode(true) works fine. |
This works for us. We migrated to a previous version of Runtime on lambda(Node.Js 18.*)
package.json for compatibility.
|
I am having a similar issue to some of the more recently posted comments in this thread:
Others are saying that downgrading versions helped them, but I am starting to wonder if there is something else at play here. This has crept up for many of us on all different versions. Is there a corrupted browser object being cached between lambda executions and deploys? Is it the downgraded version or the deploy of the downgraded version that is actually fixing the issue? I am wondering if this issue creeps back up for those who have said it has been fixed with a version downgrade. We started seeing this with these versions, which were previously working for a year. Then all of a sudden we started getting the error.
Did AWS change something with lambdas and lambda layers that is biting all of us? |
Yes, AWS updated some libraries that are causing issues with the libraries included in this package. I'm in contact with the team at AWS and we will be working on a solution. I would recommend pinning the lambda execution environment while this issue gets sorted. |
I'm having a similar issue; it suddenly stopped working and started giving us this error code:
|
I rolled back manualy the runtime version and it worked |
on one of my projects it works, on a different one, same settings same packages it does not work |
@tomasalvarez13 which runtime version worked for you, specifically? |
for me the one that worked on one place and didn't work on a different project is: same configuration on one account works on the other one it does not work, it goes timeout on: |
@tyanko1 one from 27/04/2024 |
@raducretu you can specify the exact version of the runtime under something called "runtime management configuration". If you look at your logs from when things worked (a few days ago) you should see which arn they are using as it's printed in the INIT_START. Look for your old arn that worked, and then go in and change it to that for your Lambda. More info here: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html |
For everyone that is still experiencing issues after pinning the runtime version: check if you're properly closing the browser at the end of your lambda. Our function was running fine for over a year with puppeteer-core try {
const browser = await puppeteer.launch({
// ...
});
const page = await browser.newPage();
// ... actions
await page.close();
} catch {
// ... error handling
} to var browser;
try {
browser = await puppeteer.launch({
// ...
});
const page = await browser.newPage();
// ... actions
for (const page of await browser.pages()) {
await page.close();
}
} catch {
// ... error handling
} finally {
if (browser) {
await Promise.race([browser.close(), browser.close(), browser.close()]);
}
} along with pinning the version fixed the issues for us, it's been running fine for a few hours now. |
We were running our pdf export lambdas on |
@fernedingd what is the reasoning behind using |
@LinusU we initially removed the |
We were running our lambda on
|
This worked, thankyou |
👀 |
This worked for us! Lambdas are up and running after a couple of days of 🔥... But waiting for a definitive solution. |
Working with runtime above by configure lambda runtime manually |
serverless: maybe need version 3.x+ since it is a new feature last year, https://www.serverless.com/framework/docs-providers-aws-guide-functions |
how we do now is store the ARN into SSM then map to runtimemanagement > arn |
This worked also for me |
To everyone who's reading this thread looking for answers for Vercel, what eventually worked for me: (I'm not sure what here is responsible for a fix)
Just in case: puppeteer-core is "^21.3.8" |
@Sparticuz any news on this? Pinning to older version for a long run is not perfect solution for security reasons. |
version 123.0.1 seems to be working again on my end. not sure what the root cause is. lib version: package.json
code:
Lambda runtime
edit: set graphics mode to true seems fix the problem |
I confirm using
Worked for us as well. We used it as newest lambda layer from https://github.com/shelfio/chrome-aws-lambda-layer |
package.json:
code:
It's freezing after "Creating new page" appears in the console logs.
Lambda 18.x (tried with 20.x too) with 2GB memory
Runtime version ARN:
arn:aws:lambda:eu-west-2::runtime:b475b23763329123d9e6f79f51886d0e1054f727f5b90ec945fcb2a3ec09afdd
The text was updated successfully, but these errors were encountered: