{"record":{"id":"3f42454068b9005c","repo":"GoogleContainerTools/skaffold","slug":"config-zero-found-err","errorCode":"CONFIG_ZERO_FOUND_ERR","errorMessage":"failed to get any valid configs from file %q","messagePattern":"failed to get any valid configs from file %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/errors/errors.go","lineNumber":85,"sourceCode":"func BadConfigFilterErr(filter []string) error {\n\tmsg := fmt.Sprintf(\"did not find any configs matching selection %v\", filter)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_CONFIG_BAD_FILTER_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CONFIG_CHECK_FILTER,\n\t\t\t\t\tAction:         \"Check that the arguments to the `-m` or `--module` flag are valid config names\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n\n// ZeroConfigsParsedErr specifies that the config file is empty\nfunc ZeroConfigsParsedErr(file string) error {\n\tmsg := fmt.Sprintf(\"failed to get any valid configs from file %q\", file)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_CONFIG_ZERO_FOUND_ERR,\n\t\t})\n}\n\n// DuplicateConfigNamesInSameFileErr specifies that multiple configs have the same name in current config file\nfunc DuplicateConfigNamesInSameFileErr(config, file string) error {\n\tmsg := fmt.Sprintf(\"multiple skaffold configs named %q found in file %q\", config, file)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_CONFIG_DUPLICATE_NAMES_SAME_FILE_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CONFIG_CHANGE_NAMES,\n\t\t\t\t\tAction:         fmt.Sprintf(\"Change the name of one of the occurrences of config %q in file %q to make it unique\", config, file),\n\t\t\t\t},","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/errors/errors.go#L67-L103","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Restore a valid skaffold.yaml (run `skaffold init` to generate one).","Verify the file passed via `--filename`/config path is actually a skaffold config with a top-level `apiVersion` and `kind: Config`.","Check git status / restore the file if it was truncated."],"exampleFix":"// before (empty skaffold.yaml)\n# nothing here\n// after\napiVersion: skaffold/v4beta7\nkind: Config\nbuild:\n  artifacts:\n    - image: my-app","handlingStrategy":"validation","validationCode":"test -s skaffold.yaml || { echo 'skaffold.yaml is empty'; exit 1; }\ngrep -q 'kind: Config' skaffold.yaml || { echo 'no skaffold Config found'; exit 1; }","typeGuard":null,"tryCatchPattern":"if err := cfgParsers.Parse(...); err != nil {\n    var sErr *sErrors.Error\n    if errors.As(err, &sErr) && sErr.ErrCode == proto.StatusCode_CONFIG_ZERO_FOUND_ERR {\n        return fmt.Errorf(\"%w (file exists but has no skaffold configs; was it truncated?)\", err)\n    }\n    return err\n}","preventionTips":["Never commit an empty skaffold.yaml; generate it with `skaffold init`.","Watch for bad merges that reduce the file to comments only.","Validate the file with `skaffold config list` before relying on it in CI."],"tags":["config","yaml","empty-file"],"backgroundTag":"empty-config-file","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}