{"record":{"id":"b6e70bbd92d61dc0","repo":"moonD4rk/HackBrowserData","slug":"all-retrievers-failed-w","errorCode":null,"errorMessage":"all retrievers failed: %w","messagePattern":"all retrievers failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"masterkey/retriever.go","lineNumber":48,"sourceCode":"}\n\nfunc NewChain(retrievers ...Retriever) Retriever {\n\treturn &ChainRetriever{retrievers: retrievers}\n}\n\nfunc (c *ChainRetriever) RetrieveKey(hints Hints) ([]byte, error) {\n\tvar errs []error\n\tfor _, r := range c.retrievers {\n\t\tkey, err := r.RetrieveKey(hints)\n\t\tif err == nil && len(key) > 0 {\n\t\t\treturn key, nil\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"retriever %T failed: %v\", r, err)\n\t\t\terrs = append(errs, fmt.Errorf(\"%T: %w\", r, err))\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"all retrievers failed: %w\", errors.Join(errs...))\n}\n","sourceCodeStart":30,"sourceCodeEnd":50,"githubUrl":"https://github.com/moonD4rk/HackBrowserData/blob/0503d04d7a8d0379d060268a74f1b149e5a0aad5/masterkey/retriever.go#L30-L50","documentation":"The aggregate failure returned when every retriever in the chain failed to produce a non-empty key. It wraps the errors.Join of all per-retriever errors, so the full failure list is available via errors.Unwrap/As. This is the terminal error of the multi-retriever RetrieveKey.","triggerScenarios":"Calling RetrieveKey when all configured retrievers either return an error or an empty key slice; errs is non-empty and no earlier retriever succeeded.","commonSituations":"Running on a machine without the target browser's key material, wrong keychain password on macOS, missing credentials on Windows/Linux, or all retrievers misconfigured.","solutions":["Unwrap the joined errors (errors.Unwrap returns []error) and fix each underlying cause","Verify at least one retriever is valid for the current OS/browser and correctly configured","Confirm the key source exists (keychain unlocked, key file present, credentials set)","Add a working retriever for the environment or skip key extraction gracefully"],"exampleFix":"// before\nkey, err := retriever.RetrieveKey(hints)\nif err != nil { return nil, err }\n// after\nkey, err := retriever.RetrieveKey(hints)\nif err != nil {\n\tif joined, ok := err.(interface{ Unwrap() []error }); ok {\n\t\tfor _, e := range joined.Unwrap() {\n\t\t\tlog.Printf(\"cause: %v\", e)\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"no master key available: %w\", err)\n}","handlingStrategy":"fallback","validationCode":"if !keychainAvailable() && !credentialsSet() {\n\treturn errors.New(\"no key source available on this machine\")\n}","typeGuard":"func allRetrieversFailed(err error) bool {\n\treturn err != nil && strings.HasPrefix(err.Error(), \"all retrievers failed\")\n}","tryCatchPattern":"key, err := multiRetriever.RetrieveKey(hints)\nif err != nil {\n\tvar joined interface{ Unwrap() []error }\n\tif errors.As(err, &joined) {\n\t\tfor _, cause := range joined.Unwrap() {\n\t\t\tlog.Printf(\"all-retrievers cause: %v\", cause)\n\t\t}\n\t}\n}","preventionTips":["Verify the browser key source exists before attempting extraction","Keep at least one OS-appropriate retriever in the chain","Degrade gracefully: skip key extraction when all retrievers fail"],"tags":["go","error-wrapping","retriever-chain","key-extraction"],"backgroundTag":"api-request-failed","analyzedSha":"0503d04d7a8d0379d060268a74f1b149e5a0aad5","analyzedAt":"2026-09-06T13:38:28.707Z","contentChangedAt":"2026-09-06T13:38:28.707Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}