{"record":{"id":"9eefec8a5cf21fca","repo":"remotion-dev/remotion","slug":"maxretries-should-be-an-integer-but-is-maxretri","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/cloudrun/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/cloudrun/src/shared/validate-retries.ts#L5-L28","documentation":"Thrown by validateMaxRetries() when maxRetries is a finite, non-negative number but not an integer (maxRetries % 1 !== 0). The Cloud Run retry logic requires a whole number of attempts, so fractional values like 1.5 are rejected.","triggerScenarios":"Passing a float such as 1.5 or 2.7 as maxRetries; dividing two integers that does not yield a whole number; reading a decimal from config.","commonSituations":"Computing retries as a ratio or percentage (e.g. attempts = total * 0.1); using a float where an integer count was intended.","solutions":["Round explicitly with Math.round(), Math.floor(), or Math.trunc() before passing.","Re-express the computation so it yields a whole number (e.g. use a count, not a ratio).","Validate with Number.isInteger() upstream."],"exampleFix":"// before\nconst maxRetries = total * 0.1; // e.g. 1.5\n\n// after\nconst maxRetries = Math.max(0, Math.round(total * 0.1));","handlingStrategy":"validation","validationCode":"if (typeof maxRetries === 'number' && maxRetries % 1 !== 0) {\n  throw new RangeError(`maxRetries must be an integer: ${maxRetries}`);\n}","typeGuard":"const isRetryCount = (v: unknown): v is number =>\n  typeof v === 'number' &&\n  Number.isFinite(v) &&\n  Number.isInteger(v) &&\n  v >= 0;","tryCatchPattern":null,"preventionTips":["Round computed counts with Math.round()/Math.floor() before passing.","Express retries as a count, not a ratio or percentage.","Validate with Number.isInteger() in your own option parser."],"tags":["cloudrun","validation","numeric"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}