{"record":{"id":"999ffa1dd161c7a4","repo":"kubernetes/kops","slug":"function-panic","errorCode":null,"errorMessage":"function panic","messagePattern":"function panic","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/executor.go","lineNumber":212,"sourceCode":"func (e *executor[T]) forkJoin(ctx context.Context, tasks []*taskState[T]) []error {\n\tif len(tasks) == 0 {\n\t\treturn nil\n\t}\n\n\tresults := make([]error, len(tasks))\n\tvar resultsMutex sync.Mutex\n\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < len(tasks); i++ {\n\t\twg.Add(1)\n\t\tgo func(ts *taskState[T], index int) {\n\t\t\tdefer wg.Done()\n\n\t\t\t_, span := tracer.Start(ctx, \"task-\"+ts.key)\n\t\t\tdefer span.End()\n\n\t\t\tresultsMutex.Lock()\n\t\t\tresults[index] = fmt.Errorf(\"function panic\")\n\t\t\tresultsMutex.Unlock()\n\n\t\t\tklog.V(2).Infof(\"Executing task %q: %v\\n\", ts.key, ts.task)\n\n\t\t\tif taskNormalize, ok := ts.task.(TaskNormalize[T]); ok {\n\t\t\t\tif err := taskNormalize.Normalize(e.context); err != nil {\n\t\t\t\t\tresults[index] = err\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult := ts.task.Run(e.context)\n\n\t\t\tresultsMutex.Lock()\n\t\t\tresults[index] = result\n\t\t\tresultsMutex.Unlock()\n\t\t}(tasks[i], i)\n\t}","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/executor.go#L194-L230","documentation":"A defensive placeholder written into the executor's results slot before a task goroutine runs: the value is pre-set to \"function panic\" so that if the task panics before producing a result, the slice still holds an error instead of nil. Seeing this error means a task goroutine panicked (and the recover path left this sentinel in place) — the real stack trace is in the logs.","triggerScenarios":"Thrown at upup/pkg/fi/executor.go:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Search the kops log output above this error for the panic stack trace identifying the faulting task","Fix the nil dereference/index-out-of-range in the task code shown by the stack","Add defensive checks in task Run/Render methods for empty inputs that trigger the panic"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}