{"record":{"id":"b604a57b1e6aaee2","repo":"owasp-amass/amass","slug":"no-matching-organizations-were-found","errorCode":null,"errorMessage":"no matching organizations were found","messagePattern":"no matching organizations were found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"engine/plugins/support/org/match.go","lineNumber":204,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\n\tvar orgents []*dbt.Entity\n\tfor _, ident := range idents {\n\t\tif edges, err := sess.DB().IncomingEdges(ctx, ident, time.Time{}, \"id\"); err == nil {\n\t\t\tfor _, edge := range edges {\n\t\t\t\tif a, err := sess.DB().FindEntityById(ctx, edge.FromEntity.ID); err == nil && a != nil {\n\t\t\t\t\tif _, ok := a.Asset.(*org.Organization); ok {\n\t\t\t\t\t\torgents = append(orgents, a)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(orgents) == 0 {\n\t\treturn nil, errors.New(\"no matching organizations were found\")\n\t}\n\treturn orgents, nil\n}\n","sourceCodeStart":186,"sourceCodeEnd":208,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/match.go#L186-L208","documentation":"orgsWithSameNames queries the graph for Organizations matching any of the supplied names and returns the resulting entity slice. If the query succeeds but returns zero organizations, it wraps the empty result in this error so callers can distinguish 'no orgs at all with these names' from an actual lookup failure.","triggerScenarios":"Called from existsAndSharesAncestorEntity or existsAndHasAncestorInSession with names (o.Name and o.LegalName) that no stored Organization claims — a successful DB query that simply found nothing.","commonSituations":"First-time ingestion of a brand-new company; names stored under different casing/punctuation than queried; name claims never created for legacy orgs; typo in Name/LegalName.","solutions":["Expected for new entities: callers proceed to create the Organization","Check that prior ingestions actually created name claims (CreateOrgNameClaim) for the target org","Verify query-time name normalization matches claim-time normalization (genNormName)","Test the same name directly via FindOrgByNameClaim to confirm graph state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"orgs, err := FindOrgByNameClaim(sess, name, src)\nif err != nil {\n    // empty result — safe to create a new org\n}","typeGuard":null,"tryCatchPattern":"if _, err := FindOrgByNameClaim(sess, o.Name, src); err != nil {\n    // not found: proceed with creation\n}","preventionTips":["Expect empty results for new entities — branch on the error, don't panic","Verify ingestion created name claims for orgs you expect to find","Use identical normalization at claim time and query time"],"tags":["go","empty-result","graph","organization"],"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-14T00:17:10.932Z"}