redotvideo / examples

A collection of example projects built with Revideo
75 stars 5 forks source link

[parallelized-aws-lambda] Issue with headless chrome and Amazon Linux #10

Open diogeneshamilton opened 1 month ago

diogeneshamilton commented 1 month ago

I'm getting an error (failed to launch browser process) because the latest version of Chrome (127.0.6533.72) needs to use a version of CUPS which doesn't seem to be installed in the latest Amazon Linux environment (which is in the Dockerfile). Specifically it can't find httpConnect2:

undefined reference to "httpConnect2"

I have tried to find a solution for a PR, but so far can't seem to find the right package to install in the Docker image.

For now, I've pinned the versions of puppeteer and @sparticuz/chromium:

"@sparticuz/chromium": "126.0.0",
"puppeteer": "22.13.1",
justusmattern27 commented 1 month ago

thanks, it's probably better to pin the versions in general - will update it!

itsanishjain commented 20 hours ago

Hey did you able to fix this issue, I tried to do rendering using lambda and still getting this same error

Lambda invoke result: {
  statusCode: 500,
  body: '{"error":"Error during partial render: Error: Failed to launch the browser process!\\n/var/task/.cache/puppeteer/chrome/linux-127.0.6533.88/chrome-linux64/chrome: symbol lookup error: /var/task/.cache/puppeteer/chrome/linux-127.0.6533.88/chrome-linux64/chrome: undefined symbol: httpConnect2\\n\\n\\nTROUBLESHOOTING: https://pptr.dev/troubleshooting\\n"}'
}
justusmattern27 commented 3 hours ago

@itsanishjain hey, you should be able to fix this by using the chrome binary from the @sparticuz/chromium package through the executablePath option in renderPartialVideo:

puppeteer: { 
args: chromium.args, headless: chromium.headless,
executablePath: await chromium.executablePath(),
 }
itsanishjain commented 51 minutes ago

@itsanishjain hey, you should be able to fix this by using the chrome binary from the @sparticuz/chromium package through the executablePath option in renderPartialVideo:

puppeteer: { 
args: chromium.args, headless: chromium.headless,
executablePath: await chromium.executablePath(),
 }

Worked for me P.S. don't forget to rebuild your project