{"record":{"id":"0e08910734158da7","repo":"owasp-amass/amass","slug":"failed-to-obtain-the-organization-associated-with-0e0891","errorCode":null,"errorMessage":"failed to obtain the Organization associated with norm name %s and jurisdiction %s","messagePattern":"failed to obtain the Organization associated with norm name (.+?) and jurisdiction (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"engine/plugins/support/org/claims.go","lineNumber":197,"sourceCode":"\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\n\n\t\t\tif strings.EqualFold(jurisdiction, jv) {\n\t\t\t\treturn orgent, nil\n\t\t\t} else if country != \"\" && strings.EqualFold(country, jv) {\n\t\t\t\treturn orgent, nil\n\t\t\t} else if parts := strings.Split(jv, \"-\"); len(parts) == 2 && strings.EqualFold(jurisdiction, parts[0]) {\n\t\t\t\treturn orgent, nil\n\t\t\t} else if len(parts) == 2 && strings.EqualFold(country, parts[0]) {\n\t\t\t\treturn orgent, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"failed to obtain the Organization associated with norm name %s and jurisdiction %s\", norm, jurisdiction)\n}\n\nfunc CreateOrgRegistrationIDClaim(sess et.Session, orgent *dbt.Entity, regID string, src *et.Source) (*dbt.Entity, error) {\n\tctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)\n\tdefer cancel()\n\n\tid := &oamgen.Identifier{\n\t\tUniqueID: fmt.Sprintf(\"%s:%s\", \"registration_id\", regID),\n\t\tID:       regID,\n\t\tType:     \"registration_id\",\n\t}\n\n\tident, err := sess.DB().CreateAsset(ctx, id)\n\tif err != nil || ident == nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = sess.DB().CreateEntityProperty(ctx, ident, &oamgen.SourceProperty{","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/claims.go#L179-L215","documentation":"FindOrgByNormNameAndJurisdictionClaim found candidate Organization(s) by normalized name but none matched the requested jurisdiction: each candidate's jurisdiction claim is compared to the country/jurisdiction parts (e.g., 'US-DE' splitting into country 'US') and no candidate's jurisdiction equaled it. Returned after exhausting all orgents.","triggerScenarios":"One or more organizations with the normalized name exist, but their stored jurisdiction claims don't EqualFold the input's jurisdiction or country part — e.g., org stored with jurisdiction 'DE' while queried with 'US-DE', or candidates have no jurisdiction claim at all.","commonSituations":"Same normalized org name exists in multiple jurisdictions and the wrong one was stored/queried; jurisdiction was never claimed for the existing org; jurisdiction format mismatch (full name vs alpha-2 vs region suffix like 'US-DE'); case/normalization differences in stored values.","solutions":["Check the stored jurisdiction claims of matching orgs and confirm the input jurisdiction string uses the same format (alpha-2 country, optional '-region').","Create the missing jurisdiction claim via CreateOrgJurisdictionClaim for the existing Organization so future lookups match.","Ensure CreateOrgAsset's countries.ByName normalization produced a code consistent with what's stored.","If the org genuinely differs (same name, different jurisdiction), accept a new Organization asset will be created."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"parts := strings.Split(jurisdiction, \"-\")\nif len(parts) > 2 {\n    return errors.New(\"invalid jurisdiction format: expected COUNTRY or COUNTRY-REGION\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := org.FindOrgByNormNameAndJurisdictionClaim(sess, norm, jurisdiction); err != nil {\n    // jurisdiction mismatch: create the missing claim or accept a new asset\n    org.CreateOrgJurisdictionClaim(sess, orgent, jurisdiction)\n}","preventionTips":["Store jurisdictions as alpha-2 country codes, optionally '-REGION'.","Create jurisdiction claims on existing orgs so future lookups match.","Match the countries.ByName normalization used by CreateOrgAsset.","Distinguish same-name orgs in different jurisdictions before merging."],"tags":["database","graph-lookup","jurisdiction","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"}