{"record":{"id":"c39b9702b73b5d37","repo":"owasp-amass/amass","slug":"failed-to-extract-the-fqdn-asset-c39b97","errorCode":null,"errorMessage":"failed to extract the FQDN asset","messagePattern":"failed to extract the FQDN asset","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/scrape/rapiddns.go","lineNumber":78,"sourceCode":"\t\tTransforms:   []string{string(oam.FQDN)},\n\t\tEventType:    oam.FQDN,\n\t\tCallback:     rd.check,\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\trd.log.Info(\"Plugin started\")\n\treturn nil\n}\n\nfunc (rd *rapidDNS) Stop() {\n\trd.log.Info(\"Plugin stopped\")\n}\n\nfunc (rd *rapidDNS) check(e *et.Event) error {\n\tfqdn, ok := e.Entity.Asset.(*oamdns.FQDN)\n\tif !ok {\n\t\treturn errors.New(\"failed to extract the FQDN asset\")\n\t}\n\n\tif !support.HasSLDInScope(e) {\n\t\treturn nil\n\t}\n\n\tsince, err := support.TTLStartTime(e.Session.Config(), string(oam.FQDN), string(oam.FQDN), rd.name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar names []*dbt.Entity\n\tif !support.AssetMonitoredWithinTTL(e.Session, e.Entity, rd.source, since) {\n\t\tnames = append(names, rd.query(e, fqdn.Name)...)\n\t\tsupport.MarkAssetMonitored(e.Session, e.Entity, rd.source)\n\t}\n\n\tif len(names) > 0 {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/scrape/rapiddns.go#L60-L96","documentation":"Thrown by the rapiddns scrape plugin's check method when the event's Entity.Asset is not an *oamdns.FQDN. The plugin performs subdomain discovery only for FQDN assets; any other asset type fails the assertion. This is an asset-type routing mismatch, not a RapidDNS API error.","triggerScenarios":"check receives an event whose asset is not *oamdns.FQDN (e.g. an IPAddress or Service asset), making the type assertion fail before the scope check.","commonSituations":"Event bus forwarding all asset events to this plugin; custom data sources emitting non-FQDN assets into the scrape pipeline; test code calling check directly with a synthetic non-FQDN event.","solutions":["Ensure only FQDN-asset events are dispatched to the rapiddns plugin","Inspect the producing plugin's asset type and add a converter/selector if needed","Change the handler to return nil for unsupported asset types","Add debug logging of e.Entity.Asset type when the assertion fails"],"exampleFix":"// before\nif !ok {\n\treturn errors.New(\"failed to extract the FQDN asset\")\n}\n// after\nif !ok {\n\treturn nil // not an FQDN; nothing to do\n}","handlingStrategy":"type-guard","validationCode":"if fqdn, ok := e.Entity.Asset.(*oamdns.FQDN); !ok {\n\treturn nil\n}","typeGuard":"func asFQDN(e *et.Event) (*oamdns.FQDN, bool) {\n\tfqdn, ok := e.Entity.Asset.(*oamdns.FQDN)\n\treturn fqdn, ok\n}","tryCatchPattern":"if err := plugin.Check(e); err != nil {\n\tif strings.Contains(err.Error(), \"failed to extract the FQDN asset\") {\n\t\tcontinue\n\t}\n\treturn err\n}","preventionTips":["Filter events before dispatching to scrape plugins","Keep asset type expectations aligned with upstream producers","Return nil for unsupported asset types in check methods","Add tests that call check with non-FQDN assets"],"tags":["go","type-assertion","fqdn","plugin"],"backgroundTag":"incompatible-source-type","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"}