GoogleContainerTools/skaffold · error

CONFIG_ZERO_FOUND_ERR

CONFIG_ZERO_FOUND_ERR

Error message

failed to get any valid configs from file %q

What it means

ZeroConfigsParsedErr indicates a config file (e.g. skaffold.yaml) contained no valid skaffold configurations at all — the file parsed but yielded zero configs. Code CONFIG_ZERO_FOUND_ERR; notably it carries no suggestion because the file is effectively empty.

Source

Thrown at pkg/skaffold/schema/errors/errors.go:85

func BadConfigFilterErr(filter []string) error {
	msg := fmt.Sprintf("did not find any configs matching selection %v", filter)
	return sErrors.NewError(errors.New(msg),
		&proto.ActionableErr{
			Message: msg,
			ErrCode: proto.StatusCode_CONFIG_BAD_FILTER_ERR,
			Suggestions: []*proto.Suggestion{
				{
					SuggestionCode: proto.SuggestionCode_CONFIG_CHECK_FILTER,
					Action:         "Check that the arguments to the `-m` or `--module` flag are valid config names",
				},
			},
		})
}

// ZeroConfigsParsedErr specifies that the config file is empty
func ZeroConfigsParsedErr(file string) error {
	msg := fmt.Sprintf("failed to get any valid configs from file %q", file)
	return sErrors.NewError(errors.New(msg),
		&proto.ActionableErr{
			Message: msg,
			ErrCode: proto.StatusCode_CONFIG_ZERO_FOUND_ERR,
		})
}

// DuplicateConfigNamesInSameFileErr specifies that multiple configs have the same name in current config file
func DuplicateConfigNamesInSameFileErr(config, file string) error {
	msg := fmt.Sprintf("multiple skaffold configs named %q found in file %q", config, file)
	return sErrors.NewError(errors.New(msg),
		&proto.ActionableErr{
			Message: msg,
			ErrCode: proto.StatusCode_CONFIG_DUPLICATE_NAMES_SAME_FILE_ERR,
			Suggestions: []*proto.Suggestion{
				{
					SuggestionCode: proto.SuggestionCode_CONFIG_CHANGE_NAMES,
					Action:         fmt.Sprintf("Change the name of one of the occurrences of config %q in file %q to make it unique", config, file),
				},

View on GitHub (pinned to a1189de023)

Solutions

  1. Restore a valid skaffold.yaml (run `skaffold init` to generate one).
  2. Verify the file passed via `--filename`/config path is actually a skaffold config with a top-level `apiVersion` and `kind: Config`.
  3. Check git status / restore the file if it was truncated.

Example fix

// before (empty skaffold.yaml)
# nothing here
// after
apiVersion: skaffold/v4beta7
kind: Config
build:
  artifacts:
    - image: my-app
Defensive patterns

Strategy: validation

Validate before calling

test -s skaffold.yaml || { echo 'skaffold.yaml is empty'; exit 1; }
grep -q 'kind: Config' skaffold.yaml || { echo 'no skaffold Config found'; exit 1; }

Try / catch

if err := cfgParsers.Parse(...); err != nil {
    var sErr *sErrors.Error
    if errors.As(err, &sErr) && sErr.ErrCode == proto.StatusCode_CONFIG_ZERO_FOUND_ERR {
        return fmt.Errorf("%w (file exists but has no skaffold configs; was it truncated?)", err)
    }
    return err
}

Prevention

When it happens

Trigger: Loading a config path where the document is empty, contains only comments, or where all documents in a multi-document YAML were filtered out, so nothing qualified as a skaffold config.

Common situations: An empty skaffold.yaml created by `touch`, a file accidentally truncated by a bad merge or editor save, or pointing `--filename` at the wrong (non-skaffold) YAML file.

Related errors


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