{"record":{"id":"b1333f4d59dc5526","repo":"GoogleContainerTools/skaffold","slug":"config-unknown-api-version-err","errorCode":"CONFIG_UNKNOWN_API_VERSION_ERR","errorMessage":"unknown skaffold config API version %q","messagePattern":"unknown skaffold config API version %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/errors/errors.go","lineNumber":192,"sourceCode":"func ConfigProfileConflictErr(config, file string) error {\n\tmsg := fmt.Sprintf(\"config %q defined in file %q imported multiple times with different set of profiles\", 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_MULTI_IMPORT_PROFILE_CONFLICT_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CONFIG_CHECK_DEPENDENCY_PROFILES_SELECTION,\n\t\t\t\t\tAction:         \"Check that all occurrences of the specified config dependency use the same set of profiles; refer to the documentation on how to author config dependencies: https://skaffold.dev/docs/design/config/#configuration-dependencies\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n\n// ConfigUnknownAPIVersionErr specifies that the config API version doesn't match any known versions.\nfunc ConfigUnknownAPIVersionErr(version string) error {\n\tmsg := fmt.Sprintf(\"unknown skaffold config API version %q\", version)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_CONFIG_UNKNOWN_API_VERSION_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_CONFIG_FIX_API_VERSION,\n\t\t\t\t\tAction:         \"Set the config 'apiVersion' to a known value. Check https://skaffold.dev/docs/references/yaml/ for the list of valid API versions. Otherwise, check that your skaffold version is up-to-date\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n\n// SkaffoldConfigUpgradeErr specifies that skaffold config needs to be upgraded to the latest version.\nfunc SkaffoldConfigUpgradeErr(currentVersion, targetVersion string) error {\n\tmsg := fmt.Sprintf(\"skaffold cannot auto-upgrade the config from version %s to version %s\", currentVersion, targetVersion)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/errors/errors.go#L174-L210","documentation":"ConfigUnknownAPIVersionErr is thrown when the `apiVersion` in skaffold.yaml does not match any known skaffold schema version. Code CONFIG_UNKNOWN_API_VERSION_ERR, suggesting fixing the API version string.","triggerScenarios":"Parsing skaffold.yaml whose `apiVersion` field (e.g. `skaffold/v99`, a typo like `skaffold/v3`, or missing the `skaffold/` prefix) is not registered in the schema store.","commonSituations":"Hand-editing or AI-generating configs with an invented version; upgrading skaffold on CI where an old client doesn't know a newer schema version; copy-pasting configs between projects with different version lines.","solutions":["Set `apiVersion` to a valid version, e.g. the latest `skaffold/v4beta7` (or a released v3/v2 version).","Run `skaffold fix` to migrate the config to the latest schema automatically.","Upgrade or downgrade the skaffold binary to one that supports the version in the file."],"exampleFix":"// before\napiVersion: skaffold/v4beta12\nkind: Config\n// after (with an older skaffold binary)\napiVersion: skaffold/v4beta7\nkind: Config","handlingStrategy":"validation","validationCode":"ver=$(yq e '.apiVersion' skaffold.yaml)\nsupported=(skaffold/v1 skaffold/v1alpha* skaffold/v2* skaffold/v3* skaffold/v4*)\ncase \"$ver\" in skaffold/v[1-4]*) echo ok;; *) echo \"unknown apiVersion: $ver\"; exit 1;; esac","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var sErr *sErrors.Error\n    if errors.As(err, &sErr) && sErr.ErrCode == proto.StatusCode_CONFIG_UNKNOWN_API_VERSION_ERR {\n        return fmt.Errorf(\"%w — run `skaffold fix` or pin a supported apiVersion\", err)\n    }\n    return err\n}","preventionTips":["Never hand-edit apiVersion; use `skaffold fix` to migrate schemas.","Pin the skaffold binary version in CI to match the schema version in the repo.","Enable skaffold's schema validation in your editor (JSON schema) to catch invalid versions early."],"tags":["config","api-version","schema"],"backgroundTag":"unknown-api-version","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"}