{"record":{"id":"dfac38ab0eefdbbf","repo":"GoogleContainerTools/skaffold","slug":"couldn-t-find-profile-s","errorCode":null,"errorMessage":"couldn't find profile %s","messagePattern":"couldn't find profile (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/profiles.go","lineNumber":54,"sourceCode":"\tskutil \"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util/stringslice\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/yaml\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/yamltags\"\n)\n\n// ApplyProfiles modifies the input skaffold configuration by the application\n// of a list of profiles, and returns the list of applied profiles.\nfunc ApplyProfiles(c *latest.SkaffoldConfig, fieldsOverrodeByProfile map[string]configlocations.YAMLOverrideInfo, opts cfg.SkaffoldOptions, namedProfiles []string) ([]string, map[string]configlocations.YAMLOverrideInfo, error) {\n\tbyName := profilesByName(c.Profiles)\n\n\tprofiles, contextSpecificProfiles, err := activatedProfiles(c.Profiles, opts, namedProfiles)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"finding auto-activated profiles: %w\", err)\n\t}\n\tfor _, name := range profiles {\n\t\tprofile, present := byName[name]\n\t\tif !present {\n\t\t\treturn nil, nil, fmt.Errorf(\"couldn't find profile %s\", name)\n\t\t}\n\n\t\tif err := applyProfile(c, fieldsOverrodeByProfile, profile); err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"applying profile %q: %w\", name, err)\n\t\t}\n\t}\n\n\t// remove profiles section for run modes where profiles are already merged into the main pipeline\n\tswitch opts.Mode() {\n\tcase cfg.RunModes.Build, cfg.RunModes.Dev, cfg.RunModes.Deploy, cfg.RunModes.Debug, cfg.RunModes.Render, cfg.RunModes.Run, cfg.RunModes.Diagnose, cfg.RunModes.Delete:\n\t\tc.Profiles = nil\n\t}\n\treturn profiles, fieldsOverrodeByProfile, checkKubeContextConsistency(contextSpecificProfiles, opts.KubeContext, c.Deploy.KubeContext)\n}\n\nfunc checkKubeContextConsistency(contextSpecificProfiles []string, cliContext, effectiveContext string) error {\n\t// cli flag takes precedence\n\tif cliContext != \"\" {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/profiles.go#L36-L72","documentation":"A profile name was activated but no profile with that name exists in the parsed skaffold configuration. ApplyProfiles builds a name->profile map and, when an activated profile (via CLI `-p`, auto-activation, or dependency chains) is missing from the map, it throws `couldn't find profile <name>`.","triggerScenarios":"Running `skaffold dev -p myprofile` (or render/build/deploy) where `myprofile` is not defined under `profiles:` in skaffold.yaml; a profile dependency (`requires: profiles`) referencing a nonexistent name; a typo in a `-p` flag value or in a cross-file profile reference.","commonSituations":"Typo in the `-p` flag; profile defined in a skaffold.yaml fragment not included in the current config; renaming a profile without updating dependents/CI scripts; multi-module setups where the profile exists only in another module.","solutions":["Check the exact profile name defined under `profiles:` in skaffold.yaml and correct the `-p` value","Run `skaffold config` / inspect skaffold.yaml to list available profile names","If the profile lives in another config fragment, use `--profile` with the right module context or include the fragment","Fix `requires: profiles` references in other profiles that point at the missing name"],"exampleFix":"# before\nskaffold dev -p prodcta\n# after\nskaffold dev -p prod","handlingStrategy":"validation","validationCode":"func requireProfiles(cfg *latest.SkaffoldConfig, wanted []string) error {\n    have := map[string]bool{}\n    for _, p := range cfg.Profiles { have[p.Name] = true }\n    for _, w := range wanted {\n        if !have[strings.TrimPrefix(w, \"-\")] {\n            return fmt.Errorf(\"profile %q not defined in skaffold.yaml\", w)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List profiles in skaffold.yaml before writing CI scripts that pass -p","Use a Makefile/alias that validates -p values against defined profiles","After renaming a profile, grep all `requires:` references and CI configs","Keep all profile definitions in included config fragments so they are always parsed"],"tags":["skaffold","profiles","configuration","missing-profile"],"backgroundTag":"missing-profile-definition","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"}