{"record":{"id":"358dee93a8b4567e","repo":"grafana/k6","slug":"the-iteration-rate-isn-t-specified","errorCode":null,"errorMessage":"the iteration rate isn't specified","messagePattern":"the iteration rate isn't specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/constant_arrival_rate.go","lineNumber":94,"sourceCode":"\n\ttimeUnit := carc.TimeUnit.TimeDuration()\n\tvar arrRatePerSec float64\n\tif maxVUs != 0 { // TODO: do something better?\n\t\tratio := big.NewRat(maxVUs, carc.MaxVUs.Int64)\n\t\tarrRate := big.NewRat(carc.Rate.Int64, int64(timeUnit))\n\t\tarrRate.Mul(arrRate, ratio)\n\t\tarrRatePerSec, _ = getArrivalRatePerSec(arrRate).Float64()\n\t}\n\n\treturn fmt.Sprintf(\"%.2f iterations/s for %s%s\", arrRatePerSec, carc.Duration.Duration,\n\t\tcarc.getBaseInfo(maxVUsRange))\n}\n\n// Validate makes sure all options are configured and valid\nfunc (carc *ConstantArrivalRateConfig) Validate() []error {\n\terrors := carc.BaseConfig.Validate()\n\tif !carc.Rate.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the iteration rate isn't specified\"))\n\t} else if carc.Rate.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the iteration rate must be more than 0\"))\n\t}\n\n\tif carc.TimeUnit.TimeDuration() <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the timeUnit must be more than 0\"))\n\t}\n\n\tif !carc.Duration.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the duration is unspecified\"))\n\t} else if carc.Duration.TimeDuration() < minDuration {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the duration must be at least %s, but is %s\", minDuration, carc.Duration,\n\t\t))\n\t}\n\n\tif !carc.PreAllocatedVUs.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the number of preAllocatedVUs isn't specified\"))","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/constant_arrival_rate.go#L76-L112","documentation":"ConstantArrivalRateConfig.Validate found the 'rate' option unset (null.NullInt64 not valid) for a constant-arrival-rate executor. The rate — iterations per timeUnit — is the defining option of this executor, so its absence is fatal configuration error #1 in the Validate chain.","triggerScenarios":"Thrown at lib/executor/constant_arrival_rate.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set rate in the executor options, e.g. { executor: 'constant-arrival-rate', rate: 10, timeUnit: '1s', duration: '10m', preAllocatedVUs: 10, maxVUs: 50 }","Remember exported scripts keep rate as iterations per timeUnit, not per second"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}