{"record":{"id":"434da7a494ecae2d","repo":"owasp-amass/amass","slug":"input-entity-must-be-of-asset-type-fqdn","errorCode":null,"errorMessage":"input entity must be of asset type FQDN","messagePattern":"input entity must be of asset type FQDN","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/db/db.go","lineNumber":22,"sourceCode":"\npackage db\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/caffix/stringset\"\n\t\"github.com/owasp-amass/asset-db/repository\"\n\tdbt \"github.com/owasp-amass/asset-db/types\"\n\toamdns \"github.com/owasp-amass/open-asset-model/dns\"\n)\n\nfunc FindByFQDNScope(ctx context.Context, db repository.Repository, entity *dbt.Entity, since time.Time) ([]*dbt.Entity, error) {\n\tfqdn, valid := entity.Asset.(*oamdns.FQDN)\n\tif !valid {\n\t\treturn nil, errors.New(\"input entity must be of asset type FQDN\")\n\t}\n\n\tset := stringset.New(entity.Asset.Key())\n\tdefer set.Close()\n\n\tresults := []*dbt.Entity{entity}\n\tif edges, err := db.OutgoingEdges(ctx, entity, since, \"node\"); err == nil && len(edges) > 0 {\n\t\tfor _, edge := range edges {\n\t\t\tif to, err := db.FindEntityById(ctx, edge.ToEntity.ID); err == nil && to != nil && !set.Has(to.Asset.Key()) {\n\t\t\t\tif tofqdn, valid := to.Asset.(*oamdns.FQDN); !valid || !strings.HasSuffix(tofqdn.Name, \".\"+fqdn.Name) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tset.Insert(to.Asset.Key())\n\t\t\t\tif findings, err := FindByFQDNScope(ctx, db, to, since); err == nil && len(findings) > 0 {\n\t\t\t\t\tresults = append(results, findings...)\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/internal/db/db.go#L4-L40","documentation":"FindByFQDNScope received an entity whose Asset is not an *oamdns.FQDN; the type assertion entity.Asset.(*oamdns.FQDN) failed. Scope expansion walks FQDN assets only, so passing any other asset type (IP address, ASN, domain, etc.) triggers this guard. Callers: lookup and recursive FindByFQDNScope.","triggerScenarios":"Thrown at internal/db/db.go:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Filter entities by asset type before calling FindByFQDNScope, e.g. check entity.Asset.(type) == *oamdns.FQDN","Trace where the non-FQDN entity entered the pipeline (graph query results, plugin output) and constrain that query to FQDN assets","Use errors.Is/sentinel comparison at the call site to skip rather than abort when mixed asset types are expected"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}