{"record":{"id":"291bb1940a643867","repo":"grafana/k6","slug":"the-number-of-vus-must-be-more-than-0-291bb1","errorCode":null,"errorMessage":"the number of VUs must be more than 0","messagePattern":"the number of VUs must be more than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/per_vu_iterations.go","lineNumber":74,"sourceCode":"// important to note that scaling per-VU iteration executor affects only the\n// number of VUs. If we also scaled the iterations, scaling would have quadratic\n// effects instead of just linear.\nfunc (pvic PerVUIterationsConfig) GetIterations() int64 {\n\treturn pvic.Iterations.Int64\n}\n\n// GetDescription returns a human-readable description of the executor options\nfunc (pvic PerVUIterationsConfig) GetDescription(et *lib.ExecutionTuple) string {\n\treturn fmt.Sprintf(\"%d iterations for each of %d VUs%s\",\n\t\tpvic.GetIterations(), pvic.GetVUs(et),\n\t\tpvic.getBaseInfo(fmt.Sprintf(\"maxDuration: %s\", pvic.MaxDuration.Duration)))\n}\n\n// Validate makes sure all options are configured and valid\nfunc (pvic PerVUIterationsConfig) Validate() []error {\n\terrors := pvic.BaseConfig.Validate()\n\tif pvic.VUs.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of VUs must be more than 0\"))\n\t}\n\n\tif pvic.Iterations.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of iterations must be more than 0\"))\n\t}\n\n\tif pvic.MaxDuration.TimeDuration() < minDuration {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the maxDuration must be at least %s, but is %s\", minDuration, pvic.MaxDuration,\n\t\t))\n\t}\n\n\treturn errors\n}\n\n// GetExecutionRequirements returns the number of required VUs to run the\n// executor for its whole duration (disregarding any startTime), including the\n// maximum waiting time for any iterations to gracefully stop. This is used by","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/per_vu_iterations.go#L56-L92","documentation":"PerVUIterationsConfig.Validate rejected a vus value <= 0. The per-VU-iterations executor runs a fixed iteration count in each of a fixed number of VUs, so at least one VU is required; the value is also segment-scaled, and a segment yielding 0 VUs fails here too.","triggerScenarios":"Thrown at lib/executor/per_vu_iterations.go:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set vus to a positive integer, e.g. vus: 10, iterations: 20","Ensure the execution segment is wide enough to scale to at least 1 VU"],"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"}