kubernetes/kops · error

Unable to execute tasks (circular dependency): %s

Error message

Unable to execute tasks (circular dependency): %s

What it means

Thrown by RunTasks after the executor stopped making progress: some tasks never finished because they (transitively) depend on each other, forming a cycle. The message lists the task keys still not done. This is a task-graph construction bug — typically two tasks each declaring the other as a dependency, or self-dependencies introduced by fi.FindDependencies on shared resources.

Source

Thrown at upup/pkg/fi/executor.go:188

			}
			if tryAgainLaterCount == n {
				klog.Infof("Continuing to run %s", formatTaskCount(tryAgainLaterCount))
			} else {
				klog.Infof("No progress made, sleeping before retrying %s", formatTaskCount(n))
			}
			time.Sleep(e.options.WaitAfterAllTasksFailed)
		}
	}

	// Raise error if not all tasks done - this means they depended on each other
	var notDone []string
	for _, ts := range taskStates {
		if !ts.done {
			notDone = append(notDone, ts.key)
		}
	}
	if len(notDone) != 0 {
		return fmt.Errorf("Unable to execute tasks (circular dependency): %s", strings.Join(notDone, ", "))
	}

	return nil
}

func (e *executor[T]) forkJoin(ctx context.Context, tasks []*taskState[T]) []error {
	if len(tasks) == 0 {
		return nil
	}

	results := make([]error, len(tasks))
	var resultsMutex sync.Mutex

	var wg sync.WaitGroup
	for i := 0; i < len(tasks); i++ {
		wg.Add(1)
		go func(ts *taskState[T], index int) {
			defer wg.Done()

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the listed task keys and trace their dependency declarations to find the cycle
  2. Avoid mutual dependencies: dependency edges should follow resource producer→consumer order
  3. Check fi.FindDependencies usage — tasks referencing each other's outputs can create cycles
  4. Reproduce locally with a dry-run to dump the task graph
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/executor.go:188 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/8159e4a70e291cfc. Report an issue: GitHub.