{"record":{"id":"d576948f9629d7d9","repo":"grafana/k6","slug":"target-for-stage-d-exceeds-max-limit-of-d","errorCode":null,"errorMessage":"target for stage %d exceeds max limit of %d","messagePattern":"target for stage (.+?) exceeds max limit of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/ramping_vus.go","lineNumber":734,"sourceCode":"}\n\n// validateTargetShifts validates the VU Target shifts.\n// It will append an error for any VU target that is larger than the maximum value allowed.\n// Each Stage needs a Target value. The stages array can be empty. The Targes could be negative.\n//\n// TODO: after https://github.com/grafana/k6/issues/1499 this validation\n// function could be useless.\nfunc validateTargetShifts(startVUs int64, stages []Stage) []error {\n\tvar errors []error\n\n\tif startVUs > int64(maxConcurrentVUs) {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the startVUs exceed max limit of %d\", maxConcurrentVUs))\n\t}\n\n\tfor i := range stages {\n\t\tif stages[i].Target.Int64 > int64(maxConcurrentVUs) {\n\t\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\t\"target for stage %d exceeds max limit of %d\", i+1, maxConcurrentVUs))\n\t\t}\n\t}\n\n\treturn errors\n}\n","sourceCodeStart":716,"sourceCodeEnd":741,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/ramping_vus.go#L716-L741","documentation":"Raised by validateTargetShifts (called from RampingVUsConfig.Validate) for a stage whose target VU count exceeds maxConcurrentVUs, the internal cap on concurrent VUs. The %d placeholder is the offending stage index.","triggerScenarios":"Thrown at lib/executor/ramping_vus.go:734 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the offending stage's target to at most maxConcurrentVUs","Split the load across several scenarios or run multiple distributed k6 instances"],"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"}