{"record":{"id":"e6075fa4c6d9386a","repo":"kubernetes/kops","slug":"task-q-not-found","errorCode":null,"errorMessage":"task %q not found","messagePattern":"task %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/template_functions.go","lineNumber":539,"sourceCode":"\nfunc (tf *TemplateFunctions) taskMap() (map[string]fi.CloudupTask, error) {\n\tif tf.tasks == nil {\n\t\treturn nil, fmt.Errorf(\"template tasks are not available during this render phase\")\n\t}\n\treturn tf.tasks, nil\n}\n\n// Task returns a task by type and name, for example Task \"IAMRole\" \"nodes.example.com\".\nfunc (tf *TemplateFunctions) Task(typeName, name string) (fi.CloudupTask, error) {\n\ttasks, err := tf.taskMap()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tkey := typeName + \"/\" + name\n\ttask := tasks[key]\n\tif task == nil {\n\t\treturn nil, fmt.Errorf(\"task %q not found\", key)\n\t}\n\treturn task, nil\n}\n\n// HasTask reports whether the named task exists in the final task graph.\nfunc (tf *TemplateFunctions) HasTask(typeName, name string) bool {\n\tif tf.tasks == nil {\n\t\treturn false\n\t}\n\treturn tf.tasks[typeName+\"/\"+name] != nil\n}\n\n// TasksByType returns tasks of a specific type in deterministic task-key order.\nfunc (tf *TemplateFunctions) TasksByType(typeName string) ([]fi.CloudupTask, error) {\n\ttasks, err := tf.taskMap()\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/template_functions.go#L521-L557","documentation":"Returned by the template helper Task(typeName, name) when the constructed key typeName+\"/\"+name is not present in the task map. It fires when a CloudTemplate references a task that was never registered (wrong type name, wrong task name, or the producing task was skipped for this cloud provider), causing template rendering to fail.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/template_functions.go:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the template for the exact Task type and name strings; they must match the registered task's type name and its name field","Ensure the task being referenced is actually produced for the current cloud provider and lifecycle","If the reference is optional, guard it in the template or use TasksMatching for prefix lookups"],"exampleFix":null,"handlingStrategy":"validation","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"}