{"record":{"id":"673ef6a8b7ca6aca","repo":"robfig/cron","slug":"too-many-slashes-s","errorCode":null,"errorMessage":"too many slashes: %s","messagePattern":"too many slashes: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"parser.go","lineNumber":301,"sourceCode":"\n\tswitch len(rangeAndStep) {\n\tcase 1:\n\t\tstep = 1\n\tcase 2:\n\t\tstep, err = mustParseInt(rangeAndStep[1])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// Special handling: \"N/step\" means \"N-max/step\".\n\t\tif singleDigit {\n\t\t\tend = r.max\n\t\t}\n\t\tif step > 1 {\n\t\t\textra = 0\n\t\t}\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"too many slashes: %s\", expr)\n\t}\n\n\tif start < r.min {\n\t\treturn 0, fmt.Errorf(\"beginning of range (%d) below minimum (%d): %s\", start, r.min, expr)\n\t}\n\tif end > r.max {\n\t\treturn 0, fmt.Errorf(\"end of range (%d) above maximum (%d): %s\", end, r.max, expr)\n\t}\n\tif start > end {\n\t\treturn 0, fmt.Errorf(\"beginning of range (%d) beyond end of range (%d): %s\", start, end, expr)\n\t}\n\tif step == 0 {\n\t\treturn 0, fmt.Errorf(\"step of range should be a positive number: %s\", expr)\n\t}\n\n\treturn getBits(start, end, step) | extra, nil\n}\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/robfig/cron/blob/bc59245fe10efaed9d51b56900192527ed733435/parser.go#L283-L319","documentation":"getRange splits an expression on '/' to separate the range from the step. An expression containing more than one '/' cannot be interpreted as range/step and is rejected with this error naming the expression.","triggerScenarios":"Specs like \"*/2/3\" or \"1-5/2/2\" in any field; accidentally doubling the step syntax or pasting a URL/path fragment into a cron field.","commonSituations":"Typo with repeated step separators; generated specs where a step value itself contained a slash; copy-paste of strings like \"*/15\" from another context plus its own step.","solutions":["Use at most one '/' per field component (range/step)","Remove the duplicated step: \"*/15\" not \"*/15/2\"","Validate fields against a pattern like ^\\S+/\\S+$ allowing only one slash before parsing"],"exampleFix":"// before\nsched, err := p.Parse(\"0 */2/3 * * *\")\n// after\nsched, err := p.Parse(\"0 */2 * * *\")","handlingStrategy":"validation","validationCode":"if strings.Count(field, \"/\") > 1 {\n\treturn fmt.Errorf(\"field %q may contain at most one '/' step separator\", field)\n}","typeGuard":null,"tryCatchPattern":"sched, err := parser.Parse(spec)\nif err != nil {\n\treturn fmt.Errorf(\"malformed step in cron spec %q: %w\", spec, err)\n}","preventionTips":["Use a single '/' for the step in each field","Sanitize pasted/generated specs for stray slashes","Validate cron fields with a strict regex before Parse"],"tags":["go","cron","parser","syntax","step"],"backgroundTag":"invalid-argument-format","analyzedSha":"bc59245fe10efaed9d51b56900192527ed733435","analyzedAt":"2026-09-07T00:35:06.760Z","contentChangedAt":"2026-09-07T00:35:06.760Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}