{"record":{"id":"56bb97130d8045c1","repo":"owasp-amass/amass","slug":"failed-to-obtain-organizations-with-norm-name-s","errorCode":null,"errorMessage":"failed to obtain organizations with norm name %s","messagePattern":"failed to obtain organizations with norm name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"engine/plugins/support/org/claims.go","lineNumber":165,"sourceCode":"\t}\n\n\treturn fmt.Errorf(\"failed to create the jurisdiction claim %s for organization %s\", jurisdiction, orgent.Asset.Key())\n}\n\nfunc FindOrgByNormNameAndJurisdictionClaim(sess et.Session, norm, jurisdiction string) (*dbt.Entity, error) {\n\tvar country string\n\tif parts := strings.Split(jurisdiction, \"-\"); len(parts) == 2 {\n\t\tcountry = parts[0]\n\t}\n\n\tctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)\n\tdefer cancel()\n\n\torgents, err := sess.DB().FindEntitiesByContent(ctx, oam.Organization, time.Time{}, 1, dbt.ContentFilters{\n\t\t\"name\": norm,\n\t})\n\tif err != nil || len(orgents) == 0 {\n\t\treturn nil, fmt.Errorf(\"failed to obtain organizations with norm name %s\", norm)\n\t}\n\n\tseconds := 10 * len(orgents)\n\toctx, ocancel := context.WithTimeout(sess.Ctx(), time.Duration(seconds)*time.Second)\n\tdefer ocancel()\n\n\tfor _, orgent := range orgents {\n\t\ttags, err := sess.DB().FindEntityTags(octx, orgent, time.Time{}, \"jurisdiction\")\n\t\tif err != nil || len(tags) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, tag := range tags {\n\t\t\tjc, valid := tag.Property.(*oamgen.SimpleProperty)\n\t\t\tif !valid {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tjv := jc.PropertyValue","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/claims.go#L147-L183","documentation":"FindOrgByNormNameAndJurisdictionClaim searches for Organization assets by their normalized name via FindEntitiesByContent on oam.Organization with a 'name' content filter. If the query errors or no organization has that normalized name, this error is returned, meaning no Organization asset exists yet with that norm name.","triggerScenarios":"CreateOrgAsset calls it (when Jurisdiction is set and prior lookups missed) with normName = genNormName(o); the graph contains no Organization entity whose 'name' content equals the normalized name, or the DB query fails within the context.","commonSituations":"First encounter of the organization; normalization function produces a different form than previously stored names; DB outage; jurisdiction normalization changed (e.g., country code mapping) so a differently-normalized name/jurisdiction pair was stored earlier.","solutions":["Confirm an Organization asset with that exact normalized name exists in the graph; otherwise this is an expected miss and the caller creates a new asset.","Compare genNormName output with stored organization names to catch normalization drift; align the normalization logic.","Check DB health if the query itself errored rather than returned zero rows.","If jurisdiction normalization changed recently, re-verify existing assets were stored with matching country codes."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"orgents, err := sess.DB().FindEntitiesByContent(ctx, oam.Organization, time.Time{}, 1, dbt.ContentFilters{\"name\": norm})\nif err != nil || len(orgents) == 0 {\n    // no org with this normalized name: expected on first discovery\n}","typeGuard":null,"tryCatchPattern":"if _, err := org.FindOrgByNormNameAndJurisdictionClaim(sess, norm, jurisdiction); err != nil {\n    // fall through to creating a new Organization asset\n}","preventionTips":["Verify genNormName matches the normalization used when assets were stored.","Keep normalization logic stable across versions.","Check DB health when the query errors instead of returning empty.","Accept empty results as normal cache misses."],"tags":["database","graph-lookup","not-found","amass"],"backgroundTag":"entity-not-found","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"}