owasp-amass/amass · info

failed to obtain the Organization associated with norm name

Error message

failed to obtain the Organization associated with norm name %s and jurisdiction %s

What it means

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.

Solutions

  1. Check the stored jurisdiction claims of matching orgs and confirm the input jurisdiction string uses the same format (alpha-2 country, optional '-region').
  2. Create the missing jurisdiction claim via CreateOrgJurisdictionClaim for the existing Organization so future lookups match.
  3. Ensure CreateOrgAsset's countries.ByName normalization produced a code consistent with what's stored.
  4. If the org genuinely differs (same name, different jurisdiction), accept a new Organization asset will be created.
Defensive patterns

Strategy: fallback

Validate before calling

parts := strings.Split(jurisdiction, "-")
if len(parts) > 2 {
    return errors.New("invalid jurisdiction format: expected COUNTRY or COUNTRY-REGION")
}

Try / catch

if _, err := org.FindOrgByNormNameAndJurisdictionClaim(sess, norm, jurisdiction); err != nil {
    // jurisdiction mismatch: create the missing claim or accept a new asset
    org.CreateOrgJurisdictionClaim(sess, orgent, jurisdiction)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/0e08910734158da7. Report an issue: GitHub.

Appendix: source

Thrown at engine/plugins/support/org/claims.go:197

			jc, valid := tag.Property.(*oamgen.SimpleProperty)
			if !valid {
				continue
			}
			jv := jc.PropertyValue

			if strings.EqualFold(jurisdiction, jv) {
				return orgent, nil
			} else if country != "" && strings.EqualFold(country, jv) {
				return orgent, nil
			} else if parts := strings.Split(jv, "-"); len(parts) == 2 && strings.EqualFold(jurisdiction, parts[0]) {
				return orgent, nil
			} else if len(parts) == 2 && strings.EqualFold(country, parts[0]) {
				return orgent, nil
			}
		}
	}

	return nil, fmt.Errorf("failed to obtain the Organization associated with norm name %s and jurisdiction %s", norm, jurisdiction)
}

func CreateOrgRegistrationIDClaim(sess et.Session, orgent *dbt.Entity, regID string, src *et.Source) (*dbt.Entity, error) {
	ctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)
	defer cancel()

	id := &oamgen.Identifier{
		UniqueID: fmt.Sprintf("%s:%s", "registration_id", regID),
		ID:       regID,
		Type:     "registration_id",
	}

	ident, err := sess.DB().CreateAsset(ctx, id)
	if err != nil || ident == nil {
		return nil, err
	}

	_, err = sess.DB().CreateEntityProperty(ctx, ident, &oamgen.SourceProperty{

View on GitHub (pinned to 79299dce87)