{"record":{"id":"23327104d2d7cab5","repo":"projectdiscovery/subfinder","slug":"s-s","errorCode":null,"errorMessage":"%s, %s","messagePattern":"%s, %s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/subscraping/sources/alienvault/alienvault.go","lineNumber":73,"sourceCode":"\t\t\ts.errors++\n\t\t\tsession.DiscardHTTPResponse(resp)\n\t\t\treturn\n\t\t}\n\n\t\tvar response alienvaultResponse\n\t\t// Get the response body and decode\n\t\terr = json.NewDecoder(resp.Body).Decode(&response)\n\t\tif err != nil {\n\t\t\tresults <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}\n\t\t\ts.errors++\n\t\t\tsession.DiscardHTTPResponse(resp)\n\t\t\treturn\n\t\t}\n\t\tsession.DiscardHTTPResponse(resp)\n\n\t\tif response.Error != \"\" {\n\t\t\tresults <- subscraping.Result{\n\t\t\t\tSource: s.Name(), Type: subscraping.Error, Error: fmt.Errorf(\"%s, %s\", response.Detail, response.Error),\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tfor _, record := range response.PassiveDNS {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: record.Hostname}:\n\t\t\t\ts.results++\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn results\n}\n\n// Name returns the name of the source","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/projectdiscovery/subfinder/blob/7a0b91f0fac01b62c65328bd771a3560ae611d6a/pkg/subscraping/sources/alienvault/alienvault.go#L55-L91","documentation":"The AlienVault source reports upstream API errors by combining the response's 'detail' and 'error' fields into a single error Result: fmt.Errorf(\"%s, %s\", response.Detail, response.Error). This surfaces AlienVault's own API error message to the caller as a scraping Result of type Error.","triggerScenarios":"AlienVault OTX API returns a JSON body where response.Error is non-empty — typically invalid/missing OTX API key, or the API rejecting the request (quota, bad request).","commonSituations":"No OTX API key configured or key expired; hitting OTX rate limits; OTX API temporary outages or schema changes producing error fields in the payload.","solutions":["Set a valid OTX API key in the subfinder provider config ($HOME/.config/subfinder/provider-config.yaml)","Check your OTX account quota/usage and retry after backoff","Retry later if OTX is having an outage; check OTX status","Inspect the error text: the detail message usually names the exact problem (auth, quota, bad query)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"for result := range results {\n    if result.Type == subscraping.Error {\n        gologger.Warning().Msgf(\"alienvault: %v\", result.Error)\n        continue\n    }\n    // process result\n}","preventionTips":["Keep a valid OTX API key configured","Respect OTX rate limits","Handle Error-type results gracefully per source"],"tags":["alienvault","api","upstream"],"backgroundTag":"upstream-api-error","analyzedSha":"7a0b91f0fac01b62c65328bd771a3560ae611d6a","analyzedAt":"2026-09-06T23:52:02.109Z","contentChangedAt":"2026-09-06T23:52:02.109Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}