{"record":{"id":"dea34e6e3548c97e","repo":"GoogleContainerTools/skaffold","slug":"unable-to-create-dependency-graph-w","errorCode":null,"errorMessage":"unable to create dependency graph: %w","messagePattern":"unable to create dependency graph: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/helm/helm.go","lineNumber":265,"sourceCode":"\n\t// Check that the cluster is reachable.\n\t// This gives a better error message when the cluster can't be reached.\n\tif err := kubernetes.FailIfClusterIsNotReachable(h.kubeContext); err != nil {\n\t\treturn fmt.Errorf(\"unable to connect to Kubernetes: %w\", err)\n\t}\n\n\tchildCtx, endTrace := instrumentation.StartTrace(ctx, \"Deploy_LoadImages\")\n\tif err := h.imageLoader.LoadImages(childCtx, out, h.localImages, h.originalImages, builds); err != nil {\n\t\tendTrace(instrumentation.TraceEndError(err))\n\t\treturn err\n\t}\n\tendTrace()\n\n\tolog.Entry(ctx).Infof(\"Deploying with helm v%s ...\", h.helmVersion)\n\n\tdependencyGraph, err := NewDependencyGraph(h.Releases)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create dependency graph: %w\", err)\n\t}\n\n\tlevelByLevelReleases, err := dependencyGraph.GetReleasesByLevel()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to get releases by level: %w\", err)\n\t}\n\n\tvar mu sync2.Mutex\n\tnsMap := map[string]struct{}{}\n\tmanifests := manifest.ManifestList{}\n\n\tconcurrency := 1\n\tif h.Concurrency != nil {\n\t\tif *h.Concurrency == 0 {\n\t\t\tconcurrency = -1 // unlimited\n\t\t} else {\n\t\t\tconcurrency = *h.Concurrency\n\t\t}","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/helm/helm.go#L247-L283","documentation":"Wraps NewDependencyGraph failure when building the release dependency DAG from helm.releases in skaffold.yaml. The graph builder rejects cycles or invalid release definitions, so Deploy cannot order the releases.","triggerScenarios":"Calling Deploy with two or more releases whose chartDependency references form a cycle (release A depends on B, B depends on A), or a dependency referencing a non-existent release name.","commonSituations":"Copy-pasting release blocks in skaffold.yaml and leaving mutual chartDependency entries; renaming a release without updating another release's chartDependency.","solutions":["Inspect helm.releases in skaffold.yaml and remove the dependency cycle between chartDependency entries","Ensure every chartDependency name matches an existing release's name","Simplify to a linear dependency chain if unsure"],"exampleFix":"// before (skaffold.yaml)\nreleases:\n  - name: a\n    chartDependency: b\n  - name: b\n    chartDependency: a\n// after\nreleases:\n  - name: a\n  - name: b\n    chartDependency: a","handlingStrategy":"validation","validationCode":"names := map[string][]string{}\nfor _, r := range releases {\n  for _, dep := range r.ChartDependency {\n    if dep == r.Name {\n      return fmt.Errorf(\"release %q depends on itself\", r.Name)\n    }\n    names[dep] = append(names[dep], r.Name)\n  }\n}\n// DFS cycle check\ntodo := map[string]bool{}\ndone := map[string]bool{}\nvar visit func(string) error\nvisit = func(n string) error {\n  if done[n] { return nil }\n  if todo[n] { return fmt.Errorf(\"cycle at %s\", n) }\n  todo[n] = true\n  for _, dep := range deps[n] { if err := visit(dep); err != nil { return err } }\n  todo[n] = false; done[n] = true\n  return nil\n}\nfor n := range deps { if err := visit(n); err != nil { return err } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep chartDependency chains one-directional (leaf -> root)","Lint skaffold.yaml with a cycle check in CI","Rename releases via search-and-replace across all chartDependency references"],"tags":["helm","config","dependency-graph"],"backgroundTag":"helm-release-dependency-cycle","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}