GoogleContainerTools/skaffold · error
CONFIG_DUPLICATE_NAMES_ACROSS_FILES_ERR
CONFIG_DUPLICATE_NAMES_ACROSS_FILES_ERR
Error message
skaffold config named %q found in multiple files: %q and %q
What it means
DuplicateConfigNamesAcrossFilesErr fires when configs with the same `metadata.name` exist in two different files being loaded together, making name-based references (config dependencies) ambiguous. Code CONFIG_DUPLICATE_NAMES_ACROSS_FILES_ERR with suggestion CONFIG_CHANGE_NAMES.
Source
Thrown at pkg/skaffold/schema/errors/errors.go:111
func DuplicateConfigNamesInSameFileErr(config, file string) error {
msg := fmt.Sprintf("multiple skaffold configs named %q found in file %q", config, file)
return sErrors.NewError(errors.New(msg),
&proto.ActionableErr{
Message: msg,
ErrCode: proto.StatusCode_CONFIG_DUPLICATE_NAMES_SAME_FILE_ERR,
Suggestions: []*proto.Suggestion{
{
SuggestionCode: proto.SuggestionCode_CONFIG_CHANGE_NAMES,
Action: fmt.Sprintf("Change the name of one of the occurrences of config %q in file %q to make it unique", config, file),
},
},
})
}
// DuplicateConfigNamesAcrossFilesErr specifies that multiple configs have the same name in different files
func DuplicateConfigNamesAcrossFilesErr(config, file1, file2 string) error {
msg := fmt.Sprintf("skaffold config named %q found in multiple files: %q and %q", config, file1, file2)
return sErrors.NewError(errors.New(msg),
&proto.ActionableErr{
Message: msg,
ErrCode: proto.StatusCode_CONFIG_DUPLICATE_NAMES_ACROSS_FILES_ERR,
Suggestions: []*proto.Suggestion{
{
SuggestionCode: proto.SuggestionCode_CONFIG_CHANGE_NAMES,
Action: fmt.Sprintf("Change the name of config %q in file %q or file %q to make it unique", config, file1, file2),
},
},
})
}
// ConfigProfileActivationErr specifies that profile activation failed for this config
func ConfigProfileActivationErr(config, file string, err error) error {
return sErrors.NewError(err,
&proto.ActionableErr{
Message: fmt.Sprintf("failed to apply profiles to config %q defined in file %q: %v", config, file, err),
ErrCode: proto.StatusCode_CONFIG_APPLY_PROFILES_ERR,View on GitHub (pinned to a1189de023)
Solutions
- Rename the config in one of the files so names are globally unique across the loaded set.
- Remove the duplicate `-f` flag / import if one file was included by mistake.
- Namespace names per project, e.g. `teamA-api` vs `teamB-api`.
Example fix
// before: both skaffold.yaml and ../shared/skaffold.yaml contain metadata: name: api // after: rename in the shared file metadata: name: shared-api
Defensive patterns
Strategy: validation
Validate before calling
# across all loaded files: yq e '.metadata.name // ""' skaffold.yaml ../shared/skaffold.yaml | sort | uniq -d # empty output means no cross-file duplicate names
Prevention
- Namespace config names by team/repo (e.g. `teamA-api`) to avoid collisions in shared setups.
- Keep a registry of config names used across repos that are loaded together.
- Lint the union of all -f files for duplicate metadata.name in CI.
When it happens
Trigger: Loading multiple config files (e.g. via `-f` flags or config dependency imports) where two files each define a config named identically.
Common situations: Teams sharing a common skaffold config module where both repos coincidentally named their config `api` or `web`, then combining them with multiple `-f` flags.
Related errors
- CONFIG_DUPLICATE_NAMES_SAME_FILE_ERR
- bucket name is empty
- INSPECT_PROFILE_NOT_FOUND_ERR
- cannot resolve active Kubernetes context - multiple contexts
- CONFIG_BAD_FILTER_ERR
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/294c09f7a8399814.
Report an issue: GitHub.