{"record":{"id":"3e152a0a29440df0","repo":"grafana/k6","slug":"error-while-initializing-executor-s-w","errorCode":null,"errorMessage":"error while initializing executor %s: %w","messagePattern":"error while initializing executor (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/execution/scheduler.go","lineNumber":317,"sourceCode":"\t\tinitErr = err\n\t\tcancel(initErr)\n\t}\n\n\tif initErr != nil {\n\t\treturn initErr\n\t}\n\n\te.state.SetInitVUFunc(func(ctx context.Context, logger *logrus.Entry) (lib.InitializedVU, error) {\n\t\treturn e.initVU(ctx, samplesOut, logger)\n\t})\n\n\te.state.SetExecutionStatus(lib.ExecutionStatusInitExecutors)\n\tlogger.Debugf(\"Finished initializing needed VUs, start initializing executors...\")\n\tfor _, exec := range e.executors {\n\t\texecutorConfig := exec.GetConfig()\n\n\t\tif err := exec.Init(ctx); err != nil {\n\t\t\treturn fmt.Errorf(\"error while initializing executor %s: %w\", executorConfig.GetName(), err)\n\t\t}\n\t\tlogger.Debugf(\"Initialized executor %s\", executorConfig.GetName())\n\t}\n\n\te.state.SetExecutionStatus(lib.ExecutionStatusInitDone)\n\tlogger.Debugf(\"Initialization completed\")\n\treturn nil\n}\n\n// runExecutor gets called by the public Run() method once per configured\n// executor, each time in a new goroutine. It is responsible for waiting out the\n// configured startTime for the specific executor and then running its Run()\n// method.\nfunc (e *Scheduler) runExecutor(\n\trunCtx context.Context, runResults chan<- error, engineOut chan<- metrics.SampleContainer, executor lib.Executor,\n) {\n\texecutorConfig := executor.GetConfig()\n\texecutorStartTime := executorConfig.GetStartTime()","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/execution/scheduler.go#L299-L335","documentation":"initVUsAndExecutors wraps an executor's Init failure; %s is the scenario/executor name from its config. The wrapped error is the executor-specific cause — usually an invalid scenario configuration (e.g. bad arrival rate, start time, or max-duration settings) detected at initialization time.","triggerScenarios":"Thrown at internal/execution/scheduler.go:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped error to identify the executor-specific problem","Validate scenario options (vus, iterations, rate, duration, startTime, maxDuration) in the scenarios config","Check that startTime/maxDuration values parse as valid durations"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}