moonD4rk/HackBrowserData · error

data dir %q does not exist

Error message

data dir %q does not exist

What it means

BuildFromDump rejects the caller-supplied data directory because dirExists() reported it missing on disk. The keys dump may be valid, but extraction needs the browser profile files under dataDir, so the function aborts before inspecting archive layout. It fires when the -d/--data-dir path is typo'd, points to an unmounted volume, or names a directory that was deleted after the keys were captured.

Source

Thrown at browser/keydump.go:86

func BuildFromDump(dump masterkey.Dump, dataDir, filter string) ([]Browser, error) {
	filter = strings.ToLower(filter)
	if filter == "all" {
		filter = ""
	}

	var selected []masterkey.Vault
	for _, v := range dump.Vaults {
		if filter != "" && !strings.EqualFold(v.Browser, filter) {
			continue
		}
		selected = append(selected, v)
	}
	if filter != "" && len(selected) == 0 {
		return nil, fmt.Errorf("no vault for browser %q in keys (have: %s)", filter, vaultKeys(dump))
	}

	if !dirExists(dataDir) {
		return nil, fmt.Errorf("data dir %q does not exist", dataDir)
	}

	archiveLayout := isArchiveLayout(dataDir, selected)
	if !archiveLayout && len(selected) > 1 {
		return nil, fmt.Errorf("--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)",
			dataDir, len(selected), vaultKeys(dump))
	}

	var browsers []Browser
	for _, v := range selected {
		root := dataDir
		if archiveLayout {
			root = filepath.Join(dataDir, strings.ToLower(v.Browser))
			if !dirExists(root) {
				log.Warnf("restore: %s has no data under %s, skipping", v.Browser, root)
				continue
			}

View on GitHub (pinned to 0503d04d7a)

Solutions

  1. Verify the path exists and is spelled correctly: ls <data-dir>
  2. Re-mount the volume or re-attach the drive holding the browser data if it was moved
  3. Point --data-dir at the archive root containing per-browser subdirectories rather than a nonexistent child
  4. Re-copy the data directory from the source machine if it was never transferred
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at browser/keydump.go:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of moonD4rk/HackBrowserData@0503d04d7a (2026-09-06). Data as JSON: /api/errors/dc543526f4448c19. Report an issue: GitHub.