{"record":{"id":"65324c3bca0b14d1","repo":"owasp-amass/amass","slug":"failed-to-extract-the-locations","errorCode":null,"errorMessage":"failed to extract the locations","messagePattern":"failed to extract the locations","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/plugins/horizontals/plugin.go","lineNumber":355,"sourceCode":"\n\tseconds := 5 * len(edges)\n\tlctx, cancel := context.WithTimeout(sess.Ctx(), time.Duration(seconds)*time.Second)\n\tdefer cancel()\n\n\tvar results []*dbt.Entity\n\tfor _, edge := range edges {\n\t\tto, err := sess.DB().FindEntityById(lctx, edge.ToEntity.ID)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, valid := to.Asset.(*oamcon.Location); valid {\n\t\t\tresults = append(results, to)\n\t\t}\n\t}\n\n\tif len(results) == 0 {\n\t\treturn nil, errors.New(\"failed to extract the locations\")\n\t}\n\treturn results, nil\n}\n\nfunc (h *horizPlugin) getOrganizationLocations(sess et.Session, o *dbt.Entity) ([]*dbt.Entity, error) {\n\tsince, err := support.TTLStartTime(sess.Config(),\n\t\tstring(oam.Organization), string(oam.Location), h.name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx, cancel := context.WithTimeout(sess.Ctx(), 5*time.Second)\n\tdefer cancel()\n\n\tedges, err := sess.DB().OutgoingEdges(ctx, o, since, \"hq_address\", \"location\")\n\tif err != nil || len(edges) == 0 {\n\t\treturn nil, errors.New(\"zero locations found\")\n\t}","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/horizontals/plugin.go#L337-L373","documentation":"After querying location edges, getContactRecordLocations filters them to those whose To.Asset is an *oamcon.Location. If zero survive the type filter, it returns this error — edges existed but none pointed at an actual Location asset.","triggerScenarios":"OutgoingEdges returned edges for the contact record, but none of the edge destinations hold a *oamcon.Location asset (different asset types on the edge or malformed data).","commonSituations":"A plugin version emitting a new/different location asset type not matched by the *oamcon.Location assertion; corrupt or stale graph data; version drift between oam type definitions.","solutions":["Update oamcon type assertions to cover new location asset variants","Re-run enumeration to refresh possibly stale edge data","Log the actual asset types found to diagnose which type is appearing instead","Skip such contact records and continue rather than failing the whole lookup"],"exampleFix":"// before\nif _, valid := to.Asset.(*oamcon.Location); valid {\n// after\nswitch to.Asset.(type) {\ncase *oamcon.Location, *oamcon.NewLocation: // cover new variants\n    results = append(results, to)\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func isLocationEdge(to *dbt.Entity) bool {\n    _, ok := to.Asset.(*oamcon.Location)\n    return ok\n}","tryCatchPattern":"locs, err := getContactRecordLocations(sess, cr)\nif err != nil {\n    if errors.Is(err, errExtractLocations) {\n        return nil // skip records whose edges aren't Location assets\n    }\n    return err\n}","preventionTips":["Keep oamcon asset type definitions in sync across plugin versions","Log non-Location asset types encountered on location edges","Purge stale graph data after major version upgrades"],"tags":["graph-database","plugin","type-assertion","no-data"],"backgroundTag":"empty-result-set","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"}