{"record":{"id":"c727912bbec63f5b","repo":"rancher/rancher","slug":"failed-to-unmarshal-kubeconfig-w","errorCode":null,"errorMessage":"failed to unmarshal kubeconfig: %w","messagePattern":"failed to unmarshal kubeconfig: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/api/norman/customization/cred/store.go","lineNumber":98,"sourceCode":"\t}\n\n\treturn nil\n}\n\ntype Store struct {\n\ttypes.Store\n\tSecretLister     v1.SecretLister\n\tProvClusterCache provv1.ClusterCache\n\tTokenLister      v3.TokenLister\n}\n\ntype Set[E comparable] = map[E]struct{}\n\nfunc TokenNamesFromContent(content []byte, tokens Set[string]) error {\n\tvar kc store.KubeConfig\n\terr := yaml.Unmarshal(content, &kc)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to unmarshal kubeconfig: %w\", err)\n\t}\n\n\tfor _, user := range kc.Users {\n\t\tif !strings.HasPrefix(user.User.Token, \"kubeconfig-u-\") && !strings.HasPrefix(user.User.Token, \"kubeconfig-user-\") {\n\t\t\tcontinue\n\t\t}\n\t\ttokenName, _, found := strings.Cut(user.User.Token, \":\")\n\t\tif !found {\n\t\t\treturn errors.New(\"unable to get token name from content\")\n\t\t}\n\t\ttokens[tokenName] = struct{}{}\n\t}\n\n\treturn nil\n}\n\nfunc (s *Store) processHarvesterCloudCredential(data map[string]any) error {\n\tif hc, ok := data[\"harvestercredentialConfig\"].(map[string]any); ok && hc != nil {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/rancher/rancher/blob/932558d4e68565aff2d2f36e89ec4a391b06e7c5/pkg/api/norman/customization/cred/store.go#L80-L116","documentation":"Error \"failed to unmarshal kubeconfig: %w\" thrown in rancher/rancher.","triggerScenarios":"Thrown at pkg/api/norman/customization/cred/store.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"932558d4e68565aff2d2f36e89ec4a391b06e7c5","analyzedAt":"2026-08-16T04:37:02.125Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}