GoogleContainerTools/skaffold · error
required value not set: %s
Error message
required value not set: %s
What it means
Skaffold's yamltags validation processes struct tags to enforce config correctness. A field marked `yaml:"...,required"` must not hold its zero value; requiredTag.Process returns 'required value not set' naming the yaml field name (falling back to the Go field name) when the parsed config leaves it empty.
Source
Thrown at pkg/skaffold/yamltags/tags.go:176
}
type yamlTag interface {
Load([]string) error
Process(reflect.Value) error
}
type requiredTag struct {
Field reflect.StructField
}
func (rt *requiredTag) Load(s []string) error {
return nil
}
func (rt *requiredTag) Process(val reflect.Value) error {
if isZeroValue(val) {
if tags, ok := rt.Field.Tag.Lookup("yaml"); ok {
return fmt.Errorf("required value not set: %s", strings.Split(tags, ",")[0])
}
return fmt.Errorf("required value not set: %s", rt.Field.Name)
}
return nil
}
// A program can have many structs, that each have many oneOfSets.
// Each oneOfSet is a map of a oneOf-set name to the set of fields that belong to that oneOf-set
// Only one field in that set may have a non-zero value.
var allOneOfs map[string]map[string]fieldSet
func getOneOfSetsForStruct(structName string) map[string]fieldSet {
_, ok := allOneOfs[structName]
if !ok {
allOneOfs[structName] = map[string]fieldSet{}
}
return allOneOfs[structName]View on GitHub (pinned to a1189de023)
Solutions
- Set the missing field named in the message in skaffold.yaml (the name after 'required value not set:')
- Run `skaffold config` / check `skaffold.yaml` against `skaffold init` or current schema docs
- If the field genuinely has no value, restructure the config rather than passing an empty string
- After a Skaffold upgrade, run `skaffold fix` to migrate old configs to the current schema
Example fix
// before (skaffold.yaml)
verify:
- name: "" # required value not set: name
// after
verify:
- name: my-integration-test
container:
image: gcr.io/k8s-skaffold/verify-runner Defensive patterns
Strategy: validation
Validate before calling
// validate skaffold.yaml against the schema before running
func mustSet(m map[string]interface{}, key string) error {
v, ok := m[key]
if !ok || v == nil || v == "" {
return fmt.Errorf("required value not set: %s", key)
}
return nil
} Type guard
func hasNonEmpty(s string) bool { return strings.TrimSpace(s) != "" } Try / catch
if err := skaffoldCmd.Run(); err != nil {
if strings.Contains(err.Error(), "required value not set") {
// extract field name after ':' and prompt user to fill it in skaffold.yaml
}
} Prevention
- After every Skaffold upgrade, run `skaffold fix` to migrate required fields
- Validate skaffold.yaml against the current schema before CI runs
- Start from `skaffold init` output rather than hand-writing configs
- Grep the error's field name in skaffold.yaml and fill the empty key
When it happens
Trigger: A skaffold.yaml (or any config decoded into yamltags-annotated structs) omits a field whose struct definition carries a `required` yaml tag, or explicitly sets it to the zero value (empty string, 0, nil), then config validation runs.
Common situations: Missing `deploy:` or `build:` subsection keys; a verify/test case without its `name`; copy-pasting an example but deleting a required key; a newly-added required field after upgrading Skaffold so old configs no longer validate.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- missing apiVersion
- artifact %s has invalid Jib plugin type '%s'
- only one element in set %s can be set. got %s and %s
- skipTrim value not set: %s
- invalid local-registry-hosting ConfigMap
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/3da57e942386b63b.
Report an issue: GitHub.