GoogleContainerTools/skaffold · error

artifact %s has invalid dependencies; dependencies.ignore ca

Error message

artifact %s has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths

What it means

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.

Source

Thrown at pkg/skaffold/schema/validation/validation.go:487

							Action:         "Please fix the docker network container name and try again.",
						},
					},
				}))
		}
	}
	return errs
}

// validateCustomDependencies makes sure that dependencies.ignore is only used in conjunction with dependencies.paths
func validateCustomDependencies(cfg *parser.SkaffoldConfigEntry, artifacts []*latest.Artifact) (cfgErrs []ErrorWithLocation) {
	for i, a := range artifacts {
		if a.CustomArtifact == nil || a.CustomArtifact.Dependencies == nil || a.CustomArtifact.Dependencies.Ignore == nil {
			continue
		}

		if a.CustomArtifact.Dependencies.Dockerfile != nil || a.CustomArtifact.Dependencies.Command != "" {
			cfgErrs = append(cfgErrs, ErrorWithLocation{
				Error:    fmt.Errorf("artifact %s has invalid dependencies; dependencies.ignore can only be used in conjunction with dependencies.paths", a.ImageName),
				Location: cfg.YAMLInfos.LocateField(cfg.Build.Artifacts[i], "ImageName"),
			})
		}
	}
	return
}

// visitStructs recursively visits all fields in the config and collects errors found by the visitor
func visitStructs(cfg *parser.SkaffoldConfigEntry, v reflect.Value, visitor func(interface{}) error) []ErrorWithLocation {
	switch v.Kind() {
	case reflect.Struct:
		var cfgErrs []ErrorWithLocation
		if err := visitor(v.Interface()); err != nil {
			var cfgErr ErrorWithLocation
			if v.CanAddr() {
				cfgErr = ErrorWithLocation{
					Error:    err,
					Location: cfg.YAMLInfos.LocateByPointer(v.Addr().Pointer()),

View on GitHub (pinned to a1189de023)

Solutions

  1. Remove the dependencies.ignore list when using dependencies.dockerfile or dependencies.command
  2. Or switch back to dependencies.paths and keep ignore, if path-based discovery is what you need
  3. Express exclusions inside the dockerfile/command mechanism instead (e.g. adjust the command output)

Example fix

// before
custom:
  dependencies:
    command: ./gen-deps.sh
    ignore: ["tmp/**"]
// after
custom:
  dependencies:
    command: ./gen-deps.sh
Defensive patterns

Strategy: validation

Validate before calling

// Go: ignore requires paths-based dependencies
func ignoreNeedsPaths(deps struct{ Ignore []string; Paths []string; Command string; Dockerfile *string }) bool {
	return len(deps.Ignore) > 0 && len(deps.Paths) == 0 && (deps.Dockerfile != nil || deps.Command != "")
}

Try / catch

if invalidCombo(deps) {
	return errors.New("dependencies.ignore requires dependencies.paths and cannot be combined with dockerfile/command")
}

Prevention

When it happens

Trigger: 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.

Common situations: Migrating a custom artifact from paths-based to command/dockerfile-based dependency discovery while leaving the old ignore list in place.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/ab28997fa6c65249. Report an issue: GitHub.