{"record":{"id":"d4f4b6fcd526aaa8","repo":"owasp-amass/amass","slug":"failed-to-extract-the-fqdn-asset-d4f4b6","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/duckduckgo.go","lineNumber":78,"sourceCode":"\t\tTransforms:   []string{string(oam.FQDN)},\n\t\tEventType:    oam.FQDN,\n\t\tCallback:     d.check,\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\td.log.Info(\"Plugin started\")\n\treturn nil\n}\n\nfunc (d *duckDuckGo) Stop() {\n\td.log.Info(\"Plugin stopped\")\n}\n\nfunc (d *duckDuckGo) 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), d.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, d.source, since) {\n\t\tnames = append(names, d.query(e, fqdn.Name)...)\n\t\tsupport.MarkAssetMonitored(e.Session, e.Entity, d.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/duckduckgo.go#L60-L96","documentation":"This error is thrown by the duckduckgo scrape plugin's check method when an event's Entity.Asset is not an *oamdns.FQDN. The plugin only processes FQDN assets; any other asset type reaching its handler fails the assertion and returns this error. It signals an event-routing/type mismatch rather than a scrape failure.","triggerScenarios":"An event whose Entity.Asset is not *oamdns.FQDN (e.g. *network.IPAddress, Netblock, service assets) is dispatched to the duckduckgo plugin's check via the event bus or a direct handler call.","commonSituations":"Plugins registered to receive too-broad a set of event/asset types; custom code pushing non-FQDN events directly into the pipeline; misconfigured event subscriptions where the plugin subscribes to events it cannot handle.","solutions":["Ensure the event reaching this plugin carries an *oamdns.FQDN asset (check the producing plugin's output types)","Verify the event bus/multi-plugin subscription is not routing non-FQDN asset events to this plugin","Return nil instead of an error for unsupported asset types if the plugin should silently ignore them","Log the unexpected asset type before failing to identify which producer emits it"],"exampleFix":"// before\nfqdn, ok := e.Entity.Asset.(*oamdns.FQDN)\nif !ok {\n\treturn errors.New(\"failed to extract the FQDN asset\")\n}\n// after\nfqdn, ok := e.Entity.Asset.(*oamdns.FQDN)\nif !ok {\n\treturn nil // ignore events without an FQDN asset\n}","handlingStrategy":"type-guard","validationCode":"if fqdn, ok := e.Entity.Asset.(*oamdns.FQDN); !ok {\n\treturn nil // not an FQDN; skip\n}","typeGuard":"func isFQDN(e *et.Event) (*oamdns.FQDN, bool) {\n\tfqdn, ok := e.Entity.Asset.(*oamdns.FQDN)\n\treturn fqdn, ok\n}","tryCatchPattern":"// Go returns errors; handle at the handler boundary\nif err := plugin.Check(e); err != nil {\n\tif strings.Contains(err.Error(), \"failed to extract the FQDN asset\") {\n\t\tcontinue // skip non-FQDN events\n\t}\n\treturn err\n}","preventionTips":["Subscribe plugins only to event/asset types they handle","Use a shared type-guard helper in all check methods","Return nil instead of errors for unsupported-but-expected asset types","Log unexpected asset types to detect routing problems"],"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-14T05:17:10.506Z"}