{"record":{"id":"69d6a48f70204149","repo":"remotion-dev/remotion","slug":"the-expiresin-parameter-must-be-less-or-equal-th","errorCode":null,"errorMessage":"The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS","messagePattern":"The 'expiresIn' parameter must be less or equal than (.+?) \\(7 days\\) as enforced by AWS","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/validate-presign-expiration.ts","lineNumber":36,"sourceCode":"\t\tthrow new TypeError(`'expiresIn' should not be NaN, but is NaN`);\n\t}\n\n\tif (!Number.isFinite(presignExpiration)) {\n\t\tthrow new TypeError(\n\t\t\t`'expiresIn' should be finite but is ${presignExpiration}`,\n\t\t);\n\t}\n\n\tif (presignExpiration % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`'expiresIn' should be an integer but is ${JSON.stringify(\n\t\t\t\tpresignExpiration,\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tif (presignExpiration > MAX_PRESIGN_EXPIRATION) {\n\t\tthrow new TypeError(\n\t\t\t`The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS`,\n\t\t);\n\t}\n\n\tif (presignExpiration < MIN_PRESIGN_EXPIRATION) {\n\t\tthrow new TypeError(\n\t\t\t`The 'expiresIn' parameter must be greater or equal than ${MIN_PRESIGN_EXPIRATION}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":18,"sourceCodeEnd":47,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/validate-presign-expiration.ts#L18-L47","documentation":"Thrown by validatePresignExpiration() when expiresIn is an integer greater than 604800 (7 days). AWS S3 / Lambda presigned URLs cannot be valid for more than 7 days; this is a hard AWS-enforced ceiling, not a Remotion choice.","triggerScenarios":"Passing expiresIn: 604801, expiresIn computed as 8 days in seconds (691200), or a long-lived token value copied from another system.","commonSituations":"Wanting a 'permanent' download link; confusing seconds with minutes/hours (passing 6048000 = ~70 days); copying a TTL from a non-AWS presign implementation.","solutions":["Lower expiresIn to 604800 or less (e.g. 86400 for 24 hours).","Double-check the unit: the value is in SECONDS, not minutes.","If a longer-lived URL is truly needed, re-issue the presigned URL from your own backend before expiry instead of exceeding 7 days."],"exampleFix":"// before\nawait renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600 * 2}}); // 14 days\n\n// after\nawait renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600}}); // 7 days max","handlingStrategy":"validation","validationCode":"const SEVEN_DAYS = 604800;\nconst expiresIn = Math.min(Math.round(Number(input)), SEVEN_DAYS);","typeGuard":"const isWithinAwsLimit = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v % 1 === 0 && v >= 1 && v <= 604800;","tryCatchPattern":null,"preventionTips":["Remember the value is in SECONDS and the ceiling is 7 days (604800).","Re-issue presigned URLs from your backend instead of trying to exceed 7 days.","Document the AWS ceiling next to every place expiresIn is set."],"tags":["lambda","validation","aws","presign"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}