temporalio/temporal · warning

%s has too many slashes

Error message

%s has too many slashes

What it means

MakeRange (cron/schedule spec parser in the scheduler package) rejects a comma-separated field part containing more than one '/', e.g. "3/5/7". Cron syntax allows at most one step value per part, so the parser returns this canonical error naming the field (e.g. "Minute has too many slashes").

Source

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

//revive:disable-next-line:cognitive-complexity
func makeRange(s, field, def string, minVal, maxVal int, parseMode parseMode) ([]*schedulepb.Range, error) {
	s = strings.TrimSpace(s)
	if s == "" {
		s = def
	}
	if s == "*" && parseMode == parseModeYear {
		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
		}

View on GitHub (pinned to bde624efd1)

Solutions

  1. Fix the spec so each part has at most one step: e.g. "3/5/7" → "3/7" or "*/5".
  2. Validate the cron/schedule string before submitting it to the scheduler API.
  3. Check which field the error names (field prefix) to locate the offending part in the spec.
  4. If you need both a range-step and another step, express them as separate comma-separated parts.

Example fix

// before
spec := "3/5/7" // Minute field
// after
spec := "3/7" // single step only
Defensive patterns

Strategy: validation

Validate before calling

func validCronPart(part string) bool {
    return strings.Count(part, "/") <= 1
}
if !validCronPart(minutePart) {
    return errors.New("cron part may contain at most one '/'")
}

Prevention

When it happens

Trigger: Calling schedule/cron parsing (used by Scheduler specs) with a spec field part like "*/2/3" or "1-5/2/3" — two or more '/' characters in one comma-separated part.

Common situations: Users copying cron expressions that double-apply step values, or concatenating "x/y" strings programmatically producing "x/y/z"; typos in scheduler calendar spec configuration.

Related errors


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