Open dashcraft opened 6 months ago
Same problem here. Was also working fine 1 month before
I had the same problem, apparently there is a new version in the lambda runtime, in this new version are needed the files that are added in version 119.0. 2 of “@sparticuz/chromium”, so if you had a version lower than this and also had to configure the version of the lambda runtime as “Auto” this will take the latest version making you generate an error when launching the browser, can be solved by updating the package “@sparticuz/chromium” to version 119.0.2 or higher (I updated to version 121), or manually adding the ARN of the previous version of the runtime.
I had the same problem, apparently there is a new version in the lambda runtime, in this new version are needed the files that are added in version 119.0. 2 of “@sparticuz/chromium”, so if you had a version lower than this and also had to configure the version of the lambda runtime as “Auto” this will take the latest version making you generate an error when launching the browser, can be solved by updating the package “@sparticuz/chromium” to version 119.0.2 or higher (I updated to version 121), or manually adding the ARN of the previous version of the runtime.
I updated to 121 but then i get the error relate to Error: spawn ETXTBSY when trying to load the executable path during browser spawn process.
I had the same problem, apparently there is a new version in the lambda runtime, in this new version are needed the files that are added in version 119.0. 2 of “@sparticuz/chromium”, so if you had a version lower than this and also had to configure the version of the lambda runtime as “Auto” this will take the latest version making you generate an error when launching the browser, can be solved by updating the package “@sparticuz/chromium” to version 119.0.2 or higher (I updated to version 121), or manually adding the ARN of the previous version of the runtime.
For me, it's fixed! Thank you
I had the same problem, apparently there is a new version in the lambda runtime, in this new version are needed the files that are added in version 119.0. 2 of “@sparticuz/chromium”, so if you had a version lower than this and also had to configure the version of the lambda runtime as “Auto” this will take the latest version making you generate an error when launching the browser, can be solved by updating the package “@sparticuz/chromium” to version 119.0.2 or higher (I updated to version 121), or manually adding the ARN of the previous version of the runtime.
I updated to 121 but then i get the error relate to Error: spawn ETXTBSY when trying to load the executable path during browser spawn process.
I'm using the following versions:
It's ok now for me
I had the same problem, apparently there is a new version in the lambda runtime, in this new version are needed the files that are added in version 119.0. 2 of “@sparticuz/chromium”, so if you had a version lower than this and also had to configure the version of the lambda runtime as “Auto” this will take the latest version making you generate an error when launching the browser, can be solved by updating the package “@sparticuz/chromium” to version 119.0.2 or higher (I updated to version 121), or manually adding the ARN of the previous version of the runtime.
I updated to 121 but then i get the error relate to Error: spawn ETXTBSY when trying to load the executable path during browser spawn process.
could you share with me the code with which you are running chromium to try to replicate the error?
for now you can change the runtime in the lambda configuration, you can go to the CloudWatch logs and look for a log of when the function was still running, copy the runtime arn, it is the first message that appears in those logs, then go to the function configuration, in the “Code” section look for the runtime configuration and click on edit, mark it as “Manual” and paste the ARN that you just copied.
Copying the arn runtime (18.26) worked! runtime (18.28) was definitely causing the issue. For v123, here's a snippet of code that should reproduce the error.
Below snippet: v123.0.1 chromium/sparticuz nodejs20.x.x runtime
import puppeteer from "puppeteer-core";
import chromium from "@sparticuz/chromium";
export async function handle() {
let path = await chromium.executablePath("https://github.com/Sparticuz/chromium/releases/download/v123.0.1/chromium-v123.0.1-pack.tar")
let configs = {
args: chromium.args,
defaultViewport: chromium.defaultViewport,
protocolTimeout: 720_000,
executablePath: path,
headless: true
}
const browser = await puppeteer.launch(configs);
}
This results in an error...:
Error Error: spawn ETXTBSY
at ChildProcess.spawn (node:internal/child_process:421:11)
Error: spawn ETXTBSY
I was trying in node 18 and 20 but in both cases it worked correctly, to replicate your error I had to lower the memory allocated to 128MB and lower the timeout, maybe this is what was causing the error, could you confirm me if the memory you allocated to the lambda is higher than 512MB.
I may have some surface area for memory issues, since i'm using sst and not serverless to deploy./ It's got some bloat to it.
We had the same issue happen to us this morning. We change out our versions of puppeteer-core, @sparticuz/chromium, and runtime to match the versions in the comment here 👉 https://github.com/Sparticuz/chromium/issues/270#issuecomment-2083798654.
This worked for us - thank you @joaodezembro
@BrianBorge I'll try that out and see if that helps, thanks! I'll report back!
@joaodezembro It will be great if you have any suggestions on the compatible versions for the node 16 runtime env?
@joaodezembro It will be great if you have any suggestions on the compatible versions for the node 16 runtime env?
@AkbarHabeeb , sadly i don't have. we migrated straight from node 14.x, when AWS removed the support for 14 we jumped for the 18.x..
In last occasion you can set the AMI version for your lambda to 2 or 3 versions before and, if was working before, will work again, if wasn't, you need to play between puppeteer-core versions and you can't change the chromium bellow 119.0.2
But honestly the true recommendation is to upgrade your node version
@BrianBorge still get the: ETXTBSY error with those settings
We had the same ProtocolError in lambda Runtime Version: nodejs:16.v35 failed, nodejs:16.v33 however worked so we changed to this one for now
The ETXBSY is only when i try to run v119+ and node 18 or node 20. Ideally i'd like to use node 20, but that didn't work when i tried it. I've currently lowered everything to node 18.26 via the runtime management arn technique mentioned and that's unbroken all the scrapers we have running atm.
Environment
chromium
Version: "@sparticuz/chromium": "^119.0.2",puppeteer
/puppeteer-core
Version: "puppeteer-core": "^21.5.0",Expected Behavior
Puppeteer should've launched normally.
Current Behavior
Recently lambdas on Nodejs18.x.x have started failing to launch the browser process for chromium with the following error: \"error\":{\"name\":\"TargetCloseError\",\"cause\":{\"name\":\"ProtocolError\"}}
Spartacuz chromium v118.0.0 was previously working fine on lambdas and stopped working.
I attempted to upgrade to run on Spartacuz chromium v123, but it fails to run due to the following error: Error: spawn ETXTBSY
Steps to Reproduce
Possible Solution
Not sure, there seems to be some child process issues when loading the binary in the latest version which should be fixed.