paperclipai/paperclip · error · Error

Invalid step " " in cron field

Error message

Invalid step "${stepStr}" in cron ${spec.name} field

What it means

Step guard in parseField: for a X/S step expression, the step part S failed parseInt or parsed to <= 0 (non-numeric, zero, or negative). Cron steps must be positive integers, so the field is rejected with the offending step text and field name.

Solutions

  1. Fix the step value in the named cron field, e.g. use */5 with a numeric step.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/cron.ts:89 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/4287aee75e58abc1. Report an issue: GitHub.

Appendix: source

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

  const values = new Set<number>();

  // Split on commas first — each part can be a value, range, or step
  const parts = token.split(",");

  for (const part of parts) {
    const trimmed = part.trim();
    if (trimmed === "") {
      throw new Error(`Empty element in cron ${spec.name} field`);
    }

    // Check for step syntax: "X/S" where X is "*" or a range or a number
    const slashIdx = trimmed.indexOf("/");
    if (slashIdx !== -1) {
      const base = trimmed.slice(0, slashIdx);
      const stepStr = trimmed.slice(slashIdx + 1);
      const step = parseInt(stepStr, 10);
      if (isNaN(step) || step <= 0) {
        throw new Error(
          `Invalid step "${stepStr}" in cron ${spec.name} field`,
        );
      }

      let rangeStart = spec.min;
      let rangeEnd = spec.max;

      if (base === "*") {
        // */S — every S from field min
      } else if (base.includes("-")) {
        // N-M/S — range with step
        const [a, b] = base.split("-").map((s) => parseInt(s, 10));
        if (isNaN(a!) || isNaN(b!)) {
          throw new Error(
            `Invalid range "${base}" in cron ${spec.name} field`,
          );
        }
        rangeStart = a!;

View on GitHub (pinned to 120ae5428f)