{"record":{"id":"eeec12a00fa0b395","repo":"remotion-dev/remotion","slug":"conditional-output-uploads-are-only-supported-for","errorCode":null,"errorMessage":"Conditional output uploads are only supported for AWS S3","messagePattern":"Conditional output uploads are only supported for AWS S3","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/write-file.ts","lineNumber":165,"sourceCode":"\t\tconsole.warn(err);\n\t\tconsole.warn(`Retrying (${remainingRetries} retries remaining)...`);\n\n\t\treturn writeFileWithRetries({\n\t\t\t...params,\n\t\t\tretries: remainingRetries - 1,\n\t\t});\n\t}\n};\n\nexport const lambdaWriteFileImplementation = (\n\tparams: WriteFileInput<AwsProvider> & {retries?: number},\n): Promise<void> => writeFileWithRetries({...params, ifNotExists: false});\n\nexport const lambdaWriteFileIfNotExistsImplementation = (\n\tparams: WriteFileInput<AwsProvider>,\n): Promise<void> => {\n\tif (params.customCredentials !== null) {\n\t\tthrow new Error('Conditional output uploads are only supported for AWS S3');\n\t}\n\n\treturn writeFileWithRetries({...params, ifNotExists: true});\n};\n","sourceCodeStart":147,"sourceCodeEnd":170,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/lambda-client/src/write-file.ts#L147-L170","documentation":"lambdaWriteFileIfNotExistsImplementation implements conditional uploads (upload only if the object does not already exist) using S3 conditional writes. Conditional writes are an AWS S3 capability; when custom credentials (a non-AWS provider such as S3-compatible storage via customCredentials) are supplied, the necessary S3 semantics cannot be assumed, so the library throws. Use the regular write path in that case.","triggerScenarios":"Calling renderMediaOnLambda() with outputIsIfNotExists/conditional upload enabled while also passing customCredentials (e.g. Cloudflare R2, MinIO, DigitalOcean Spaces), so the ifNotExists implementation sees params.customCredentials !== null.","commonSituations":"Using S3-compatible object storage (R2/MinIO/Spaces) with custom credentials and expecting conditional-upload protection that only AWS S3 provides; enabling the overwrite-protection option on a non-AWS provider.","solutions":["Remove customCredentials and use native AWS S3 credentials if conditional uploads are required","Disable the conditional/ifNotExists upload option so the plain write path is used","Delete existing outputs yourself before rendering instead of relying on conditional uploads","Use a unique output key per render to avoid collisions without conditional writes"],"exampleFix":"// before\nawait renderMediaOnLambda({\n  ...params,\n  customCredentials: {endpoint: 'https://<account>.r2.cloudflarestorage.com'},\n  outputIsIfNotExists: true,\n});\n// after\nawait renderMediaOnLambda({\n  ...params,\n  customCredentials: {endpoint: 'https://<account>.r2.cloudflarestorage.com'},\n  outputIsIfNotExists: false,\n});","handlingStrategy":"validation","validationCode":"if (params.customCredentials && params.outputIsIfNotExists) {\n  throw new Error('Conditional output uploads require native AWS S3; disable outputIsIfNotExists or drop customCredentials.');\n}","typeGuard":"const supportsConditionalUploads = (p: {customCredentials: unknown}): boolean => p.customCredentials === null;","tryCatchPattern":"try {\n  await renderMediaOnLambda(params);\n} catch (err) {\n  if (String(err).includes('Conditional output uploads')) {\n    await renderMediaOnLambda({...params, outputIsIfNotExists: false});\n  } else {\n    throw err;\n  }\n}","preventionTips":["Only enable ifNotExists/conditional output with native AWS S3 credentials","Handle duplicate-key prevention in application logic when using S3-compatible providers","Use unique output keys per render instead of relying on server-side conditional writes","Document provider capability limits in your render service config"],"tags":["s3","lambda","unsupported-operation","custom-credentials"],"backgroundTag":"unsupported-operation","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}