GoogleContainerTools/skaffold · error

source: %s, %s

Error message

source: %s, %s

What it means

wrapWithContext annotates every validation error collected while parsing/validating a skaffold config with the source file and config identity. When the error has no location info, this short form (without line/column) is used, prefixing 'source: <file>, in named config X / in unnamed config[N>'. It tells the developer which file/config produced the schema/validation error.

Source

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

					Location: cfg.YAMLInfos.Locate(&cfg.Test[i].CustomTests[j]),
				})
			}
		}
	}
	return
}

func wrapWithContext(config *parser.SkaffoldConfigEntry, errs ...ErrorWithLocation) []ErrorWithLocation {
	var id string
	if config.Metadata.Name != "" {
		id = fmt.Sprintf("in module %q", config.Metadata.Name)
	} else {
		id = fmt.Sprintf("in unnamed config[%d]", config.SourceIndex)
	}

	for i := range errs {
		if errs[i].Location == nil || errs[i].Location.StartLine == -1 {
			errs[i].Error = errors.Wrapf(errs[i].Error, "source: %s, %s", config.SourceFile, id)
			continue
		}
		errs[i].Error = errors.Wrapf(errs[i].Error, "source: %s, %s on line %d column %d",
			config.SourceFile, id, errs[i].Location.StartLine, errs[i].Location.StartColumn)
	}
	return errs
}

// validateKubectlManifests
// - validates that kubectl manifest files specified in the skaffold config exist
func validateKubectlManifests(configs parser.SkaffoldConfigSet) (errs []ErrorWithLocation) {
	for _, c := range configs {
		if c.IsRemote {
			continue
		}
		if len(c.Render.RawK8s) == 1 && c.Render.RawK8s[0] == constants.DefaultKubectlManifests[0] {
			log.Entry(context.TODO()).Debug("skipping validating `kubectl` deployer manifests since only the default manifest list is defined")
			continue

View on GitHub (pinned to a1189de023)

Solutions

  1. Read the 'source:' prefix to find the offending skaffold.yaml and config id, then fix the reported field in that file
  2. Run `skaffold fix` to migrate the config to the current schema version
  3. Validate locally with `skaffold diagnose` or `skaffold config` before deploying
  4. If the error is from a generated config, regenerate with correct image names/manifest paths

Example fix

// before
image: My_Invalid_Image
// after
image: my-valid-image
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate config files before running skaffold
for _, f := range configFiles {
    if err := validateSkaffoldYAML(f); err != nil {
        return fmt.Errorf("skaffold config invalid in %s: %w", f, err)
    }
}

Try / catch

if err := skaffoldProcess(cfg); err != nil {
    var validationErrs []error
    if errors.As(err, &validationErrs) {
        for _, ve := range validationErrs { log.Printf("config error: %v", ve) }
    }
    return err
}

Prevention

When it happens

Trigger: Running `skaffold` commands (via Process) whose validation errors (from validateImageNames, validateKubectlManifests, etc.) lack a source Location, or whose Location.StartLine == -1. Common with programmatically generated configs or errors not tied to a specific parsed line.

Common situations: Invalid image names in skaffold.yaml; malformed kubectl manifests referenced from the config; configs loaded without location metadata (e.g. from stdin or generated pipelines); older configs missing fields added by schema upgrades.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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