chrome-aws-lambda icon indicating copy to clipboard operation
chrome-aws-lambda copied to clipboard

[BUG] chrome-aws-lambda errors in Lambda Container Images

Open padraic-padraic opened this issue 3 years ago • 2 comments

Environment

  • chrome-aws-lambda Version: 10.1.0
  • puppeteer / puppeteer-core Version: 10.4.0 (tested also with 10.1.9
  • OS: Linux amd64 in a Docker container
  • Node.js Version: 14.x
  • Lambda / GCF Runtime: public.ecr.aws/lambda/nodejs:14 (Docker image)

Expected Behavior

I am able to launch Puppeteer.

Current Behavior

If I don't specify additional fonts, then I get an error:

[1215/153315.859869:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
Fontconfig error: Cannot load default config file: No such file: (null)
[1215/153315.957022:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)

If I do provide fonts using chromium.font, then I instead get

[1215/153347.383067:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
Fontconfig error: Cannot load default config file: No such file: (null)
[1215/153347.475996:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)

Steps to Reproduce

Example gist is here: https://gist.github.com/padraic-padraic/0c1800c4c4ff4e6231002a41fbf54d21

Download all files and run docker build -t aws_lambda_test . and docker run aws_lambda_test -c "node dist/no_font.js" or docker run aws_lambda_test -c "node dist/with_font.js" to see the errors.

Possible Solution

Errors involving Fontconfig / Locale have been raised as issues before, but for much older versions of the package. This is happening running the most recent versions with Node 14. Those solutions also relate to building Lambda Functions using layers rather than container images, so it's not clear to me how to apply them here.

padraic-padraic avatar Dec 15 '21 15:12 padraic-padraic

Im encountering this issue on EC2—didn't have this issue on digitalocean droplets

MANTENN avatar Feb 13 '22 11:02 MANTENN

https://yum-info.contradodigital.com/view-package/base/fontconfig/

install that and it should fix it.

MANTENN avatar Feb 13 '22 11:02 MANTENN