{"record":{"id":"4f412f58cda637a6","repo":"remotion-dev/remotion","slug":"function-name-parameter-is-required-and-cannot-b","errorCode":null,"errorMessage":"'function_name' parameter is required and cannot be empty or whitespace","messagePattern":"'function_name' parameter is required and cannot be empty or whitespace","errorType":"validation","errorClass":"RemotionInvalidArgumentException","httpStatus":null,"severity":"error","filePath":"packages/lambda-python/remotion_lambda/remotionclient.py","lineNumber":171,"sourceCode":"        ... )\n\n        Legacy usage (deprecated):\n\n        >>> client = RemotionClient(\n        ...     region='us-east-1',\n        ...     serve_url='https://api.example.com',\n        ...     function_name='my-function',\n        ...     access_key='AKIA...',\n        ...     secret_key='secret...'\n        ... )\n        \"\"\"\n       # Validate required parameters at construction time\n        if not region or not region.strip():\n            raise RemotionInvalidArgumentException(\"'region' parameter is required and cannot be empty or whitespace\")\n        if not serve_url or not serve_url.strip():\n            raise RemotionInvalidArgumentException(\"'serve_url' parameter is required and cannot be empty or whitespace\")\n        if not function_name or not function_name.strip():\n            raise RemotionInvalidArgumentException(\"'function_name' parameter is required and cannot be empty or whitespace\")\n\n\n        # Check for conflicting authentication methods\n        if session and (access_key or secret_key):\n            raise RemotionInvalidArgumentException(\n                \"Cannot specify both 'session' and explicit credentials \"\n                \"('access_key'/'secret_key'). Please use only 'session'.\"\n            )\n\n        # Handle deprecated credential parameters\n        if access_key is not None or secret_key is not None:\n            warnings.warn(\n                \"Parameters 'access_key' and 'secret_key' are deprecated \"\n                \"as of version 4.0.376 and will be removed in version 5.0.0. \"\n                \"Please migrate to using 'session' for improved security. \",\n                DeprecationWarning,\n                stacklevel=2,\n            )","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-python/remotion_lambda/remotionclient.py#L153-L189","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Deploy the Lambda function with `remotion lambda functions deploy` and copy the exact function name printed.","Pass the bare function name (e.g. 'remotion-render-...-us-east-1') as function_name.","Verify the function exists with `aws lambda get-function --function-name <name>` before constructing the client."],"exampleFix":"// before\nclient = RemotionClient(\n    region=region,\n    serve_url=serve_url,\n    function_name=None,\n)\n\n# after\nclient = RemotionClient(\n    region=region,\n    serve_url=serve_url,\n    function_name='remotion-render-remotionlambda-...-us-east-1',\n)","handlingStrategy":"validation","validationCode":"def validate_function_name(name: str) -> str:\n    if not name or not name.strip():\n        raise ValueError('function_name required')\n    n = name.strip()\n    if len(n) < 1 or len(n) > 140:\n        raise ValueError(f'invalid function_name length: {n!r}')\n    return n","typeGuard":"def is_valid_function_name(value) -> bool:\\n    return isinstance(value, str) and 1 <= len(value.strip()) <= 140","tryCatchPattern":"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}')","preventionTips":["Deploy the function first and copy the exact name from CLI output.","Verify with `aws lambda get-function --function-name <name>` before constructing the client.","Keep the function name in config and fail fast when missing."],"tags":["python","validation","constructor","lambda","function-name"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}