owasp-amass/amass · error

file does not exist: %v

Error message

file does not exist: %v

What it means

Config.AbsPathFromConfigDir resolves a path from the config: if the given path is already absolute, it verifies existence with os.Stat and returns 'file does not exist' when the stat reports IsNotExist. This guards absolute wordlist/datasource/resolver paths supplied in the config so downstream loaders never see a missing file.

Source

Thrown at config/config.go:314

		c.loadRigidSettings,
	}
	for _, load := range loads {
		if err := load(c); err != nil {
			return err
		}
	}

	return nil
}

// AbsPathFromConfigDir Creates a file path that is relative the the configuration file location.
// If the path is already absolute, return it as is.
func (c *Config) AbsPathFromConfigDir(path string) (string, error) {
	// If the path is already absolute, return it as is
	if filepath.IsAbs(path) {
		// Check if the file exists
		if _, err := os.Stat(path); os.IsNotExist(err) {
			return "", fmt.Errorf("file does not exist: %v", err)
		}

		return path, nil
	}
	// Get the directory of the current config file
	cfgDir := filepath.Dir(c.Filepath)
	// Clean the incoming path to ensure it doesn't have any problematic elements
	cleanPath := filepath.Clean(path)
	// Construct the absolute path by joining the config directory and the relative path
	absPath := filepath.Join(cfgDir, cleanPath)
	// Check if the file exists
	if _, err := os.Stat(absPath); os.IsNotExist(err) {
		return "", fmt.Errorf("file does not exist: %v", err)
	}
	return absPath, nil
}
func (s *Scope) toCIDRs(strings []string) []*net.IPNet {
	cidrs := make([]*net.IPNet, len(strings))

View on GitHub (pinned to 79299dce87)

Solutions

  1. Confirm the absolute path exists: `ls -l /abs/path` and correct the config if it does not.
  2. Install the missing wordlist/package (e.g. wordlists package or curl the file into place).
  3. Update the config to point at a wordlist that exists on this machine.
  4. Mount or copy the file into containers at the referenced path.

Example fix

// before (config.yaml)
wordlists:
  file: "/usr/share/wordlists/seclists/removed.txt"
// after
wordlists:
  file: "/usr/share/wordlists/seclists/dns.txt"  # must exist on disk
Defensive patterns

Strategy: validation

Validate before calling

for _, p := range absPaths {
    if _, err := os.Stat(p); os.IsNotExist(err) {
        return fmt.Errorf("configured file missing: %s", p)
    }
}

Try / catch

if err := cfg.LoadSettings(path); err != nil {
    if strings.Contains(err.Error(), "file does not exist") {
        // install/copy the missing file or edit the config path
    }
    return err
}

Prevention

When it happens

Trigger: Any config setting that routes through AbsPathFromConfigDir (brute-force wordlists, alterations wordlist_file, datasources, resolvers) given an absolute path that does not exist on disk, e.g. wordlist_file: ["/usr/share/wordlists/removed.txt"].

Common situations: Configs copied between machines where the referenced wordlist was never installed; files deleted after installation; Kali/wordlist packages not installed; container images stripped of wordlists.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/5b64577dc87a6abf. Report an issue: GitHub.