{"record":{"id":"68d2de25efe88eb8","repo":"owasp-amass/amass","slug":"failed-to-extract-the-ipaddress-asset-68d2de","errorCode":null,"errorMessage":"failed to extract the IPAddress asset","messagePattern":"failed to extract the IPAddress asset","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go","lineNumber":34,"sourceCode":"\tdbt \"github.com/owasp-amass/asset-db/types\"\n\toam \"github.com/owasp-amass/open-asset-model\"\n\t\"github.com/owasp-amass/open-asset-model/general\"\n\t\"github.com/owasp-amass/open-asset-model/network\"\n)\n\ntype ipaddrEndpoint struct {\n\tname   string\n\tplugin *httpProbing\n}\n\nfunc (r *ipaddrEndpoint) Name() string {\n\treturn r.name\n}\n\nfunc (r *ipaddrEndpoint) check(e *et.Event) error {\n\tip, ok := e.Entity.Asset.(*network.IPAddress)\n\tif !ok {\n\t\treturn errors.New(\"failed to extract the IPAddress asset\")\n\t}\n\n\tif !e.Session.Config().Active {\n\t\treturn nil\n\t}\n\n\taddrstr := ip.Address.String()\n\tif reserved, _ := amassnet.IsReservedAddress(addrstr); reserved {\n\t\treturn nil\n\t}\n\n\t// only perform the probe if the address is in scope\n\tif _, conf := e.Session.Scope().IsAssetInScope(ip, 0); conf <= 0 {\n\t\treturn nil\n\t}\n\n\tsince, err := support.TTLStartTime(e.Session.Config(), string(oam.IPAddress), string(oam.Service), r.name)\n\tif err != nil || since.IsZero() {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go#L16-L52","documentation":"Thrown by the ipaddrEndpoint service-discovery HTTP probe's check method when the event's Entity.Asset is not a *network.IPAddress. This probe discovers service endpoints on IP addresses; other asset types fail the type assertion. It signals a routing/type mismatch in the event pipeline, not a network problem.","triggerScenarios":"check receives an event whose asset is not *network.IPAddress (e.g. an FQDN asset), making ip, ok := e.Entity.Asset.(*network.IPAddress) fail.","commonSituations":"DNS resolution events being sent to the IP probe instead of the FQDN probe; custom pipelines forwarding FQDN events to ipaddrEndpoint; broad event subscriptions.","solutions":["Route FQDN events to fqdnEndpoint and IP events to ipaddrEndpoint respectively","Confirm the upstream producer emits *network.IPAddress assets to this probe","Return nil for non-IP assets to skip silently","Log the asset's concrete type when the assertion fails to identify the source"],"exampleFix":"// before\nip, ok := e.Entity.Asset.(*network.IPAddress)\nif !ok {\n\treturn errors.New(\"failed to extract the IPAddress asset\")\n}\n// after\nip, ok := e.Entity.Asset.(*network.IPAddress)\nif !ok {\n\treturn nil // skip non-IP assets\n}","handlingStrategy":"type-guard","validationCode":"if ip, ok := e.Entity.Asset.(*network.IPAddress); !ok {\n\treturn nil\n}","typeGuard":"func isIPAddress(a asset.Asset) (*network.IPAddress, bool) {\n\tip, ok := a.(*network.IPAddress)\n\treturn ip, ok\n}","tryCatchPattern":"if err := probe.Check(e); err != nil {\n\tif strings.Contains(err.Error(), \"failed to extract the IPAddress asset\") {\n\t\tcontinue\n\t}\n\treturn err\n}","preventionTips":["Route FQDN events to the FQDN probe, not the IP probe","Type-assert assets before invoking the probe","Skip non-IP assets silently","Test the probe with FQDN events to confirm it skips them"],"tags":["go","type-assertion","ipaddress","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"}