kubernetes/kops · error

unable to find task %q, referenced from %s:%s

Error message

unable to find task %q, referenced from %s:%s

What it means

The loader's task-resolution pass fires this when a task field references another task by type/name (via HasName) that is not present in l.tasks. The referenced task was never built or its name mismatches, so cross-task links cannot be wired; known task keys are logged to aid debugging.

Source

Thrown at upup/pkg/fi/cloudup/loader.go:95

				if v.CanInterface() && !v.IsNil() {
					// TODO: Can we / should we use a type-switch statement
					intf := v.Interface()
					if hn, ok := intf.(fi.HasName); ok {
						name := hn.GetName()
						if name != nil {
							typeNameForTask := fi.TypeNameForTask(intf)
							primary := l.tasks[typeNameForTask+"/"+*name]
							if primary == nil {
								keys := sets.NewString()
								for k := range l.tasks {
									keys.Insert(k)
								}
								klog.Infof("Known tasks:")
								for _, k := range keys.List() {
									klog.Infof("  %s", k)
								}

								return fmt.Errorf("unable to find task %q, referenced from %s:%s", typeNameForTask+"/"+*name, taskKey, path)
							}

							klog.V(11).Infof("Replacing task %q at %s:%s", *name, taskKey, path)
							v.Set(reflect.ValueOf(primary))
						}
						return reflectutils.SkipReflection
					}
				}
			}

			return nil
		}

		err := reflectutils.ReflectRecursive(taskValue, visitor, &reflectutils.ReflectOptions{DeprecatedDoubleVisit: true})
		if err != nil {
			return fmt.Errorf("unexpected error resolving task %q: %v", taskKey, err)
		}
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the referenced task's type and name spelling against the logged list of known tasks
  2. Ensure the referenced task is actually created during BuildTasks
  3. Fix the manifest/spec so the referenced task exists
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/loader.go:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/15a276ada6407f9e. Report an issue: GitHub.