{"record":{"id":"1141ae216a7709af","repo":"moonD4rk/HackBrowserData","slug":"no-vault-for-browser-q-in-keys-have-s","errorCode":null,"errorMessage":"no vault for browser %q in keys (have: %s)","messagePattern":"no vault for browser %q in keys \\(have: (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"browser/keydump.go","lineNumber":82,"sourceCode":"//\n// Data layout is resolved two ways. When dataDir holds per-key subdirs (the archive layout), each\n// vault is rooted at dataDir/<key>. Otherwise dataDir is treated as one browser's User Data (a\n// hand-copied folder), which is unambiguous only for a single vault — so filter must pick one.\nfunc BuildFromDump(dump masterkey.Dump, dataDir, filter string) ([]Browser, error) {\n\tfilter = strings.ToLower(filter)\n\tif filter == \"all\" {\n\t\tfilter = \"\"\n\t}\n\n\tvar selected []masterkey.Vault\n\tfor _, v := range dump.Vaults {\n\t\tif filter != \"\" && !strings.EqualFold(v.Browser, filter) {\n\t\t\tcontinue\n\t\t}\n\t\tselected = append(selected, v)\n\t}\n\tif filter != \"\" && len(selected) == 0 {\n\t\treturn nil, fmt.Errorf(\"no vault for browser %q in keys (have: %s)\", filter, vaultKeys(dump))\n\t}\n\n\tif !dirExists(dataDir) {\n\t\treturn nil, fmt.Errorf(\"data dir %q does not exist\", dataDir)\n\t}\n\n\tarchiveLayout := isArchiveLayout(dataDir, selected)\n\tif !archiveLayout && len(selected) > 1 {\n\t\treturn nil, fmt.Errorf(\"--data-dir %q has no per-browser subdir but keys has %d browsers; \"+\n\t\t\t\"point it at the archive root, or use -b <browser> for one browser's User Data (have: %s)\",\n\t\t\tdataDir, len(selected), vaultKeys(dump))\n\t}\n\n\tvar browsers []Browser\n\tfor _, v := range selected {\n\t\troot := dataDir\n\t\tif archiveLayout {\n\t\t\troot = filepath.Join(dataDir, strings.ToLower(v.Browser))","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/moonD4rk/HackBrowserData/blob/0503d04d7a8d0379d060268a74f1b149e5a0aad5/browser/keydump.go#L64-L100","documentation":"BuildFromDump restores browser instances from a previously exported master-key dump, selecting the vault whose Browser field matches the requested filter. When a filter is given but no vault in the dump matches (case-insensitively), the function fails and lists which vaults are available to help correct the name. The dump's vault names are the authoritative set.","triggerScenarios":"Calling BuildFromDump(dump, dataDir, filter) with a non-empty filter whose value matches no vault's Browser field in the keys dump — e.g. \"chrome\" when the dump only holds \"firefox\" or \"brave\" vaults.","commonSituations":"Typo or different casing/naming in the filter (\"Chrome\" vs \"chromium\"), filtering a dump produced on another machine with different browsers, or a dump missing the target browser because its keys were never extracted.","solutions":["Use one of the names listed in the error's (have: ...) set as the filter value.","Pass an empty filter \"\" to process all vaults in the dump instead of a specific browser.","Regenerate the keys dump so it includes the target browser's vault.","Match the dump's exact vault name (check spelling/spacing) when filtering."],"exampleFix":"// before: name not present in dump\nbrowser.BuildFromDump(dump, dataDir, \"chrome\")\n// after: use a vault name actually in the dump\nbrowser.BuildFromDump(dump, dataDir, \"brave\")","handlingStrategy":"validation","validationCode":"names := make([]string, 0, len(dump))\nfor k := range dump { names = append(names, k) }\nif filter != \"\" && !slices.Contains(names, strings.ToLower(filter)) {\n    return fmt.Errorf(\"filter %q not in dump vaults %v\", filter, names)\n}","typeGuard":null,"tryCatchPattern":"browsers, err := browser.BuildFromDump(dump, dataDir, \"brave\")\nif err != nil && strings.HasPrefix(err.Error(), \"no vault for browser\") {\n    // retry with empty filter or a listed vault name\n    browsers, err = browser.BuildFromDump(dump, dataDir, \"\")\n}","preventionTips":["Inspect the dump's vault names before choosing a filter.","Use an empty filter to process every vault.","Match casing/spacing of vault names exactly (comparison is case-insensitive but not fuzzy).","Regenerate dumps on the target machine so all browsers are present."],"tags":["browser","keydump","filter","not-found","restore"],"backgroundTag":"record-not-found","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"}