{"record":{"id":"5b64577dc87a6abf","repo":"owasp-amass/amass","slug":"file-does-not-exist-v","errorCode":null,"errorMessage":"file does not exist: %v","messagePattern":"file does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":314,"sourceCode":"\t\tc.loadRigidSettings,\n\t}\n\tfor _, load := range loads {\n\t\tif err := load(c); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// AbsPathFromConfigDir Creates a file path that is relative the the configuration file location.\n// If the path is already absolute, return it as is.\nfunc (c *Config) AbsPathFromConfigDir(path string) (string, error) {\n\t// If the path is already absolute, return it as is\n\tif filepath.IsAbs(path) {\n\t\t// Check if the file exists\n\t\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\t\treturn \"\", fmt.Errorf(\"file does not exist: %v\", err)\n\t\t}\n\n\t\treturn path, nil\n\t}\n\t// Get the directory of the current config file\n\tcfgDir := filepath.Dir(c.Filepath)\n\t// Clean the incoming path to ensure it doesn't have any problematic elements\n\tcleanPath := filepath.Clean(path)\n\t// Construct the absolute path by joining the config directory and the relative path\n\tabsPath := filepath.Join(cfgDir, cleanPath)\n\t// Check if the file exists\n\tif _, err := os.Stat(absPath); os.IsNotExist(err) {\n\t\treturn \"\", fmt.Errorf(\"file does not exist: %v\", err)\n\t}\n\treturn absPath, nil\n}\nfunc (s *Scope) toCIDRs(strings []string) []*net.IPNet {\n\tcidrs := make([]*net.IPNet, len(strings))","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/config.go#L296-L332","documentation":"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.","triggerScenarios":"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\"].","commonSituations":"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.","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."],"exampleFix":"// before (config.yaml)\nwordlists:\n  file: \"/usr/share/wordlists/seclists/removed.txt\"\n// after\nwordlists:\n  file: \"/usr/share/wordlists/seclists/dns.txt\"  # must exist on disk","handlingStrategy":"validation","validationCode":"for _, p := range absPaths {\n    if _, err := os.Stat(p); os.IsNotExist(err) {\n        return fmt.Errorf(\"configured file missing: %s\", p)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil {\n    if strings.Contains(err.Error(), \"file does not exist\") {\n        // install/copy the missing file or edit the config path\n    }\n    return err\n}","preventionTips":["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"],"tags":["config","file-not-found","filesystem","path-resolution"],"backgroundTag":"file-not-found","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}