{"record":{"id":"ae2f307bc18cd6d2","repo":"owasp-amass/amass","slug":"failed-to-load-resolvers-from-file-w","errorCode":null,"errorMessage":"failed to load resolvers from file: %w","messagePattern":"failed to load resolvers from file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/resolvers.go","lineNumber":199,"sourceCode":"\t\t\treturn fmt.Errorf(\"resolver entry %v is not a string\", r)\n\t\t}\n\n\t\t// Check if rStr is an IP address.\n\t\tip := net.ParseIP(rStr)\n\t\tif ip != nil {\n\t\t\tresolversList = append(resolversList, rStr)\n\t\t\tcontinue\n\t\t}\n\n\t\t// rStr is not an IP address, so we assume it is a file path.\n\t\tabsPath, err := c.AbsPathFromConfigDir(rStr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get absolute path for resolver file: %w\", err)\n\t\t}\n\n\t\tfileResolvers, err := c.loadResolversFromFile(absPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load resolvers from file: %w\", err)\n\t\t}\n\n\t\tresolversList = append(resolversList, fileResolvers...)\n\n\t}\n\n\t// Deduplicate the list of resolvers and assign to c.Resolvers.\n\tresolverIPs := stringset.Deduplicate(resolversList)\n\n\tif len(resolverIPs) == 0 {\n\t\treturn errors.New(\"no valid resolvers were found\")\n\t}\n\n\tc.Resolvers = resolverIPs\n\n\treturn nil\n}\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/resolvers.go#L181-L217","documentation":"After resolving the absolute path of a resolver file, loadResolverSettings calls loadResolversFromFile to read and parse it. Any error from that call (missing file, unreadable, bad format) is wrapped as 'failed to load resolvers from file'.","triggerScenarios":"A resolver entry pointing at a file path where the file does not exist, cannot be opened, or fails the parser inside loadResolversFromFile.","commonSituations":"Deleted or moved resolver list files; permission errors reading the file; a resolver file with malformed content; stale config entries after reorganizing dotfiles.","solutions":["Check the file exists and is readable at the path named in the wrapped error (errors.Unwrap the cause).","Fix the file's content/format per loadResolversFromFile's expectations (IP-per-line list).","Remove or correct the resolver file entry in the config if the file is no longer needed."],"exampleFix":"// before\nresolvers:\n  - \"/old/path/resolvers.txt\"   # deleted\n// after\nresolvers:\n  - \"/home/user/.config/amass/resolvers.txt\"","handlingStrategy":"validation","validationCode":"for _, p := range resolverFilePaths {\n    if _, err := os.Stat(p); err != nil {\n        return fmt.Errorf(\"resolver file missing: %s\", p)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := loadResolverSettings(); err != nil {\n    if strings.Contains(err.Error(), \"load resolvers from file\") {\n        return fmt.Errorf(\"check resolver file existence/content: %w\", errors.Unwrap(err))\n    }\n}","preventionTips":["Keep resolver list files in stable, versioned locations","Check file readability permissions after dotfile reorganizations","Validate resolver file contents (IP-per-line) before use"],"tags":["configuration","filesystem","file-read"],"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-14T00:17:10.932Z"}