{"record":{"id":"02c7e81dba5523b1","repo":"remotion-dev/remotion","slug":"parameter-timeoutinseconds-must-be-finite-but-i","errorCode":null,"errorMessage":"parameter 'timeoutInSeconds' must be finite, but is ${timeoutInSeconds}","messagePattern":"parameter 'timeoutInSeconds' must be finite, but is (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-timeout.ts","lineNumber":15,"sourceCode":"import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';\n\nexport const validateTimeout = (timeoutInSeconds: unknown) => {\n\tif (typeof timeoutInSeconds !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be a number, but got a ${typeof timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (Number.isNaN(timeoutInSeconds)) {\n\t\tthrow new TypeError(`parameter 'timeoutInSeconds' must not be NaN, but is`);\n\t}\n\n\tif (!Number.isFinite(timeoutInSeconds)) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be finite, but is ${timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (timeoutInSeconds < MIN_TIMEOUT || timeoutInSeconds > MAX_TIMEOUT) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be between ${MIN_TIMEOUT} and ${MAX_TIMEOUT}, but got ${timeoutInSeconds}`,\n\t\t);\n\t}\n\n\tif (timeoutInSeconds % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`parameter 'timeoutInSeconds' must be an integer but got ${timeoutInSeconds}`,\n\t\t);\n\t}\n};\n","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-timeout.ts#L1-L32","documentation":"Thrown by validateTimeout() in @remotion/lambda when timeoutInSeconds is a non-finite number other than NaN (i.e. Infinity or -Infinity). Lambda timeouts must be a concrete number of seconds in [15, 900]; Infinity is not a valid AWS Lambda timeout.","triggerScenarios":"Passing timeoutInSeconds: Infinity or -Infinity, or a computation that overflows (e.g. dividing a large number by ~0).","commonSituations":"Using Infinity as a 'no limit' marker; computing timeout as duration / concurrency where concurrency approaches 0; copying a value from a UI 'unlimited' field represented as Infinity.","solutions":["Replace Infinity with the maximum allowed value MAX_TIMEOUT (900 seconds), or a realistic number like 300.","Clamp: const timeoutInSeconds = Math.min(Math.max(parsed, MIN_TIMEOUT), MAX_TIMEOUT);","Reject 'unlimited' at the config layer and require a concrete number."],"exampleFix":"// before\nconst timeoutInSeconds = duration / 0; // Infinity\n\n// after\nimport {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';\nconst timeoutInSeconds = Math.min(Math.max(Math.round(duration), MIN_TIMEOUT), MAX_TIMEOUT);","handlingStrategy":"validation","validationCode":"import {MAX_TIMEOUT, MIN_TIMEOUT} from '@remotion/lambda-client/constants';\nconst t = Math.min(Math.max(Math.round(raw), MIN_TIMEOUT), MAX_TIMEOUT);","typeGuard":"const isFiniteSeconds = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":null,"preventionTips":["Never use Infinity as a sentinel for timeouts; use MAX_TIMEOUT (900).","Clamp computed timeouts to [MIN_TIMEOUT, MAX_TIMEOUT].","Audit divisions that could approach a zero denominator."],"tags":["lambda","validation","timeout","configuration","deploy"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}