remotion-dev/remotion · error · RemotionInvalidArgumentException

'function_name' parameter is required and cannot be empty or

Error message

'function_name' parameter is required and cannot be empty or whitespace

What it means

Constructor-time validation in the Python RemotionClient. Raised when the 'function_name' argument is None, empty, or whitespace-only. function_name identifies the deployed Lambda function that runs the render.

Source

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

        ... )

        Legacy usage (deprecated):

        >>> client = RemotionClient(
        ...     region='us-east-1',
        ...     serve_url='https://api.example.com',
        ...     function_name='my-function',
        ...     access_key='AKIA...',
        ...     secret_key='secret...'
        ... )
        """
       # Validate required parameters at construction time
        if not region or not region.strip():
            raise RemotionInvalidArgumentException("'region' parameter is required and cannot be empty or whitespace")
        if not serve_url or not serve_url.strip():
            raise RemotionInvalidArgumentException("'serve_url' parameter is required and cannot be empty or whitespace")
        if not function_name or not function_name.strip():
            raise RemotionInvalidArgumentException("'function_name' parameter is required and cannot be empty or whitespace")


        # Check for conflicting authentication methods
        if session and (access_key or secret_key):
            raise RemotionInvalidArgumentException(
                "Cannot specify both 'session' and explicit credentials "
                "('access_key'/'secret_key'). Please use only 'session'."
            )

        # Handle deprecated credential parameters
        if access_key is not None or secret_key is not None:
            warnings.warn(
                "Parameters 'access_key' and 'secret_key' are deprecated "
                "as of version 4.0.376 and will be removed in version 5.0.0. "
                "Please migrate to using 'session' for improved security. ",
                DeprecationWarning,
                stacklevel=2,
            )

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Deploy the Lambda function with `remotion lambda functions deploy` and copy the exact function name printed.
  2. Pass the bare function name (e.g. 'remotion-render-...-us-east-1') as function_name.
  3. Verify the function exists with `aws lambda get-function --function-name <name>` before constructing the client.

Example fix

// before
client = RemotionClient(
    region=region,
    serve_url=serve_url,
    function_name=None,
)

# after
client = RemotionClient(
    region=region,
    serve_url=serve_url,
    function_name='remotion-render-remotionlambda-...-us-east-1',
)
Defensive patterns

Strategy: validation

Validate before calling

def validate_function_name(name: str) -> str:
    if not name or not name.strip():
        raise ValueError('function_name required')
    n = name.strip()
    if len(n) < 1 or len(n) > 140:
        raise ValueError(f'invalid function_name length: {n!r}')
    return n

Type guard

def is_valid_function_name(value) -> bool:\n    return isinstance(value, str) and 1 <= len(value.strip()) <= 140

Try / catch

try:\n    client = RemotionClient(region=region, serve_url=serve_url, function_name=fn)\nexcept RemotionInvalidArgumentException as e:\n    raise SystemExit(f'function_name misconfigured: {e}')

Prevention

When it happens

Trigger: Instantiating RemotionClient with function_name=None, '', or whitespace; passing the ARN format that is not what the SDK expects; reading function name from a missing config key.

Common situations: Not having run `remotion lambda functions deploy` yet; confusing the function name with the site/serve URL; passing an ARN where a bare function name is expected; deploying to a different account/region and not updating config.

Related errors


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