{"record":{"id":"ab28997fa6c65249","repo":"GoogleContainerTools/skaffold","slug":"artifact-s-has-invalid-dependencies-dependencies","errorCode":null,"errorMessage":"artifact %s has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths","messagePattern":"artifact (.+?) has invalid dependencies; dependencies\\.ignore can only be used in conjunction with dependencies\\.paths","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/validation/validation.go","lineNumber":487,"sourceCode":"\t\t\t\t\t\t\tAction:         \"Please fix the docker network container name and try again.\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}))\n\t\t}\n\t}\n\treturn errs\n}\n\n// validateCustomDependencies makes sure that dependencies.ignore is only used in conjunction with dependencies.paths\nfunc validateCustomDependencies(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {\n\tfor i, a := range artifacts {\n\t\tif a.CustomArtifact == nil || a.CustomArtifact.Dependencies == nil || a.CustomArtifact.Dependencies.Ignore == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif a.CustomArtifact.Dependencies.Dockerfile != nil || a.CustomArtifact.Dependencies.Command != \"\" {\n\t\t\tcfgErrs = append(cfgErrs, ErrorWithLocation{\n\t\t\t\tError:    fmt.Errorf(\"artifact %s has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths\", a.ImageName),\n\t\t\t\tLocation: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i], \"ImageName\"),\n\t\t\t})\n\t\t}\n\t}\n\treturn\n}\n\n// visitStructs recursively visits all fields in the config and collects errors found by the visitor\nfunc visitStructs(cfg *parser.SkaffoldConfigEntry, v reflect.Value, visitor func(interface{}) error) []ErrorWithLocation {\n\tswitch v.Kind() {\n\tcase reflect.Struct:\n\t\tvar cfgErrs []ErrorWithLocation\n\t\tif err := visitor(v.Interface()); err != nil {\n\t\t\tvar cfgErr ErrorWithLocation\n\t\t\tif v.CanAddr() {\n\t\t\t\tcfgErr = ErrorWithLocation{\n\t\t\t\t\tError:    err,\n\t\t\t\t\tLocation: cfg.YAMLInfos.LocateByPointer(v.Addr().Pointer()),","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/validation/validation.go#L469-L505","documentation":"validateCustomDependencies checks custom artifact dependency configuration. dependencies.ignore (a list of paths to exclude) is only meaningful with dependencies.paths (file-based sync); combining it with dockerfile- or command-based dependency inference is unsupported and rejected.","triggerScenarios":"A custom artifact sets custom.dependencies.ignore while also setting custom.dependencies.dockerfile or custom.dependencies.command — the two mechanisms are mutually exclusive with ignore.","commonSituations":"Migrating a custom artifact from paths-based to command/dockerfile-based dependency discovery while leaving the old ignore list in place.","solutions":["Remove the dependencies.ignore list when using dependencies.dockerfile or dependencies.command","Or switch back to dependencies.paths and keep ignore, if path-based discovery is what you need","Express exclusions inside the dockerfile/command mechanism instead (e.g. adjust the command output)"],"exampleFix":"// before\ncustom:\n  dependencies:\n    command: ./gen-deps.sh\n    ignore: [\"tmp/**\"]\n// after\ncustom:\n  dependencies:\n    command: ./gen-deps.sh","handlingStrategy":"validation","validationCode":"// Go: ignore requires paths-based dependencies\nfunc ignoreNeedsPaths(deps struct{ Ignore []string; Paths []string; Command string; Dockerfile *string }) bool {\n\treturn len(deps.Ignore) > 0 && len(deps.Paths) == 0 && (deps.Dockerfile != nil || deps.Command != \"\")\n}","typeGuard":null,"tryCatchPattern":"if invalidCombo(deps) {\n\treturn errors.New(\"dependencies.ignore requires dependencies.paths and cannot be combined with dockerfile/command\")\n}","preventionTips":["When switching custom dependencies to dockerfile/command mode, delete the ignore list in the same change","Document that ignore only applies to paths-based dependency discovery","Review custom artifact blocks after migrations between discovery mechanisms"],"tags":["skaffold","custom-builder","file-dependencies","config-validation"],"backgroundTag":"conflicting-dependency-config","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"}