{"record":{"id":"3d8a80f2934da0e5","repo":"owasp-amass/amass","slug":"failed-to-create-the-organization-asset","errorCode":null,"errorMessage":"failed to create the Organization asset","messagePattern":"failed to create the Organization asset","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/support/org/org.go","lineNumber":69,"sourceCode":"\t\t\torgent, _ = FindOrgByNormNameAndJurisdictionClaim(sess, normName, o.Jurisdiction)\n\t\t}\n\t}\n\n\tdName := o.Name\n\to.Name = normName\n\tif orgent == nil && obj != nil {\n\t\torgent = dedupChecks(sess, obj, o)\n\t}\n\n\tif orgent == nil {\n\t\tctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)\n\t\tdefer cancel()\n\n\t\tvar err error\n\t\to.ID = genStableOrgID(o)\n\t\torgent, err = sess.DB().CreateAsset(ctx, o)\n\t\tif err != nil || orgent == nil {\n\t\t\treturn nil, errors.New(\"failed to create the Organization asset\")\n\t\t}\n\t}\n\n\tif orgent != nil {\n\t\t// create name and jurisdiction claims provided by the caller\n\t\t_, _ = CreateOrgNameClaim(sess, orgent, dName, src)\n\n\t\tif o.LegalName != \"\" {\n\t\t\t_, _ = CreateOrgLegalNameClaim(sess, orgent, o.LegalName, src)\n\t\t}\n\t\tif o.Jurisdiction != \"\" {\n\t\t\t_ = CreateOrgJurisdictionClaim(sess, orgent, o.Jurisdiction)\n\t\t}\n\t\tif o.RegistrationID != \"\" {\n\t\t\t_, _ = CreateOrgRegistrationIDClaim(sess, orgent, o.RegistrationID, src)\n\t\t}\n\n\t\tctx, cancel := context.WithTimeout(sess.Ctx(), 10*time.Second)","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/org.go#L51-L87","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect/logs the underlying CreateAsset error to identify the root cause (this wrapper discards it)","Check graph DB connectivity and health of the session's DB backend","Retry the operation — transient timeouts and network blips are common causes","Verify the context timeout (30s) is adequate for your DB latency; large graphs may need more","Confirm genStableOrgID produces a valid, unique ID for your schema"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := createOrgWithRetry(sess, obj, rel, org, src); err != nil {\n    log.Printf(\"org creation failed: %v\", err)\n}","preventionTips":["Monitor graph DB health before bulk ingestion","Use bounded retries with backoff for CreateAsset calls","Log the raw CreateAsset error — this wrapper discards the cause","Size the 30s context timeout to your DB's tail latency"],"tags":["go","database","create-failed","graph-db"],"backgroundTag":"database-write-failed","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"}