{"record":{"id":"8024958b7aa6062c","repo":"remotion-dev/remotion","slug":"pass-out-name-when-using-s3-output-provider-flag","errorCode":null,"errorMessage":"Pass --out-name when using S3 output provider flags.","messagePattern":"Pass --out-name when using S3 output provider flags\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/cli/helpers/get-s3-output-provider-from-cli.ts","lineNumber":69,"sourceCode":"\tkey,\n\ts3OutputProvider,\n}: {\n\tbucketName: string | undefined;\n\tkey: string | undefined;\n\ts3OutputProvider: CustomCredentials<AwsProvider> | null;\n}): OutNameInput<AwsProvider> | null => {\n\tif (!s3OutputProvider) {\n\t\treturn key ?? null;\n\t}\n\n\tif (!bucketName) {\n\t\tthrow new Error(\n\t\t\t'Pass --force-bucket-name when using S3 output provider flags.',\n\t\t);\n\t}\n\n\tif (!key) {\n\t\tthrow new Error('Pass --out-name when using S3 output provider flags.');\n\t}\n\n\treturn {\n\t\tbucketName,\n\t\tkey,\n\t\ts3OutputProvider,\n\t};\n};\n","sourceCodeStart":51,"sourceCodeEnd":78,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/cli/helpers/get-s3-output-provider-from-cli.ts#L51-L78","documentation":"The makeOutNameWithCustomCredentials() helper validates that when an S3 output provider is configured via CLI flags, an output key (--out-name) must also be supplied. When writing to a custom S3-compatible destination, Remotion needs the explicit object key to use for the rendered output file, since it cannot derive it from the default naming scheme.","triggerScenarios":"Running a Lambda CLI command with S3 output provider flags and a forced bucket name but without --out-name. The function has already confirmed s3OutputProvider and bucketName are non-null, and now requires key to be set.","commonSituations":"User provides the endpoint and bucket for a custom S3 output but omits the output file name/key; user expects Remotion to generate a default key on the custom endpoint.","solutions":["Add the --out-name=<key> flag (e.g. --out-name=renders/output.mp4) when using S3 output provider flags.","Ensure the key includes the desired path and filename within the bucket.","Remove all S3 output provider flags if you want Remotion to use its default output naming."],"exampleFix":"# before\nnpx remotion lambda render MyComp \\\n  --s3-output-provider-endpoint=https://s3.example.com \\\n  --force-bucket-name=my-render-bucket\n\n# after\nnpx remotion lambda render MyComp \\\n  --s3-output-provider-endpoint=https://s3.example.com \\\n  --force-bucket-name=my-render-bucket \\\n  --out-name=renders/output.mp4","handlingStrategy":"validation","validationCode":"function validateS3OutputProviderOutName(opts: {\n  s3OutputProvider: unknown;\n  key?: string;\n}): void {\n  if (opts.s3OutputProvider && !opts.key) {\n    throw new Error('--out-name is required when using S3 output provider flags.');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --out-name when configuring a custom S3 output provider.","Include a meaningful path in the key (e.g. renders/output.mp4).","Remove S3 output provider flags entirely if default output naming is acceptable."],"tags":["lambda","cli","s3","output-provider","configuration","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}