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
- Confirm the absolute path exists: `ls -l /abs/path` and correct the config if it does not.
- Install the missing wordlist/package (e.g. wordlists package or curl the file into place).
- Update the config to point at a wordlist that exists on this machine.
- 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
- Install required wordlists on every host before deploying configs
- Prefer paths verified at image-build time in containers
- Keep a manifest of files referenced by configs and check it at startup
- Avoid referencing machine-specific absolute paths in shared configs
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
- failed to get absolute path of the configuration file: %v
- failed to obtain the Amass output directory
- unable to load the file in the alterations wordlist_file set
- failed to load the main configuration file: %v
- no resolver keys were found in the resolvers section
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/5b64577dc87a6abf.
Report an issue: GitHub.