{"record":{"id":"24f0d13e28286df5","repo":"remotion-dev/remotion","slug":"timeout-must-be-a-positive-integer-received-ti","errorCode":null,"errorMessage":"Timeout must be a positive integer. Received: ${timeoutInSeconds}","messagePattern":"Timeout must be a positive integer\\. Received: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/speculate-function-name.ts","lineNumber":50,"sourceCode":"}: SpeculateFunctionNameInput) => {\n\tconst memorySize = Number(memorySizeInMb);\n\tconst diskSize = Number(diskSizeInMb);\n\tconst timeout = Number(timeoutInSeconds);\n\n\tif (!Number.isInteger(memorySize) || memorySize <= 0) {\n\t\tthrow new Error(\n\t\t\t`Memory size must be a positive integer. Received: ${memorySizeInMb}`,\n\t\t);\n\t}\n\n\tif (!Number.isInteger(diskSize) || diskSize <= 0) {\n\t\tthrow new Error(\n\t\t\t`Disk size must be a positive integer. Received: ${diskSizeInMb}`,\n\t\t);\n\t}\n\n\tif (!Number.isInteger(timeout) || timeout <= 0) {\n\t\tthrow new Error(\n\t\t\t`Timeout must be a positive integer. Received: ${timeoutInSeconds}`,\n\t\t);\n\t}\n\n\treturn innerSpeculateFunctionName({\n\t\tdiskSizeInMb,\n\t\tmemorySizeInMb,\n\t\ttimeoutInSeconds,\n\t});\n};\n","sourceCodeStart":32,"sourceCodeEnd":61,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/speculate-function-name.ts#L32-L61","documentation":"speculateFunctionName validates timeoutInSeconds as a positive integer after Number() coercion. A non-integer, zero, negative, or non-numeric value triggers this error.","triggerScenarios":"Calling speculateFunctionName with timeoutInSeconds that Number() cannot turn into a positive integer (e.g., 0, -10, 120.5, 'two-minutes', undefined).","commonSituations":"Passing timeout as a string like '120s' instead of the integer 120; using a fractional second value; defaulting to 0; confusing seconds with milliseconds.","solutions":["Pass a positive integer number of seconds (Lambda max is 900; Remotion typically uses 120-900).","Strip unit suffixes before calling, and coerce with Number().","Validate with Number.isInteger() and > 0 before speculateFunctionName."],"exampleFix":"// before\nspeculateFunctionName({ memorySizeInMb: 2048, diskSizeInMb: 2048, timeoutInSeconds: '120s' });\n\n// after\nspeculateFunctionName({ memorySizeInMb: 2048, diskSizeInMb: 2048, timeoutInSeconds: 120 });","handlingStrategy":"validation","validationCode":"const timeout = Number(timeoutInSeconds);\nif (!Number.isInteger(timeout) || timeout <= 0) {\n  throw new Error(`timeoutInSeconds must be a positive integer, got ${timeoutInSeconds}`);\n}\nspeculateFunctionName({ memorySizeInMb, diskSizeInMb, timeoutInSeconds: timeout });","typeGuard":"const isPositiveInteger = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isInteger(v) && v > 0;","tryCatchPattern":null,"preventionTips":["Pass timeout as a number of seconds, not a unit string.","Coerce and validate string inputs before calling.","Validate that seconds vs. milliseconds are not confused."],"tags":["input-validation","lambda","timeout","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}