GoogleContainerTools/skaffold · error
skipTrim value not set: %s
Error message
skipTrim value not set: %s
What it means
This error comes from the `skipTrim` yamltag validator in Skaffold's config reflection package. When a struct field marked with a `yaml:"...,skipTrim"` tag holds a zero value after parsing, Process() rejects it, reporting the field's yaml name (or Go field name if no yaml tag exists). It enforces that users of skipTrim fields always supply an explicit, non-zero value, because skipped/empty fields would otherwise be silently trimmed from output with unexpected semantics.
Source
Thrown at pkg/skaffold/yamltags/tags.go:252
if !isZeroValue(field) {
return fmt.Errorf("only one element in set %s can be set. got %s and %s", oot.setName, otherField, oot.Field.Name)
}
}
return nil
}
type skipTrimTag struct {
Field reflect.StructField
}
func (tag *skipTrimTag) Load(s []string) error {
return nil
}
func (tag *skipTrimTag) Process(val reflect.Value) error {
if isZeroValue(val) {
if tags, ok := tag.Field.Tag.Lookup("yaml"); ok {
return fmt.Errorf("skipTrim value not set: %s", strings.Split(tags, ",")[0])
}
return fmt.Errorf("skipTrim value not set: %s", tag.Field.Name)
}
return nil
}
func isZeroValue(val reflect.Value) bool {
if val.Kind() == reflect.Invalid {
return true
}
zv := reflect.Zero(val.Type()).Interface()
return reflect.DeepEqual(zv, val.Interface())
}
func init() {
allOneOfs = make(map[string]map[string]fieldSet)
}
View on GitHub (pinned to a1189de023)
Solutions
- Set a non-zero, explicit value for the reported yaml field in your skaffold.yaml.
- Check the field name in the error message and consult the Skaffold schema docs for the current expected value/type.
- If you are a Skaffold developer and the field should be optional, remove the skipTrim yamltag from the struct field.
- If your code sets the field programmatically, ensure you assign it before running validation (e.g. default it in NewXxx constructors).
Example fix
// before (skaffold.yaml)
build:
artifacts: []
// after
build:
artifacts:
- image: my-image
context: . Defensive patterns
Strategy: validation
Validate before calling
// validate the yaml field is set before processing
tags, ok := field.Tag.Lookup("yaml")
name := field.Name
if ok { name = strings.Split(tags, ",")[0] }
if val.IsZero() {
return fmt.Errorf("field %s marked skipTrim must be set", name)
} Prevention
- Always populate skipTrim-marked fields in skaffold.yaml — never leave `key:` empty.
- After editing YAML by hand, run `skaffold config` / `skaffold diagnose` to validate the schema.
- Keep yaml struct tags correct when adding skipTrim in Go config types.
When it happens
Trigger: Calling Process (directly or via skaffold's config validation walk) on a parsed Skaffold config struct whose field carrying the skipTrim yaml tag is a zero value (empty string, 0, false, nil, etc.), and the field's struct tag has a `yaml` tag whose first comma-separated token is used in the message.
Common situations: Users write a skaffold.yaml that omits a required field (or sets it to an empty value) where the Go config type marks that field skipTrim; happens after CLI schema changes make a previously optional field mandatory, or from hand-edited YAML leaving `key:` with nothing after the colon.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- missing apiVersion
- artifact %s has invalid Jib plugin type '%s'
- verify command expects non-zero number of test cases
- CONFIG_MISSING_MANIFEST_FILE_ERR
- INIT_CLOUD_RUN_LOCATION_ERROR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/4eae6f6451e268b8.
Report an issue: GitHub.