paperclipai/paperclip · error · Error

Invalid range ${a}-${b} in cron ${spec.name} field (start >

Error message

Invalid range ${a}-${b} in cron ${spec.name} field (start > end)

What it means

Ordering guard in parseField's N-M branch: both endpoints are valid in-bounds integers but the start exceeds the end (e.g. "5-1"), which is not a legal cron range. Values are reported numerically after parsing.

Source

Thrown at server/src/services/cron.ts:142

        values.add(i);
      }
      continue;
    }

    // Check for range syntax: "N-M"
    if (trimmed.includes("-")) {
      const [aStr, bStr] = trimmed.split("-");
      const a = parseInt(aStr!, 10);
      const b = parseInt(bStr!, 10);
      if (isNaN(a) || isNaN(b)) {
        throw new Error(
          `Invalid range "${trimmed}" in cron ${spec.name} field`,
        );
      }
      validateBounds(a, spec);
      validateBounds(b, spec);
      if (a > b) {
        throw new Error(
          `Invalid range ${a}-${b} in cron ${spec.name} field (start > end)`,
        );
      }
      for (let i = a; i <= b; i++) {
        values.add(i);
      }
      continue;
    }

    // Wildcard
    if (trimmed === "*") {
      for (let i = spec.min; i <= spec.max; i++) {
        values.add(i);
      }
      continue;
    }

    // Single value

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Swap the range bounds so the start is less than or equal to the end in the named cron field.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/cron.ts:142 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/0e7f25406e655d82. Report an issue: GitHub.