{"record":{"id":"f33b17202158ea9f","repo":"moonD4rk/HackBrowserData","slug":"data-dir-q-has-no-per-browser-subdir-but-keys-h","errorCode":null,"errorMessage":"--data-dir %q has no per-browser subdir but keys has %d browsers; point it at the archive root, or use -b <browser> for one browser's User Data (have: %s)","messagePattern":"--data-dir %q has no per-browser subdir but keys has (.+?) browsers; point it at the archive root, or use -b <browser> for one browser's User Data \\(have: (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"browser/keydump.go","lineNumber":91,"sourceCode":"\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))\n\t\t\tif !dirExists(root) {\n\t\t\t\tlog.Warnf(\"restore: %s has no data under %s, skipping\", v.Browser, root)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tkind, err := kindFromDump(v.Kind)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"restore: %s: %v\", v.Browser, err)\n\t\t\tcontinue","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/moonD4rk/HackBrowserData/blob/0503d04d7a8d0379d060268a74f1b149e5a0aad5/browser/keydump.go#L73-L109","documentation":"BuildFromDump's layout probe (isArchiveLayout) determined the data dir has no per-browser subdirectories, yet the filtered keys dump carries more than one browser vault, so there is no unambiguous way to bind each key set to a profile directory. This is an ambiguity guard: single-vault data dirs are fine raw, but multi-vault requires the conventional archive layout (e.g. a User Data root with per-browser subdirs) or an explicit -b filter to narrow to exactly one browser.","triggerScenarios":"Thrown at browser/keydump.go:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add -b <browser> to select the single browser whose User Data the dir directly contains","Repoint --data-dir at the archive root that contains one subdirectory per browser so vaults can be matched by subdirectory","Restructure the copied tree into per-browser subdirectories matching the browsers listed in the keys dump","Regenerate the keys dump with only one browser if the others are irrelevant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}