owasp-amass/amass · error

failed to create the Organization asset

Error message

failed to create the Organization asset

What it means

When no existing Organization matches, CreateOrgAsset generates a stable ID and calls sess.DB().CreateAsset to persist a new one. This error is returned when CreateAsset fails OR returns a nil entity — i.e. the database layer refused or was unable to create the Organization node.

Source

Thrown at engine/plugins/support/org/org.go:69

			orgent, _ = FindOrgByNormNameAndJurisdictionClaim(sess, normName, o.Jurisdiction)
		}
	}

	dName := o.Name
	o.Name = normName
	if orgent == nil && obj != nil {
		orgent = dedupChecks(sess, obj, o)
	}

	if orgent == nil {
		ctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)
		defer cancel()

		var err error
		o.ID = genStableOrgID(o)
		orgent, err = sess.DB().CreateAsset(ctx, o)
		if err != nil || orgent == nil {
			return nil, errors.New("failed to create the Organization asset")
		}
	}

	if orgent != nil {
		// create name and jurisdiction claims provided by the caller
		_, _ = CreateOrgNameClaim(sess, orgent, dName, src)

		if o.LegalName != "" {
			_, _ = CreateOrgLegalNameClaim(sess, orgent, o.LegalName, src)
		}
		if o.Jurisdiction != "" {
			_ = CreateOrgJurisdictionClaim(sess, orgent, o.Jurisdiction)
		}
		if o.RegistrationID != "" {
			_, _ = CreateOrgRegistrationIDClaim(sess, orgent, o.RegistrationID, src)
		}

		ctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)

View on GitHub (pinned to 79299dce87)

Solutions

  1. Inspect/logs the underlying CreateAsset error to identify the root cause (this wrapper discards it)
  2. Check graph DB connectivity and health of the session's DB backend
  3. Retry the operation — transient timeouts and network blips are common causes
  4. Verify the context timeout (30s) is adequate for your DB latency; large graphs may need more
  5. Confirm genStableOrgID produces a valid, unique ID for your schema
Defensive patterns

Strategy: retry

Try / catch

if err := createOrgWithRetry(sess, obj, rel, org, src); err != nil {
    log.Printf("org creation failed: %v", err)
}

Prevention

When it happens

Trigger: CreateAsset returns a non-nil err (DB write failure, context timeout from the 30s WithTimeout, connection loss to the graph store) or returns (nil, nil), typically during the fallback creation branch after FindOrgByNameClaim/FindOrgByLegalNameClaim both miss.

Common situations: Graph database unavailable or restarting; 30-second context deadline exceeded under load; schema constraint violations; storage backend misconfiguration in the session; transient network partition between engine and DB.

Related errors


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