{"record":{"id":"bfb2949e2ece3955","repo":"owasp-amass/amass","slug":"failed-to-extract-the-fqdn-asset-bfb294","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/service_discovery/http_probes/fqdn_endpoint.go","lineNumber":34,"sourceCode":"\tdbt \"github.com/owasp-amass/asset-db/types\"\n\toam \"github.com/owasp-amass/open-asset-model\"\n\toamdns \"github.com/owasp-amass/open-asset-model/dns\"\n\toamgen \"github.com/owasp-amass/open-asset-model/general\"\n)\n\ntype fqdnEndpoint struct {\n\tname   string\n\tplugin *httpProbing\n}\n\nfunc (fe *fqdnEndpoint) Name() string {\n\treturn fe.name\n}\n\nfunc (fe *fqdnEndpoint) 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 !e.Session.Config().Active {\n\t\treturn nil\n\t}\n\tif !support.HasDNSRecordType(e, int(dns.TypeCNAME)) &&\n\t\t!support.HasDNSRecordType(e, int(dns.TypeA)) &&\n\t\t!support.HasDNSRecordType(e, int(dns.TypeAAAA)) {\n\t\treturn nil\n\t}\n\tif _, conf := e.Session.Scope().IsAssetInScope(fqdn, 0); conf == 0 {\n\t\treturn nil\n\t}\n\n\tsince, err := support.TTLStartTime(e.Session.Config(), string(oam.FQDN), string(oam.Service), fe.name)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/service_discovery/http_probes/fqdn_endpoint.go#L16-L52","documentation":"Thrown by the fqdnEndpoint service-discovery HTTP probe's check method when the event's Entity.Asset is not an *oamdns.FQDN. This probe discovers endpoints only for FQDN assets; any other asset type fails the assertion. It indicates the event stream delivered an incompatible asset type to the probe.","triggerScenarios":"check is invoked with an event whose asset is not *oamdns.FQDN, so the fqdn, ok := e.Entity.Asset.(*oamdns.FQDN) assertion fails before active-mode and CNAME checks.","commonSituations":"Service-discovery pipeline routing IP or service assets to the FQDN probe; custom plugins emitting non-FQDN assets; misregistered probe handlers that receive all event types.","solutions":["Verify the event sent to this probe carries an FQDN asset","Check the plugin registration so fqdnEndpoint only subscribes to FQDN-asset events","Return nil for non-FQDN assets instead of an error","Trace the event producer emitting the unexpected asset type"],"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 // not an FQDN; ignore\n}","handlingStrategy":"type-guard","validationCode":"if fqdn, ok := e.Entity.Asset.(*oamdns.FQDN); !ok {\n\treturn nil\n}","typeGuard":"func isFQDNAsset(a asset.Asset) (*oamdns.FQDN, bool) {\n\tfqdn, ok := a.(*oamdns.FQDN)\n\treturn fqdn, ok\n}","tryCatchPattern":"if err := probe.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":["Route FQDN events to fqdnEndpoint, IP events to ipaddrEndpoint","Assert asset type before calling active probes","Return nil for non-FQDN assets in the probe","Cover both FQDN and non-FQDN events in unit tests"],"tags":["go","type-assertion","fqdn","service-discovery"],"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"}