Hmbown/CodeWhale · error · Error
--retry-delay-ms must be between 0 and 30000
Error message
--retry-delay-ms must be between 0 and 30000
What it means
--retry-delay-ms sets the wait between polling attempts and must be a finite number between 0 and 30000 ms. Non-finite values (NaN, Infinity), negatives, and values above 30 seconds throw this error to keep total wait time bounded.
Solutions
- Pass a value between 0 and 30000, e.g. --retry-delay-ms 5000
- Convert seconds to milliseconds (5s = 5000ms) and stay under the 30s cap
- Check any env/scripted source of the value for empty or malformed input
Example fix
// before --retry-delay-ms 60 // after (60 seconds is not allowed; use at most 30000 ms per delay) --retry-delay-ms 30000
Defensive patterns
Strategy: validation
Validate before calling
if (!Number.isFinite(delayMs) || delayMs < 0 || delayMs > 30000) throw new Error('retry-delay-ms must be 0..30000'); Type guard
const isValidDelayMs = (v) => Number.isFinite(v) && v >= 0 && v <= 30000;
Try / catch
try { run(args); } catch (e) { if (e.message.includes('--retry-delay-ms')) { console.error('Use 0-30000 milliseconds'); process.exitCode = 2; } else throw e; } Prevention
- Convert seconds to milliseconds explicitly
- Clamp env-provided delays with Math.min(Math.max(v, 0), 30000)
- Guard against empty env strings becoming NaN
When it happens
Trigger: Running with --retry-delay-ms 60000, --retry-delay-ms -1, or a value that parses to NaN/Infinity.
Common situations: Wanting longer waits between deploy rollouts, typos in unit (seconds vs ms), or environment-driven values that are empty strings converting to NaN.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- --attempts must be an integer from 1 to 20
- --channel, --version and --reason are required
- Choose one Runtime --thread ID.
- Command is required
- Invalid pet recording segment limit.
AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15).
Data as JSON: /api/errors/580411e963cb2a0e.
Report an issue: GitHub.
Appendix: source
Thrown at web/scripts/compare-deployed-facts.mjs:119
let baseUrl;
try {
baseUrl = new URL(args.baseUrl);
} catch {
throw new Error(`invalid --base-url: ${args.baseUrl}`);
}
if (!/^https?:$/.test(baseUrl.protocol)) {
throw new Error("--base-url must use http or https");
}
const expectedRevision = args.expectedRevision || localRevision();
if (!expectedRevision || !/^[0-9a-f]{40}$/i.test(expectedRevision)) {
throw new Error("expected revision must be an exact 40-character Git SHA");
}
if (!Number.isInteger(args.attempts) || args.attempts < 1 || args.attempts > 20) {
throw new Error("--attempts must be an integer from 1 to 20");
}
if (!Number.isFinite(args.retryDelayMs) || args.retryDelayMs < 0 || args.retryDelayMs > 30_000) {
throw new Error("--retry-delay-ms must be between 0 and 30000");
}
const facts = buildFacts();
const expected = {
sourceRevision: expectedRevision,
version: facts.version,
providerCount: facts.providers.length,
toolCount: facts.toolCount,
latestPublishedRelease: facts.latestPublishedRelease,
};
const endpoint = new URL("/api/facts", baseUrl).toString();
let last = { error: "not attempted" };
let differences = [];
for (let attempt = 1; attempt <= args.attempts; attempt += 1) {
last = await fetchReceipt(endpoint);
differences = last.receipt ? compare(expected, last.receipt) : [];
if (last.receipt && differences.length === 0) break;View on GitHub (pinned to 433685b202)