{"record":{"id":"86fc01cddad8270d","repo":"owasp-amass/amass","slug":"failed-to-parse-the-s-file-v","errorCode":null,"errorMessage":"failed to parse the %s file: %v","messagePattern":"failed to parse the (.+?) file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/enum/files.go","lineNumber":24,"sourceCode":"\nimport (\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"github.com/caffix/stringset\"\n\t\"github.com/owasp-amass/amass/v5/config\"\n\t\"github.com/owasp-amass/amass/v5/internal/tools\"\n\t\"github.com/owasp-amass/amass/v5/resources\"\n)\n\n// Obtain parameters from provided input files\nfunc processInputFiles(args *Args) error {\n\tgetList := func(fp []string, name string, s *stringset.Set) error {\n\t\tfor _, p := range fp {\n\t\t\tif p != \"\" {\n\t\t\t\tlist, err := config.GetListFromFile(p)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to parse the %s file: %v\", name, err)\n\t\t\t\t}\n\t\t\t\ts.InsertMany(list...)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tif args.Options.BruteForcing {\n\t\tif len(args.Filepaths.BruteWordlist) > 0 {\n\t\t\tif err := getList(args.Filepaths.BruteWordlist, \"brute force wordlist\", args.BruteWordList); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif f, err := resources.GetResourceFile(\"namelist.txt\"); err == nil {\n\t\t\t\tif list, err := config.GetWordList(f); err == nil {\n\t\t\t\t\targs.BruteWordList.InsertMany(list...)\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/internal/enum/files.go#L6-L42","documentation":"processInputFiles loads list files (wordlists, blacklists, etc.) given via flags into string sets using config.GetListFromFile. When reading or parsing one of those files fails, the underlying error is wrapped as \"failed to parse the <name> file: <v>\" and input processing aborts, so enumeration cannot start with the given file inputs.","triggerScenarios":"Calling processInputFiles with a file path that does not exist, is a directory rather than a file, has no read permission, or contains content GetListFromFile cannot parse.","commonSituations":"Relative wordlist paths that break after changing working directory, missing data files in container images, unreadable files in CI sandboxes, typo'd flag values.","solutions":["Verify the path exists and is readable: `test -r <path>` or `ls -l <path>`.","Use an absolute path to avoid working-directory surprises.","Ensure the file is a plain text list (one entry per line), not a directory or binary.","Fix read permissions (e.g. chmod +r) if running in restricted environments."],"exampleFix":"// before\n-enumeration-words ./wordlists/all.txt   // missing after cwd change\n// after\n-enumeration-words /opt/amass/wordlists/all.txt","handlingStrategy":"validation","validationCode":"func fileReadable(path string) error {\n\tfi, err := os.Stat(path)\n\tif err != nil { return fmt.Errorf(\"cannot stat %s: %w\", path, err) }\n\tif fi.IsDir() { return fmt.Errorf(\"%s is a directory, not a file\", path) }\n\tf, err := os.Open(path)\n\tif err != nil { return fmt.Errorf(\"cannot read %s: %w\", path, err) }\n\treturn f.Close()\n}","typeGuard":null,"tryCatchPattern":"// Go\ncloser, err := os.Open(p)\nif err != nil {\n\tlog.Printf(\"skipping unreadable list file %s: %v\", p, err)\n\treturn err\n}\ncloser.Close()","preventionTips":["Always pass absolute paths for list files.","Add a preflight existence/readability check in scripts before running the tool.","Ensure list files are present in container images and CI workspaces.","Keep list files plain text, one entry per line."],"tags":["file-io","config","input-files"],"backgroundTag":"file-read-failed","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"}