owasp-amass/amass · error
failed to discover or create the Organization asset
Error message
failed to discover or create the Organization asset
What it means
This is the terminal fallback in CreateOrgAsset: after all lookup paths (name claim, legal-name claim, legal-name edge, ancestor checks) fail to produce an existing orgent, and the creation branch also left orgent nil, the function returns this generic error indicating it could neither discover nor create the Organization asset.
Source
Thrown at engine/plugins/support/org/org.go:108
// identify this caller as a source of the Organization asset
_, _ = sess.DB().CreateEntityProperty(ctx, orgent, &oamgen.SourceProperty{
Source: src.Name,
Confidence: src.Confidence,
})
if obj != nil && rel != nil && obj.ID != orgent.ID {
ctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)
defer cancel()
if err := createRelation(ctx, sess, obj, rel, orgent, src); err != nil {
return nil, err
}
}
return orgent, nil
}
return nil, errors.New("failed to discover or create the Organization asset")
}
func genNormName(o *oamorg.Organization) string {
name := o.Name
if o.LegalName != "" {
name = o.LegalName
}
return ExtractBrandName(strings.ToLower(name))
}
func genStableOrgID(o *oamorg.Organization) string {
id := uuid.New().String()
return fmt.Sprintf("%s:%s", o.Name, id)
}
func createRelation(ctx context.Context, sess et.Session, obj *dbt.Entity, rel oam.Relation, subject *dbt.Entity, src *et.Source) error {View on GitHub (pinned to 79299dce87)
Solutions
- Enable debug logging around CreateOrgAsset to see which lookup/creation branch failed
- Check DB connectivity — this generic message usually masks a CreateAsset failure from [47]
- Re-run the operation after fixing the underlying DB issue; the state machine has no retry loop
- Audit callers for swallowed errors (e.g. `orgent, _ = FindOrgByLegalNameClaim(...)`) and log them instead
Example fix
// before
orgent, _ = FindOrgByLegalNameClaim(sess, o.LegalName, src)
// after
orgent, err = FindOrgByLegalNameClaim(sess, o.LegalName, src)
if err != nil {
return nil, fmt.Errorf("legal-name lookup failed: %w", err)
} Defensive patterns
Strategy: retry
Try / catch
orgent, err := CreateOrgAsset(sess, obj, rel, org, src)
if err != nil {
log.Printf("discover-or-create failed: %v", err)
// inspect DB state, then retry once
} Prevention
- Fix underlying DB issues first — this error masks earlier failures
- Avoid swallowing lookup errors (orgent, _ = ...) so root causes surface
- Retry after transient DB failures; verify state between attempts
When it happens
Trigger: Reached when orgent remains nil at the end of CreateOrgAsset — typically the result of an earlier silently-ignored lookup error or the failed CreateAsset path leaving orgent nil despite no error propagating directly.
Common situations: Compound failures: lookup errors were swallowed (e.g. FindOrgByLegalNameClaim's error is discarded with _) and creation also failed; inconsistent DB state; all dedup branches exhausted without a match or successful create.
Related errors
- zero names provided in the Organization
- no matching org found
- no matching organizations were found
- missing the organization name
- failed to create the Organization asset
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/42cdcd0f29f566f8.
Report an issue: GitHub.