remotion-dev/remotion · error · RemotionRenderingOutputError

Lambda function returned an error: {decoded_result['errorMes

Error message

Lambda function returned an error: {decoded_result['errorMessage']}

What it means

Raised after a successful Lambda invocation when the parsed response dict contains an 'errorMessage' key. This is the Lambda runtime's standard shape for an uncaught exception inside the function - the function crashed, not the network or protocol.

Source

Thrown at packages/lambda-python/remotion_lambda/remotionclient.py:500

            parsed_results = self._parse_stream(result_raw)
            decoded_result = parsed_results[-1] if parsed_results else {}
        except ClientError as e:
            raise e
        except ParamValidationError as e:
            raise RemotionInvalidArgumentException(
                f"Invalid Lambda invocation parameters: {e}"
            ) from e
        except json.JSONDecodeError as e:
            raise RemotionException(
                f"Failed to decode final Lambda response: {e}. Raw response: {result_raw}"
            ) from e
        except UnicodeDecodeError as e:
            raise RemotionException(
                f"Failed to decode Lambda response payload: {e}"
            ) from e

        if 'errorMessage' in decoded_result:
            raise RemotionRenderingOutputError(
                f"Lambda function returned an error: {decoded_result['errorMessage']}"
            )

        if 'type' in decoded_result and decoded_result['type'] == 'error':
            raise RemotionRenderingOutputError(
                f"Remotion rendering error: {decoded_result['message']}"
            )
        if 'type' not in decoded_result or decoded_result['type'] != 'success':
            raise RemotionRenderingOutputError(
                f"Unexpected Lambda response format: {result_raw}"
            )

        return decoded_result

    def _custom_serializer(self, obj: Any) -> Any: # Added type hints
        """A custom JSON serializer that handles enums and objects."""
        if isinstance(obj, Enum):
            return obj.value if hasattr(obj, 'value') else obj.name

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Read the full 'errorMessage' value (often a JS stack trace) to identify the failing line inside the function.
  2. Increase Lambda memory (Remotion recommends at least 2048MB; more for heavy compositions).
  3. Check CloudWatch Logs for the function for the full error and surrounding context.
  4. Verify the deployed bundle version matches the deployed Lambda layer (chromium/FFmpeg) version.

Example fix

// before - function runs out of memory
aws lambda update-function-configuration --function-name remotion-render-... --memory-size 1024
client.render_media(...)

# after
aws lambda update-function-configuration --function-name remotion-render-... --memory-size 4096
client.render_media(...)
Defensive patterns

Strategy: try-catch

Try / catch

try:\n    result = client.render_media(...)\nexcept RemotionRenderingOutputError as e:\n    msg = str(e)  # contains decoded_result['errorMessage']\n    log.error('Lambda crashed: %s', msg)\n    # surface to monitoring; do NOT blindly retry without fixing the function\n    raise

Prevention

When it happens

Trigger: The deployed Remotion Lambda function threw an uncaught exception (chromium crash, out of memory, missing codec, bad input). The 'errorMessage' value typically contains the JS stack trace from the function.

Common situations: Chromium headless crash due to low memory; FFmpeg missing a codec on the Lambda layer; an error thrown by the user's composition code; incompatible Remotion bundle vs runtime; S3 read failure from inside the function.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/c46c792edba0d90a. Report an issue: GitHub.