temporalio/temporal · warning

%s missing step value

Error message

%s missing step value

What it means

When a cron spec part contains exactly one '/' but nothing after it (e.g. "5/"), makeRange cannot parse a step value and returns this error naming the field. The slash requires an integer step on the right-hand side.

Source

Thrown at service/worker/scheduler/calendar.go:434

		return nil, nil // special case for year: all is represented as empty range list
	}
	var ranges []*schedulepb.Range
	for part := range strings.SplitSeq(s, ",") {
		var err error
		step := 1
		hasStep := false
		slashes := strings.Count(part, "/")
		if slashes > 1 {
			// Inputs like "3/5/7" should yield the canonical "too many slashes" error
			// (instead of a later strconv parse error) so tests get consistent results.
			return nil, fmt.Errorf("%s has too many slashes", field)
		}
		if slashes == 1 {
			// A single slash introduces an integer step.
			skipParts := strings.SplitN(part, "/", 2)
			// Count==1 guarantees len==2; only need to ensure the right side is non-empty.
			if skipParts[1] == "" { // e.g. "5/"
				return nil, fmt.Errorf("%s missing step value", field)
			}
			part = skipParts[0]
			step, err = strconv.Atoi(skipParts[1])
			if err != nil {
				return nil, err
			}
			if step < 1 {
				return nil, fmt.Errorf("%s has invalid Step", field)
			}
			hasStep = true
		}

		start, end := minVal, maxVal
		if part != "*" {
			if strings.Contains(part, "-") {
				// Only a single dash is allowed to denote a range (e.g. "1-5").
				// Inputs with multiple dashes like "1-5-7" should raise the
				// canonical "too many dashes" error expected by tests.

View on GitHub (pinned to bde624efd1)

Solutions

  1. Provide a step value after the slash: "5/" → "5/2" (or just "5").
  2. Strip trailing slashes or validate the spec before submitting.
  3. Check config/templating for variable substitution that rendered an empty step.
  4. Use a cron expression validator/linter in your tooling.

Example fix

// before
spec := "*/" // missing step
// after
spec := "*/5"
Defensive patterns

Strategy: validation

Validate before calling

func hasStepValue(part string) bool {
    i := strings.Index(part, "/")
    return i == -1 || (i+1 < len(part) && part[i+1:] != "")
}

Prevention

When it happens

Trigger: A schedule spec field part ends with a trailing slash, e.g. Minute="5/" or "*/", produced by templating bugs or truncated configuration strings.

Common situations: YAML/config templating that drops the step value after '/', users editing schedule specs by hand and leaving a dangling '/', programmatic string building that appends '/' unconditionally.

Related errors


AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01). Data as JSON: /api/errors/8037ad6ca10571fa. Report an issue: GitHub.