{"record":{"id":"6cfd062fb88e26de","repo":"kubernetes/kops","slug":"found-multiple-matching-assets-for-expr-q","errorCode":null,"errorMessage":"found multiple matching assets for expr: %q","messagePattern":"found multiple matching assets for expr: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/assetstore.go","lineNumber":136,"sourceCode":"}\n\nfunc (a *AssetStore) FindMatch(expr *regexp.Regexp) (name string, res Resource, err error) {\n\tmatches := a.FindMatches(expr)\n\n\tswitch len(matches) {\n\tcase 0:\n\t\treturn \"\", nil, fmt.Errorf(\"found no matching assets for expr: %q\", expr.String())\n\tcase 1:\n\t\tvar n string\n\t\tvar r Resource\n\t\tfor k, v := range matches {\n\t\t\tklog.Infof(\"Found single matching asset for expr %q: %q\", expr.String(), k)\n\t\t\tn = k\n\t\t\tr = v\n\t\t}\n\t\treturn n, r, nil\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"found multiple matching assets for expr: %q\", expr.String())\n\t}\n}\n\nfunc (a *AssetStore) Find(key string, assetPath string) (Resource, error) {\n\tvar matches []*asset\n\tfor _, asset := range a.assets {\n\t\tif asset.Key != key {\n\t\t\tcontinue\n\t\t}\n\n\t\tif assetPath != \"\" {\n\t\t\tif !strings.HasSuffix(asset.AssetPath, assetPath) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tmatches = append(matches, asset)\n\t}","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/assetstore.go#L118-L154","documentation":"FindMatch's regexp matched more than one registered asset, so the requested asset cannot be uniquely resolved; the store contains colliding asset paths.","triggerScenarios":"Thrown at upup/pkg/fi/assetstore.go:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Tighten the asset expression to disambiguate between the matching assets","Remove or rename the duplicate asset paths in the bundled assets"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}