{"record":{"id":"f47a11898e1f6be4","repo":"remotion-dev/remotion","slug":"you-have-tried-to-call-a-remotion-lambda-function","errorCode":null,"errorMessage":"You have tried to call a Remotion Lambda function, but have not set the environment variable AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID.","messagePattern":"You have tried to call a Remotion Lambda function, but have not set the environment variable AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/check-credentials.ts","lineNumber":36,"sourceCode":"\nexport const checkCredentials = () => {\n\tif (getEnvVariable('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {\n\t\treturn;\n\t}\n\n\tif (getEnvVariable('REMOTION_AWS_PROFILE') || getEnvVariable('AWS_PROFILE')) {\n\t\treturn;\n\t}\n\n\tif (isLikelyToHaveAwsProfile()) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t!getEnvVariable('AWS_ACCESS_KEY_ID') &&\n\t\t!getEnvVariable('REMOTION_AWS_ACCESS_KEY_ID')\n\t) {\n\t\tthrow new Error(\n\t\t\tmessageForVariable('AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID'),\n\t\t);\n\t}\n\n\tif (\n\t\t!getEnvVariable('AWS_SECRET_ACCESS_KEY') &&\n\t\t!getEnvVariable('REMOTION_AWS_SECRET_ACCESS_KEY')\n\t) {\n\t\tthrow new Error(\n\t\t\tmessageForVariable(\n\t\t\t\t'AWS_SECRET_ACCESS_KEY or REMOTION_AWS_SECRET_ACCESS_KEY',\n\t\t\t),\n\t\t);\n\t}\n};\n","sourceCodeStart":18,"sourceCodeEnd":52,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/check-credentials.ts#L18-L52","documentation":"checkCredentials throws before any AWS call if neither AWS_ACCESS_KEY_ID nor REMOTION_AWS_ACCESS_KEY_ID is set, and no AWS profile is detected. The check is skipped when REMOTION_SKIP_AWS_CREDENTIALS_CHECK is set, when AWS_PROFILE/REMOTION_AWS_PROFILE is set, or when a local AWS profile file is found. Note: the CLI auto-loads .env, but the Node.js API does not.","triggerScenarios":"Invoking any lambda-client function in a fresh shell/CI where the access-key-id env var is unset and no profile resolves.","commonSituations":"CI without injected secrets, calling the Node.js API without loading dotenv, .env missing the key, deploying to a host that strips env vars.","solutions":["Export AWS_ACCESS_KEY_ID (or REMOTION_AWS_ACCESS_KEY_ID) in the environment","If using the Node.js API, load your .env yourself (e.g. import 'dotenv/config')","Configure ~/.aws/credentials and rely on the profile, or set AWS_PROFILE","Only set REMOTION_SKIP_AWS_CREDENTIALS_CHECK if you intentionally use the SDK default credential chain (IMDS, SSR, etc.)"],"exampleFix":"// before - Node.js API, .env not auto-loaded\nimport {renderMediaOnLambda} from '@remotion/lambda-client';\nawait renderMediaOnLambda({...});\n\n// after\nimport 'dotenv/config';\nimport {renderMediaOnLambda} from '@remotion/lambda-client';\nawait renderMediaOnLambda({...});","handlingStrategy":"validation","validationCode":"function assertAwsAccessKeyId() {\n  const id = process.env.AWS_ACCESS_KEY_ID ?? process.env.REMOTION_AWS_ACCESS_KEY_ID;\n  if (!id && !process.env.AWS_PROFILE && !process.env.REMOTION_AWS_PROFILE) {\n    throw new Error('Set AWS_ACCESS_KEY_ID before calling Remotion Lambda');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run checkCredentials (or your own env assertion) at app boot, before any render","Load .env explicitly in the Node.js API (import 'dotenv/config')","Inject credentials via CI secrets rather than relying on local files"],"tags":["aws","credentials","environment","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}