{"record":{"id":"af6f478319e4d5f7","repo":"grafana/k6","slug":"the-iteration-rate-must-be-more-than-0","errorCode":null,"errorMessage":"the iteration rate must be more than 0","messagePattern":"the iteration rate must be more than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/constant_arrival_rate.go","lineNumber":96,"sourceCode":"\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\"))\n\t} else if carc.PreAllocatedVUs.Int64 < 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of preAllocatedVUs can't be negative\"))","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/constant_arrival_rate.go#L78-L114","documentation":"ConstantArrivalRateConfig.Validate rejected a rate <= 0 (e.g. rate: 0 or negative). Rate is set but must be a positive number of iterations per timeUnit; a zero rate would mean a test that never starts any iterations.","triggerScenarios":"Thrown at lib/executor/constant_arrival_rate.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set rate to a positive integer such as rate: 200","Combine it with a suitable timeUnit, e.g. rate: 600, timeUnit: '1m' for 10 it/s"],"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"}