{"record":{"id":"859ef7b7bf23e3dc","repo":"GoogleContainerTools/skaffold","slug":"inspect-profile-not-found-err","errorCode":"INSPECT_PROFILE_NOT_FOUND_ERR","errorMessage":"trying to modify a profile %q that doesn't exist","messagePattern":"trying to modify a profile %q that doesn't exist","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/inspect/errors.go","lineNumber":72,"sourceCode":"\t\tmsg = fmt.Sprintf(\"trying to modify a %q build environment definition that doesn't exist, in profile %q in file %s\", b, profile, filename)\n\t}\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_INSPECT_BUILD_ENV_INCORRECT_TYPE_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_INSPECT_USE_ADD_BUILD_ENV,\n\t\t\t\t\tAction:         \"Check that the target build environment definition already exists. Otherwise use the `add` command instead of the `modify` command to create it\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n\n// ProfileNotFound specifies that the target profile doesn't exist\nfunc ProfileNotFound(profile string) error {\n\tmsg := fmt.Sprintf(\"trying to modify a profile %q that doesn't exist\", profile)\n\treturn sErrors.NewError(errors.New(msg),\n\t\t&proto.ActionableErr{\n\t\t\tMessage: msg,\n\t\t\tErrCode: proto.StatusCode_INSPECT_PROFILE_NOT_FOUND_ERR,\n\t\t\tSuggestions: []*proto.Suggestion{\n\t\t\t\t{\n\t\t\t\t\tSuggestionCode: proto.SuggestionCode_INSPECT_CHECK_INPUT_PROFILE,\n\t\t\t\t\tAction:         \"Check that the `--profile` flag matches at least one existing profile. Otherwise use the `add` command instead of the `modify` command to create it\",\n\t\t\t\t},\n\t\t\t},\n\t\t})\n}\n","sourceCodeStart":54,"sourceCodeEnd":84,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/inspect/errors.go#L54-L84","documentation":"Skaffold's inspect API throws this when an operation (e.g. modifying a Cloud Build environment via `skaffold inspect`) targets a named profile that is not defined in skaffold.yaml. ProfileNotFound builds an actionable error with code INSPECT_PROFILE_NOT_FOUND_ERR so CLI clients get a machine-readable message plus a suggestion to fix the input.","triggerScenarios":"Calling ModifyGcbBuildEnv (or other inspect mutation endpoints) with a --profile value that does not exist in the parsed skaffold.yaml.","commonSituations":"Typo in the profile name on the command line; profile defined only in an overlay/other file; renamed or deleted profile while CI scripts still reference the old name.","solutions":["Run `skaffold inspect profiles` (or read skaffold.yaml) to list valid profiles and correct the --profile value","Add the missing profile to skaffold.yaml under `profiles:` with the exact name referenced","Check for profile definitions in included/imported config files and merge them before invoking inspect commands"],"exampleFix":"// before\nskaffold inspect modify-cloudrun-build-env --profile prod-1\n// after\nskaffold inspect profiles  # confirm exact name, then\nskaffold inspect modify-cloudrun-build-env --profile prod","handlingStrategy":"validation","validationCode":"profiles, err := inspectProfiles(skaffoldConfig)\nif !slices.Contains(profiles, requestedProfile) {\n  return fmt.Errorf(\"profile %q not defined in skaffold.yaml; run `skaffold inspect profiles`\", requestedProfile)\n}","typeGuard":"func hasProfile(cfg *latest.SkaffoldConfig, name string) bool {\n  for _, p := range cfg.Profiles { if p.Name == name { return true } }\n  return false\n}","tryCatchPattern":"if err := modifyGcbBuildEnv(profile); err != nil {\n  var ae *proto.ActionableErr\n  if status.Code(err) == codes.Unknown && strings.Contains(err.Error(), profile) { /* handle profile-not-found */ }\n  return err\n}","preventionTips":["List profiles with `skaffold inspect profiles` before mutating","Keep profile names in CI variables synced with skaffold.yaml","Validate merged config when using required configs/overlays"],"tags":["skaffold","config","profile-not-found"],"backgroundTag":"profile-not-found","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"}