{"record":{"id":"30498266093e7387","repo":"remotion-dev/remotion","slug":"remotion-app-serve-url-is-not-set","errorCode":null,"errorMessage":"REMOTION_APP_SERVE_URL is not set","messagePattern":"REMOTION_APP_SERVE_URL is not set","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/lambda-python/testclient_render_media.py","lineNumber":22,"sourceCode":"import os\nfrom dotenv import load_dotenv\nimport boto3\nfrom botocore.config import Config\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\n# --- NEW: Create a custom botocore Config for timeouts ---\n# This configuration will apply to both S3 and Lambda clients created by RemotionClient\n# if passed via the botocore_config parameter.\ncustom_botocore_config = Config(\n    connect_timeout=30,  # Max 30 seconds to establish a connection\n    read_timeout=60,     # Max 60 seconds to receive data after connection\n    retries={'max_attempts': 3, 'mode': 'adaptive'}, # Retry up to 3 times on certain errors\n    # You can add more settings here, e.g., proxies\n    # proxies={\n    #     'http': 'http://proxy.example.com:8080',\n    #     'https': 'https://proxy.example.com:8080'\n# }\n)\nprint(f\"Created custom botocore config: {custom_botocore_config.retries}\")\n\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-python/testclient_render_media.py#L4-L40","documentation":"Raised by testclient_render_media.py when REMOTION_APP_SERVE_URL is unset. The serve URL is the location of your bundled Remotion site (a deployed Lambda site URL or a serve-url from `remotion lambda sites deploy`) and the client attaches it to every render request so the renderer knows what to load.","triggerScenarios":"Running the example without having deployed a site, or with REMOTION_APP_SERVE_URL blank. Also fires if the var was set to a different name like REMOTION_SERVE_URL.","commonSituations":"Fresh project where `npx remotion lambda sites deploy` was never run; using a localhost serve URL on a remote Lambda (the function cannot reach your machine); URL typos.","solutions":["Deploy a site: `npx remotion lambda sites deploy src/index.ts` and capture the returned URL.","Add `REMOTION_APP_SERVE_URL=<https URL>` to packages/lambda-python/.env.","Use a publicly reachable URL, not localhost, when invoking Lambda.","Confirm with `npx remotion lambda sites ls`."],"exampleFix":"// before\nREMOTION_APP_SERVE_URL=\n// after\nREMOTION_APP_SERVE_URL=https://remotionlambda-123.s3.us-east-1.amazonaws.com/sites/abc/index.html","handlingStrategy":"validation","validationCode":"import os\nurl = os.getenv('REMOTION_APP_SERVE_URL')\nif not url or not url.startswith('http'):\n    raise SystemExit('REMOTION_APP_SERVE_URL is not set or not a URL. Run: npx remotion lambda sites deploy')","typeGuard":"def is_http_url(v): return isinstance(v, str) and v.startswith(('http://', 'https://'))","tryCatchPattern":"try:\n    assert os.getenv('REMOTION_APP_SERVE_URL', '').startswith('http')\nexcept AssertionError:\n    sys.exit(3)","preventionTips":["Deploy a site with `npx remotion lambda sites deploy` and use its URL.","Use a publicly reachable URL, never localhost, when invoking Lambda.","Confirm the site is reachable from the Lambda's network.","Re-deploy the site whenever you change compositions to keep the bundle fresh."],"tags":["python","lambda","configuration","environment","example"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}