remotion-dev/remotion · error · Error
Failed to update Layers for function ${functionName}: ${conf
Error message
Failed to update Layers for function ${functionName}: ${configuration.StateReason ?? configuration.LastUpdateStatusReason ?? 'Unknown reason'} What it means
When deploying with Remotion Lambda's createFunction() over an EXISTING function (alreadyCreated) with custom layer ARNs, the client updates the function's Layers via UpdateFunctionConfiguration and polls GetFunctionConfiguration until stable. If AWS reports State 'Failed' or LastUpdateStatus 'Failed', this error is thrown with the StateReason AWS provided - the layer update was rejected or broke the function.
Source
Thrown at packages/lambda/src/api/create-function.ts:185
{indent: false, logLevel},
`Updating Layers for function ${functionName}`,
);
await lambdaClient.send(
new UpdateFunctionConfigurationCommand({
FunctionName: functionName,
Layers: layers,
}),
);
while (true) {
const configuration = await lambdaClient.send(
new GetFunctionConfigurationCommand({FunctionName: functionName}),
);
if (
configuration.State === 'Failed' ||
configuration.LastUpdateStatus === 'Failed'
) {
throw new Error(
`Failed to update Layers for function ${functionName}: ${configuration.StateReason ?? configuration.LastUpdateStatusReason ?? 'Unknown reason'}`,
);
}
if (
configuration.State === 'Active' &&
configuration.LastUpdateStatus !== 'InProgress'
) {
break;
}
await new Promise<void>((resolve) => {
setTimeout(resolve, 1000);
});
}
return {FunctionName: functionName};
}View on GitHub (pinned to 10db9de073)
Solutions
- Read the StateReason in the message - it is AWS's own explanation (e.g. layer not found, incompatible architecture)
- Verify each layer ARN exists and matches the runtime: `aws lambda get-layer-version --layer-name NAME --version-number N --region REGION` (check CompatibleRuntimes includes nodejs24.x and CompatibleArchitectures includes arm64)
- Delete the function and redeploy fresh: `npx remotion lambda functions rm FUNCTION_NAME` then re-run `functions create` - a clean create skips the failing update path
- Ensure layer ARNs are in the same region and account as the function
- Check the deploy role has lambda:GetFunctionConfiguration, lambda:UpdateFunctionConfiguration and lambda:PutFunctionConfiguration* permissions
Example fix
# before - stale layer ARN on an existing function npx remotion lambda functions create \ --layer-arns arn:aws:lambda:eu-central-1:123456789:layer:my-layer:1 # after - verify the layer, then recreate the function aws lambda get-layer-version-by-arn \ --arn arn:aws:lambda:eu-central-1:123456789:layer:my-layer:3 npx remotion lambda functions rm remotion-render-3-3-0- npx remotion lambda functions create \ --layer-arns arn:aws:lambda:eu-central-1:123456789:layer:my-layer:3
Defensive patterns
Strategy: retry
Validate before calling
# Before deploying over an existing function, confirm every layer ARN resolves
# and matches runtime/architecture
for arn in $LAYER_ARNS; do
aws lambda get-layer-version-by-arn --arn "$arn" --region "$REGION" \
--query '{runtimes: CompatibleRuntimes, archs: CompatibleArchitectures}' --output text
# expect: nodejs24.x (or similar) arm64
done Try / catch
// Wrap deployFunction and surface StateReason, then retry after correction
try {
await deployFunction({/* ... */});
} catch (err) {
if (
err instanceof Error &&
err.message.startsWith('Failed to update Layers for function')
) {
console.error('Layer update rejected by AWS:', err.message);
// fix layer ARNs (see StateReason), optionally delete + recreate the function, retry
throw err;
}
throw err;
} Prevention
- Validate layer ARNs with aws lambda get-layer-version-by-arn before every deploy
- Build custom layers for arm64 and a nodejs runtime compatible with the function
- Pin exact layer versions and keep them in the same region/account as the function
- Prefer deleting and recreating functions when layer sets change substantially
When it happens
Trigger: Calling `remotion lambda functions create` (or deployFunction) twice with --custom-role-arn/layer ARNs where the function already exists and the layer list changed, and AWS marks the layer update as Failed. Only happens in the alreadyCreated + customLayerArns path (packages/lambda/src/api/create-function.ts:170-188).
Common situations: Custom layer ARN deleted or version-number no longer exists; layer built for x86_64 while Remotion functions use arm64; layer incompatible with the nodejs24.x runtime; layer exceeds size limits; layer lives in a different region/account; IAM role lacking lambda:UpdateFunctionConfiguration leading AWS to report a failed state.
Related errors
- Deploying the site failed, and removing the generated bundle
- Lambda was created but has no name
- UnrecognizedClientException: The AWS credentials provided we
- UnrecognizedClientException: The AWS credentials provided we
- Failed to invoke Lambda function
AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22).
Data as JSON: /api/errors/a6bf2aabea7656e8.
Report an issue: GitHub.