remotion-dev/remotion · error · Error
You have tried to call a Remotion Lambda function, but have
Error message
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.
What it means
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.
Source
Thrown at packages/lambda-client/src/check-credentials.ts:36
export const checkCredentials = () => {
if (getEnvVariable('REMOTION_SKIP_AWS_CREDENTIALS_CHECK')) {
return;
}
if (getEnvVariable('REMOTION_AWS_PROFILE') || getEnvVariable('AWS_PROFILE')) {
return;
}
if (isLikelyToHaveAwsProfile()) {
return;
}
if (
!getEnvVariable('AWS_ACCESS_KEY_ID') &&
!getEnvVariable('REMOTION_AWS_ACCESS_KEY_ID')
) {
throw new Error(
messageForVariable('AWS_ACCESS_KEY_ID or REMOTION_AWS_ACCESS_KEY_ID'),
);
}
if (
!getEnvVariable('AWS_SECRET_ACCESS_KEY') &&
!getEnvVariable('REMOTION_AWS_SECRET_ACCESS_KEY')
) {
throw new Error(
messageForVariable(
'AWS_SECRET_ACCESS_KEY or REMOTION_AWS_SECRET_ACCESS_KEY',
),
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
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.)
Example fix
// before - Node.js API, .env not auto-loaded
import {renderMediaOnLambda} from '@remotion/lambda-client';
await renderMediaOnLambda({...});
// after
import 'dotenv/config';
import {renderMediaOnLambda} from '@remotion/lambda-client';
await renderMediaOnLambda({...}); Defensive patterns
Strategy: validation
Validate before calling
function assertAwsAccessKeyId() {
const id = process.env.AWS_ACCESS_KEY_ID ?? process.env.REMOTION_AWS_ACCESS_KEY_ID;
if (!id && !process.env.AWS_PROFILE && !process.env.REMOTION_AWS_PROFILE) {
throw new Error('Set AWS_ACCESS_KEY_ID before calling Remotion Lambda');
}
} Prevention
- 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
When it happens
Trigger: Invoking any lambda-client function in a fresh shell/CI where the access-key-id env var is unset and no profile resolves.
Common situations: CI without injected secrets, calling the Node.js API without loading dotenv, .env missing the key, deploying to a host that strips env vars.
Related errors
- You have tried to call a Remotion Lambda function, but have
- UnrecognizedClientException: The AWS credentials provided we
- could not load AWS config: %w
- Lambda Insights is not supported by AWS in region ${region}.
- No valid AWS Caller Identity detected
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/f47a11898e1f6be4.
Report an issue: GitHub.