GoogleContainerTools/skaffold · error
couldn't find profile %s
Error message
couldn't find profile %s
What it means
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>`.
Source
Thrown at pkg/skaffold/schema/profiles.go:54
skutil "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util/stringslice"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/yaml"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/yamltags"
)
// ApplyProfiles modifies the input skaffold configuration by the application
// of a list of profiles, and returns the list of applied profiles.
func ApplyProfiles(c *latest.SkaffoldConfig, fieldsOverrodeByProfile map[string]configlocations.YAMLOverrideInfo, opts cfg.SkaffoldOptions, namedProfiles []string) ([]string, map[string]configlocations.YAMLOverrideInfo, error) {
byName := profilesByName(c.Profiles)
profiles, contextSpecificProfiles, err := activatedProfiles(c.Profiles, opts, namedProfiles)
if err != nil {
return nil, nil, fmt.Errorf("finding auto-activated profiles: %w", err)
}
for _, name := range profiles {
profile, present := byName[name]
if !present {
return nil, nil, fmt.Errorf("couldn't find profile %s", name)
}
if err := applyProfile(c, fieldsOverrodeByProfile, profile); err != nil {
return nil, nil, fmt.Errorf("applying profile %q: %w", name, err)
}
}
// remove profiles section for run modes where profiles are already merged into the main pipeline
switch opts.Mode() {
case cfg.RunModes.Build, cfg.RunModes.Dev, cfg.RunModes.Deploy, cfg.RunModes.Debug, cfg.RunModes.Render, cfg.RunModes.Run, cfg.RunModes.Diagnose, cfg.RunModes.Delete:
c.Profiles = nil
}
return profiles, fieldsOverrodeByProfile, checkKubeContextConsistency(contextSpecificProfiles, opts.KubeContext, c.Deploy.KubeContext)
}
func checkKubeContextConsistency(contextSpecificProfiles []string, cliContext, effectiveContext string) error {
// cli flag takes precedence
if cliContext != "" {View on GitHub (pinned to a1189de023)
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
Example fix
# before skaffold dev -p prodcta # after skaffold dev -p prod
Defensive patterns
Strategy: validation
Validate before calling
func requireProfiles(cfg *latest.SkaffoldConfig, wanted []string) error {
have := map[string]bool{}
for _, p := range cfg.Profiles { have[p.Name] = true }
for _, w := range wanted {
if !have[strings.TrimPrefix(w, "-")] {
return fmt.Errorf("profile %q not defined in skaffold.yaml", w)
}
}
return nil
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- getting run context: %w
- finding auto-activated profiles: %w
- applying profile %q: %w
- value must be one of `always`, `missing`, or `never`
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/dfac38ab0eefdbbf.
Report an issue: GitHub.