owasp-amass/amass · error

failed to extract the FQDN asset

Error message

failed to extract the FQDN asset

What it means

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.

Source

Thrown at engine/plugins/service_discovery/http_probes/fqdn_endpoint.go:34

	dbt "github.com/owasp-amass/asset-db/types"
	oam "github.com/owasp-amass/open-asset-model"
	oamdns "github.com/owasp-amass/open-asset-model/dns"
	oamgen "github.com/owasp-amass/open-asset-model/general"
)

type fqdnEndpoint struct {
	name   string
	plugin *httpProbing
}

func (fe *fqdnEndpoint) Name() string {
	return fe.name
}

func (fe *fqdnEndpoint) check(e *et.Event) error {
	fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
	if !ok {
		return errors.New("failed to extract the FQDN asset")
	}

	if !e.Session.Config().Active {
		return nil
	}
	if !support.HasDNSRecordType(e, int(dns.TypeCNAME)) &&
		!support.HasDNSRecordType(e, int(dns.TypeA)) &&
		!support.HasDNSRecordType(e, int(dns.TypeAAAA)) {
		return nil
	}
	if _, conf := e.Session.Scope().IsAssetInScope(fqdn, 0); conf == 0 {
		return nil
	}

	since, err := support.TTLStartTime(e.Session.Config(), string(oam.FQDN), string(oam.Service), fe.name)
	if err != nil {
		return err
	}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Verify the event sent to this probe carries an FQDN asset
  2. Check the plugin registration so fqdnEndpoint only subscribes to FQDN-asset events
  3. Return nil for non-FQDN assets instead of an error
  4. Trace the event producer emitting the unexpected asset type

Example fix

// before
fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
if !ok {
	return errors.New("failed to extract the FQDN asset")
}
// after
fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
if !ok {
	return nil // not an FQDN; ignore
}
Defensive patterns

Strategy: type-guard

Validate before calling

if fqdn, ok := e.Entity.Asset.(*oamdns.FQDN); !ok {
	return nil
}

Type guard

func isFQDNAsset(a asset.Asset) (*oamdns.FQDN, bool) {
	fqdn, ok := a.(*oamdns.FQDN)
	return fqdn, ok
}

Try / catch

if err := probe.Check(e); err != nil {
	if strings.Contains(err.Error(), "failed to extract the FQDN asset") {
		continue
	}
	return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/bfb2949e2ece3955. Report an issue: GitHub.