argoproj/argo-workflows · error

containers.%s dependency '%s' not defined

Error message

containers.%s dependency '%s' not defined

What it means

ContainerSetTemplate.Validate found a container whose Dependencies array names a container that is not declared in the same container set. The message identifies the referencing container (ctr.Name) and the missing dependency name.

Source

Thrown at pkg/apis/workflow/v1alpha1/container_set_template_types.go:122

	// Ensure there are no collisions with volume mountPaths and artifact load paths
	mountPaths := make(map[string]string)
	for i, volMount := range in.VolumeMounts {
		if prev, ok := mountPaths[volMount.MountPath]; ok {
			return fmt.Errorf("volumeMounts[%d].mountPath '%s' already mounted in %s", i, volMount.MountPath, prev)
		}
		mountPaths[volMount.MountPath] = fmt.Sprintf("volumeMounts.%s", volMount.Name)
	}

	// Ensure the dependencies are defined
	nameToContainer := make(map[string]ContainerNode)
	for _, ctr := range in.Containers {
		nameToContainer[ctr.Name] = ctr
	}
	for _, ctr := range in.Containers {
		for _, depName := range ctr.Dependencies {
			_, ok := nameToContainer[depName]
			if !ok {
				return fmt.Errorf("containers.%s dependency '%s' not defined", ctr.Name, depName)
			}
		}
	}

	// Ensure there is no dependency cycle
	depGraph := make(map[string][]string)
	for _, ctr := range in.Containers {
		depGraph[ctr.Name] = append(depGraph[ctr.Name], ctr.Dependencies...)
	}
	err = validateNoCycles(depGraph)
	if err != nil {
		return fmt.Errorf("containers %s", err.Error())
	}
	return nil
}

type ContainerNode struct {
	corev1.Container `json:",inline" protobuf:"bytes,1,opt,name=container"`

View on GitHub (pinned to 35bff19146)

Solutions

  1. Add a container entry named as the dependency, or fix the typo in the dependencies list
  2. Ensure dependencies reference sibling containers, not templates or other steps
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/apis/workflow/v1alpha1/container_set_template_types.go:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/2ef830bc1f6e1211. Report an issue: GitHub.