{"record":{"id":"4334b841b6f44310","repo":"kubernetes/kops","slug":"found-multiple-matching-assets-for-key-q","errorCode":null,"errorMessage":"found multiple matching assets for key: %q","messagePattern":"found multiple matching assets for key: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/assetstore.go","lineNumber":168,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\tmatches = append(matches, asset)\n\t}\n\n\tif len(matches) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(matches) == 1 {\n\t\tklog.Infof(\"Resolved asset %s:%s to %s\", key, assetPath, matches[0].AssetPath)\n\t\treturn &assetResource{Asset: matches[0]}, nil\n\t}\n\n\tklog.Infof(\"Matching assets:\")\n\tfor _, match := range matches {\n\t\tklog.Infof(\"    %s %s\", match.Key, match.AssetPath)\n\t}\n\treturn nil, fmt.Errorf(\"found multiple matching assets for key: %q\", key)\n}\n\n// Add an asset into the store, in one of the recognized formats (see Assets in types package)\nfunc (a *AssetStore) AddForTest(id string, path string, content string) {\n\ta.assets = append(a.assets, &asset{\n\t\tKey:       id,\n\t\tAssetPath: path,\n\t\tresource:  NewStringResource(content),\n\t})\n}\n\nfunc hashFromHTTPHeader(url string) (*hashing.Hash, error) {\n\tklog.Infof(\"Doing HTTP HEAD on %q\", url)\n\tresponse, err := http.Head(url)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error doing HEAD on %q: %v\", url, err)\n\t}\n\tdefer response.Body.Close()","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/assetstore.go#L150-L186","documentation":"AssetStore.Find resolved the key to more than one asset (multiple asset paths matched the key/assetPath pair); the store expects a unique resolution and refuses to pick arbitrarily.","triggerScenarios":"Thrown at upup/pkg/fi/assetstore.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a more specific assetPath so only one asset matches","Eliminate duplicate asset entries for the same key"],"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"}