GoogleContainerTools/skaffold · error
found duplicate custom action
Error message
found duplicate custom action %s. Custom action names must be unique
What it means
Custom action names must be unique across all pipelines in the run context because Skaffold references actions by name (e.g. in execution modes and pipelines). validateCustomActionsNames collects customActions from every pipeline and errors when a name repeats.
Solutions
- Rename one of the duplicate custom actions to a unique name
- Remove the accidental duplicate action
- Prefix action names per module when combining multiple skaffold configs
Example fix
# before
customActions:
- name: migrate
containers: [{ name: db, image: migrate:1 }]
- name: migrate
containers: [{ name: db2, image: migrate:2 }]
# after
customActions:
- name: migrate-v1
containers: [{ name: db, image: migrate:1 }]
- name: migrate-v2
containers: [{ name: db2, image: migrate:2 }] Defensive patterns
Strategy: validation
Validate before calling
const names = configs.flatMap(c => (c.customActions ?? []).map(a => a.name));
const dupes = names.filter((n, i) => names.indexOf(n) !== i);
if (dupes.length) throw new Error(`duplicate custom actions: ${[...new Set(dupes)].join(', ')}`); Try / catch
try {
await skaffold.run(config);
} catch (e) {
if (/found duplicate custom action/.test(e.message)) {
console.error('Rename or remove the duplicated custom action');
} else throw e;
} Prevention
- Prefix custom action names per module/config (e.g. payments-migrate)
- Search all composed skaffold configs for the action name before adding it
- Keep a naming convention doc for custom actions in multi-module repos
When it happens
Trigger: Two customActions entries with the same `name:` across the pipelines of a run context, processed via ProcessWithRunContext.
Common situations: Copy-pasting a custom action without renaming it, or multi-config projects where each module defines an action with the same generic name like 'migrate-db'.
Related errors
- found duplicate container name
- found duplicate test name
- action not found for k8s execution mode
- action not found for local execution mode
- artifact cannot use inferred file sync when the ko.main…
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/34ba49c26753419a.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/skaffold/schema/validation/validation.go:745
}
return errs
}
// validateCustomActions
// - makes sure that each custom action name is unique
// - makes sure that each custom action container name is unique
func validateCustomActionsNames(runCtx *runcontext.RunContext) (errs []error) {
acs := []latest.Action{}
seenAcs := map[string]bool{}
seenConts := map[string]bool{}
for _, pipeline := range runCtx.GetPipelines() {
acs = append(acs, pipeline.CustomActions...)
}
for _, a := range acs {
if _, found := seenAcs[a.Name]; found {
errs = append(errs, fmt.Errorf("found duplicate custom action %s. Custom action names must be unique", a.Name))
}
for _, c := range a.Containers {
if _, found := seenConts[c.Name]; found {
errs = append(errs, fmt.Errorf("found duplicate container name %s in custom action. Container names must be unique", c.Name))
}
seenConts[c.Name] = true
}
seenAcs[a.Name] = true
}
return
}
// validateCustomActionsLists
// - makes sure that each custom action has one or more containers
func validateCustomActionsLists(runCtx *runcontext.RunContext) (errs []error) {View on GitHub (pinned to a1189de023)