GoogleContainerTools/skaffold · error
custom action %v not found
Error message
custom action %v not found
What it means
Runner.Exec looks up the execution environment for a custom action by name in execEnvByAction. If the requested action name is not defined in skaffold.yaml, it returns this error. It guards against invoking an action that was never registered.
Source
Thrown at pkg/skaffold/actions/runner.go:62
func NewRunner(execEnvByAction map[string]ExecEnv, orderedExecEnvs []ExecEnv, acsByExecEnv map[ExecEnv][]string) Runner {
return Runner{execEnvByAction, orderedExecEnvs, acsByExecEnv}
}
func (r Runner) ExecAll(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact) error {
acs, err := r.prepareAllActions(ctx, out, allbuilds, localImgs)
if err != nil {
return err
}
defer r.cleanup(ctx, out, acs, r.orderedExecEnvs)
return execWithFailingSafe(ctx, out, acs)
}
func (r Runner) Exec(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact, aName string) error {
execEnv, found := r.execEnvByAction[aName]
if !found {
return fmt.Errorf("custom action %v not found", aName)
}
output.Default.Fprintln(out, fmt.Sprintf("Starting execution for %v", aName))
log.Entry(ctx).Debugf("Starting execution for %v", aName)
acs, err := execEnv.PrepareActions(ctx, out, allbuilds, localImgs, []string{aName})
if err != nil {
return err
}
// We expect only one action to be created.
if len(acs) != 1 {
return fmt.Errorf("failed to create %v action", aName)
}
a := acs[0]
err = a.Exec(ctx, out)View on GitHub (pinned to a1189de023)
Solutions
- Check `skaffold config` / skaffold.yaml customActions entries for the exact action name
- Pass the profile that defines the action: --profile <name>
- Fix the typo in the action name in the command or calling script
Example fix
// before (skaffold.yaml has action 'db-migrate') skaffold custom-action run myaction // after skaffold custom-action run db-migrate
Defensive patterns
Strategy: validation
Validate before calling
const { execSync } = require('child_process');
const cfg = execSync('cat skaffold.yaml').toString();
if (!cfg.includes(`name: ${actionName}`)) {
throw new Error(`action ${actionName} not in skaffold.yaml; check profile flags`);
} Prevention
- Keep action names in one shared constants list used by CI scripts
- Always pass the same --profile flags used when defining actions
- Grep skaffold.yaml for the action name before invoking it
When it happens
Trigger: Calling skaffold custom-action (or Exec) with an action name that is not declared under customActions in skaffold.yaml, or the action is defined in a different profile that isn't activated.
Common situations: Typo in action name on the command line; action defined only behind a --profile flag that wasn't passed; renamed action in config but CI script still uses the old name.
Related errors
- failed to create %v action
- value must be one of `always`, `missing`, or `never`
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
- CONFIG_REMOTE_REPO_CACHE_NOT_FOUND_ERR
- INSPECT_BUILD_ENV_ALREADY_EXISTS_ERR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/0d24bac1181034f5.
Report an issue: GitHub.