{"record":{"id":"0e0c5e2240e571d0","repo":"owasp-amass/amass","slug":"no-valid-resolvers-were-found","errorCode":null,"errorMessage":"no valid resolvers were found","messagePattern":"no valid resolvers were found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/resolvers.go","lineNumber":210,"sourceCode":"\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\nfunc (c *Config) loadResolversFromFile(path string) ([]string, error) {\n\tabsPath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get absolute path: %v\", err)\n\t}\n\n\tdata, err := os.ReadFile(absPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open resolvers file: %w\", err)\n\t}\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/resolvers.go#L192-L228","documentation":"After parsing and type-asserting resolver entries to strings, loadResolverSettings deduplicates the list and requires at least one valid resolver. If the list is empty after validation, this error is returned because enumeration cannot proceed without a resolver.","triggerScenarios":"Calling loadResolverSettings where resolversList resolves to zero entries after parsing/validation — e.g. a resolvers list with only empty strings or entries rejected by validation — so len(resolverIPs) == 0.","commonSituations":"An empty resolvers list in the config (resolvers: [] or only blank entries), environment-specific configs stripped of resolver addresses, or validation dropping malformed addresses leaving none.","solutions":["Add at least one valid resolver IP (e.g. 8.8.8.8) to the list.","Remove empty or placeholder entries that fail validation.","Verify entries parse as valid IPs/addresses.","Confirm the right config file/environment is loaded."],"exampleFix":"# before\nresolvers: []\n# after\nresolvers:\n  - 8.8.8.8\n  - 1.1.1.1","handlingStrategy":"validation","validationCode":"if len(resolvers) == 0 || allEmpty(resolvers) {\n    return errors.New(\"at least one non-empty resolver is required\")\n}","typeGuard":null,"tryCatchPattern":"if err := loadResolverSettings(cfg); err != nil {\n    if strings.Contains(err.Error(), \"no valid resolvers\") {\n        // fall back to well-known public resolvers (8.8.8.8, 1.1.1.1)\n    }\n    return err\n}","preventionTips":["Keep at least one public resolver in every config profile.","Strip blank entries or warn on them during config lint.","Validate entries are well-formed IPs before running.","Test configs in CI with a loader dry-run."],"tags":["config","dns","validation"],"backgroundTag":"empty-required-field","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"}