{"record":{"id":"beaf87ed872f5afe","repo":"remotion-dev/remotion","slug":"remotion-app-region-is-not-set-beaf87","errorCode":null,"errorMessage":"REMOTION_APP_REGION is not set","messagePattern":"REMOTION_APP_REGION is not set","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/lambda-python/testclient_render_still.py","lineNumber":13,"sourceCode":"import os\n\nfrom remotion_lambda import RenderStillParams, Privacy, ValidStillImageFormats\nfrom remotion_lambda import RemotionClient\nfrom dotenv import load_dotenv\n\n\nload_dotenv()\n\n# Load env variables\nREMOTION_APP_REGION = os.getenv('REMOTION_APP_REGION')\nif not REMOTION_APP_REGION:\n    raise Exception(\"REMOTION_APP_REGION is not set\")\n\nREMOTION_APP_FUNCTION_NAME = os.getenv('REMOTION_APP_FUNCTION_NAME')\nif not REMOTION_APP_FUNCTION_NAME:\n    raise Exception(\"REMOTION_APP_FUNCTION_NAME is not set\")\n\nREMOTION_APP_SERVE_URL = os.getenv('REMOTION_APP_SERVE_URL')\nif not REMOTION_APP_SERVE_URL:\n    raise Exception(\"REMOTION_APP_SERVE_URL is not set\")\n\n# Construct client\nclient = RemotionClient(region=REMOTION_APP_REGION,\n                        serve_url=REMOTION_APP_SERVE_URL,\n                        function_name=REMOTION_APP_FUNCTION_NAME)\n\n# Set render still request\nrender_params = RenderStillParams(\n    composition=\"still-helloworld\",\n    privacy=Privacy.PUBLIC,","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-python/testclient_render_still.py#L1-L31","documentation":"Raised by testclient_render_still.py when REMOTION_APP_REGION is unset after dotenv loading. Same guard as the render-media example: the still-render client cannot construct boto3 clients without an AWS region.","triggerScenarios":"Running `python testclient_render_still.py` without REMOTION_APP_REGION in .env, or running from a directory where load_dotenv() does not find the file.","commonSituations":"Missing/blank .env in packages/lambda-python; renamed env var; CI with stripped environment.","solutions":["Set REMOTION_APP_REGION in packages/lambda-python/.env (e.g. 'us-east-1').","Run the still example from packages/lambda-python so .env resolves.","Export inline: `REMOTION_APP_REGION=us-east-1 python testclient_render_still.py`.","Copy .env.example to .env and fill all three REMOTION_APP_* values."],"exampleFix":"// before\nREMOTION_APP_REGION=\n// after\nREMOTION_APP_REGION=us-east-1","handlingStrategy":"validation","validationCode":"import os\nfrom dotenv import load_dotenv\nload_dotenv()\nif not os.getenv('REMOTION_APP_REGION'):\n    raise SystemExit('REMOTION_APP_REGION is not set')","typeGuard":"def has_region(v): return isinstance(v, str) and v.strip() != ''","tryCatchPattern":"try:\n    assert os.getenv('REMOTION_APP_REGION')\nexcept AssertionError:\n    print('REMOTION_APP_REGION is not set'); sys.exit(1)","preventionTips":["Keep a single .env with all REMOTION_APP_* values for both example scripts.","Run example scripts from packages/lambda-python.","Validate env up front to fail fast.","Re-use the same region across function and site."],"tags":["python","lambda","configuration","environment","example","still"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}