owasp-amass/amass · error
failed to extract the IPAddress asset
Error message
failed to extract the IPAddress asset
What it means
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.
Source
Thrown at engine/plugins/service_discovery/http_probes/ipaddr_endpoint.go:34
dbt "github.com/owasp-amass/asset-db/types"
oam "github.com/owasp-amass/open-asset-model"
"github.com/owasp-amass/open-asset-model/general"
"github.com/owasp-amass/open-asset-model/network"
)
type ipaddrEndpoint struct {
name string
plugin *httpProbing
}
func (r *ipaddrEndpoint) Name() string {
return r.name
}
func (r *ipaddrEndpoint) check(e *et.Event) error {
ip, ok := e.Entity.Asset.(*network.IPAddress)
if !ok {
return errors.New("failed to extract the IPAddress asset")
}
if !e.Session.Config().Active {
return nil
}
addrstr := ip.Address.String()
if reserved, _ := amassnet.IsReservedAddress(addrstr); reserved {
return nil
}
// only perform the probe if the address is in scope
if _, conf := e.Session.Scope().IsAssetInScope(ip, 0); conf <= 0 {
return nil
}
since, err := support.TTLStartTime(e.Session.Config(), string(oam.IPAddress), string(oam.Service), r.name)
if err != nil || since.IsZero() {View on GitHub (pinned to 79299dce87)
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
Example fix
// before
ip, ok := e.Entity.Asset.(*network.IPAddress)
if !ok {
return errors.New("failed to extract the IPAddress asset")
}
// after
ip, ok := e.Entity.Asset.(*network.IPAddress)
if !ok {
return nil // skip non-IP assets
} Defensive patterns
Strategy: type-guard
Validate before calling
if ip, ok := e.Entity.Asset.(*network.IPAddress); !ok {
return nil
} Type guard
func isIPAddress(a asset.Asset) (*network.IPAddress, bool) {
ip, ok := a.(*network.IPAddress)
return ip, ok
} Try / catch
if err := probe.Check(e); err != nil {
if strings.Contains(err.Error(), "failed to extract the IPAddress asset") {
continue
}
return err
} Prevention
- 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
When it happens
Trigger: check receives an event whose asset is not *network.IPAddress (e.g. an FQDN asset), making ip, ok := e.Entity.Asset.(*network.IPAddress) fail.
Common situations: DNS resolution events being sent to the IP probe instead of the FQDN probe; custom pipelines forwarding FQDN events to ipaddrEndpoint; broad event subscriptions.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- failed to extract the FQDN asset
- failed to cast the DomainRecord
- failed to cast the IPNetRecord
- failed to cast the TLSCertificate asset
- failed to extract the IPAddress asset
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/68d2de25efe88eb8.
Report an issue: GitHub.