{"record":{"id":"3fc885b9afa7e285","repo":"GoogleContainerTools/skaffold","slug":"failed-to-create-v-action","errorCode":null,"errorMessage":"failed to create %v action","messagePattern":"failed to create (.+?) action","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/actions/runner.go","lineNumber":75,"sourceCode":"}\n\nfunc (r Runner) Exec(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact, aName string) error {\n\texecEnv, found := r.execEnvByAction[aName]\n\tif !found {\n\t\treturn fmt.Errorf(\"custom action %v not found\", aName)\n\t}\n\n\toutput.Default.Fprintln(out, fmt.Sprintf(\"Starting execution for %v\", aName))\n\tlog.Entry(ctx).Debugf(\"Starting execution for %v\", aName)\n\n\tacs, err := execEnv.PrepareActions(ctx, out, allbuilds, localImgs, []string{aName})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// We expect only one action to be created.\n\tif len(acs) != 1 {\n\t\treturn fmt.Errorf(\"failed to create %v action\", aName)\n\t}\n\n\ta := acs[0]\n\n\terr = a.Exec(ctx, out)\n\tlog.Entry(ctx).Debugf(\"Finished execution for %v\", a.name)\n\tr.cleanup(context.TODO(), out, []Task{a}, []ExecEnv{execEnv})\n\treturn err\n}\n\nfunc (r Runner) prepareAllActions(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact) ([]Task, error) {\n\tpreparedAcs := []Task{}\n\tfor _, execEnv := range r.orderedExecEnvs {\n\t\tacsNames := r.acsByExecEnv[execEnv]\n\t\tacs, err := execEnv.PrepareActions(ctx, out, allbuilds, localImgs, acsNames)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/actions/runner.go#L57-L93","documentation":"After PrepareActions runs, Exec expects exactly one Action to be created for the given name. If the count is zero (or unexpectedly more than one), it reports the action could not be created. This indicates the action's execEnv failed to materialize an Action instance despite the name being registered.","triggerScenarios":"execEnv.PrepareActions returns 0 actions for the requested name — e.g. the action exists in execEnvByAction but PrepareActions filters it out due to malformed action config (bad k8sjob spec, missing required fields) that doesn't surface as a normal error.","commonSituations":"Partially-valid skaffold.yaml where the action is registered but its build/run config can't be resolved (missing build artifact dependency, empty k8sjob manifest section); using `allbuilds`/localImgs that the action depends on but that were not built.","solutions":["Validate skaffold.yaml (skaffold fix / schema check) for the action's definition","Ensure required fields of the action (e.g. k8sjob container spec, manifest) are present","Build dependencies first so allbuilds/localImgs are populated before Exec","Run with --vdebug to see PrepareActions internal filtering"],"exampleFix":"// before\ncustomActions:\n  - name: test\n    k8sjob:\n      manifests: []\n// after\ncustomActions:\n  - name: test\n    k8sjob:\n      manifests:\n        - rawYaml: [job.yaml]","handlingStrategy":"validation","validationCode":"// validate the action's manifest before running\nkubectl apply --dry-run=client -f job.yaml || echo \"fix action manifest\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run skaffold fix / schema validation after editing skaffold.yaml","Ensure build dependencies of the action are built before Exec","Keep k8sjob manifest definitions complete (image, command, restartPolicy)"],"tags":["custom-action","configuration","prepare"],"backgroundTag":"action-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"}