{"record":{"id":"d42661569b0e6896","repo":"remotion-dev/remotion","slug":"maxretries-should-be-an-integer-but-is-maxretri-d42661","errorCode":null,"errorMessage":"maxRetries should be an integer, but is ${maxRetries}.","messagePattern":"maxRetries should be an integer, but is (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/lambda/src/shared/validate-retries.ts","lineNumber":23,"sourceCode":"\t\tthrow new TypeError(\n\t\t\t'maxRetries must be a number, but is ' + JSON.stringify(maxRetries),\n\t\t);\n\t}\n\n\tif (!Number.isFinite(maxRetries)) {\n\t\tthrow new TypeError('maxRetries must be finite, but is ' + maxRetries);\n\t}\n\n\tif (Number.isNaN(maxRetries)) {\n\t\tthrow new TypeError('maxRetries is NaN');\n\t}\n\n\tif (maxRetries < 0) {\n\t\tthrow new TypeError(`maxRetries cannot be negative but is ${maxRetries}`);\n\t}\n\n\tif (maxRetries % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`maxRetries should be an integer, but is ${maxRetries}.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":5,"sourceCodeEnd":28,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda/src/shared/validate-retries.ts#L5-L28","documentation":"Thrown by validateMaxRetries() in @remotion/lambda when maxRetries is a finite number but not an integer (the % 1 !== 0 check). Lambda cannot perform a fractional retry, so the validator requires an integer.","triggerScenarios":"Passing a float like 1.5 or 2.1 to renderMediaOnLambda()/renderStillOnLambda() maxRetries, or `--max-retries=1.5` on the CLI. Often comes from dividing retries across parallel functions (e.g. totalRetries / parallelism).","commonSituations":"Computing retries from a ratio (retries = baseConcurrency * 0.5), reading a decimal from a JSON config, or accidentally using a percentage as a count.","solutions":["Round to the nearest integer: Math.round(maxRetries) (or Math.floor / Math.ceil to bias down/up).","Fix the upstream calculation so it yields an integer count, not a ratio.","If the decimal is from a config file, change the config value to an integer."],"exampleFix":"// before\nconst maxRetries = totalRetries / parallelism; // e.g. 3 / 2 = 1.5\n\n// after\nconst maxRetries = Math.round(totalRetries / parallelism);","handlingStrategy":"validation","validationCode":"const maxRetries = Math.round(Number(raw));\nif (!Number.isInteger(maxRetries) || maxRetries < 0) throw new Error('invalid maxRetries');","typeGuard":"const isInteger = (v: unknown): v is number => typeof v === 'number' && Number.isInteger(v);","tryCatchPattern":null,"preventionTips":["Round divisions/ratios before using them as a retry count.","Keep retry counts as integer literals in config files.","Add a TypeScript type annotation (: number) and an integer assertion at the boundary."],"tags":["lambda","validation","max-retries","cli","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}