[Public] IronPDF in AWS Lambda (.NET 8): Fixing Missing Chromium Binary Errors
Issue debugging Lambda function
Overview
When running IronPDF inside an AWS Lambda container image (typically on Linux) after upgrading to .NET 8 and using IronPDF, developers may encounter this error:
IronSoftware.Exceptions.IronSoftwareEmbeddedDeploymentMissingException:
Failed to find embedded resource 'Chrome.linux-x64.zip'
This occurs during the PDF rendering engine's startup, particularly when using ChromePdfRenderer
.
Common Error Stack Trace
Unhandled exception. System.Exception: Error while convert DOCX document to HTML:
IronSoftware.Exceptions.IronSoftwareEmbeddedDeploymentMissingException: Failed to find embedded resource 'Chrome.linux-x64.zip'
at IronSoftware.Deployment.AssetManager.GetEmbededResourceStream(...)
at IronSoftware.Deployment.EmbeddedResourceDeployment.Deploy()
at IronPdf.Engines.Chrome.LocalChromeClient.Initialize()
Why This Happens
This error is caused by one or more of the following issues:
1. Missing or Inaccessible Embedded Resources
IronPDF relies on embedded resources like Chrome.linux-x64.zip
to extract and run a headless version of Chromium for rendering. If the runtime doesn't match the expected platform or IronPDF is unable to locate the embedded binary, it throws this exception.
2. Incorrect Execution Context
The app may appear to be running on Linux, but tools like AWS Lambda Mock Test Tool (when run locally) will execute the function on the host OS — commonly Windows — even if the Dockerfile targets Linux. This causes a mismatch between the expected embedded resource and the actual runtime.
3. Using IronPDF.Slim
on the Wrong Platform
The IronPDF.Slim
NuGet package is optimized for Linux-only scenarios. Using it on Windows or Windows-based Lambda runtimes will sometimes fail due to binaries for Windows platform is not downloaded at runtime. Use IronPDF package to run on Windows.
How to Fix the Issue
1. Ensure You're Running on the Correct Runtime
When using AWS Lambda with container images:
-
Verify that your Dockerfile targets Linux and your image is being run on AWS Lambda’s Linux environment.
-
Do not test using Mock Tools on Windows, as this will not mimic the correct environment.
2. Use the Full IronPDF
Package If You Need Cross-Platform Support
If you're testing on both Windows and Linux, or locally on Windows:
Install-Package IronPdf
Instead of:
Install-Package IronPdf.Slim
-
IronPDF.Slim
is recommended for Linux -
IronPDF
(non-slim) includes support for both Windows and Linux
3. Testing Locally? Use Docker to Simulate AWS Lambda Linux
When testing locally, use Docker to replicate the Lambda environment:
docker build -t my-lambda-test .
docker run --rm my-lambda-test
This ensures your function runs with Linux-specific dependencies and that IronPDF loads the correct embedded Chromium binary.
Dockerfile Essentials for IronPDF in AWS Lambda (Linux)
Ensure your container installs the required dependencies:
FROM public.ecr.aws/lambda/dotnet:8
# Install Linux packages required for Chromium
RUN yum install -y \
pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 \
libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 \
libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 \
atk.x86_64 gtk3.x86_64 ipa-gothic-fonts \
xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi \
xorg-x11-utils xorg-x11-fonts-cyrillic \
xorg-x11-fonts-Type1 xorg-x11-fonts-misc \
glibc-devel.x86_64 at-spi2-atk.x86_64 mesa-libgbm.x86_64
Then copy your published .NET app into the container and deploy as usual.