{"record":{"id":"3b76412623b5426b","repo":"owasp-amass/amass","slug":"missing-the-organization-name","errorCode":null,"errorMessage":"missing the organization name","messagePattern":"missing the organization name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/support/org/org.go","lineNumber":31,"sourceCode":"\t\"time\"\n\n\t\"github.com/biter777/countries\"\n\t\"github.com/google/uuid\"\n\tet \"github.com/owasp-amass/amass/v5/engine/types\"\n\tdbt \"github.com/owasp-amass/asset-db/types\"\n\toam \"github.com/owasp-amass/open-asset-model\"\n\toamgen \"github.com/owasp-amass/open-asset-model/general\"\n\toamorg \"github.com/owasp-amass/open-asset-model/org\"\n)\n\nvar createOrgLock sync.Mutex\n\nfunc CreateOrgAsset(sess et.Session, obj *dbt.Entity, rel oam.Relation, o *oamorg.Organization, src *et.Source) (*dbt.Entity, error) {\n\tcreateOrgLock.Lock()\n\tdefer createOrgLock.Unlock()\n\n\tif o == nil || o.Name == \"\" {\n\t\treturn nil, errors.New(\"missing the organization name\")\n\t} else if src == nil {\n\t\treturn nil, errors.New(\"missing the source\")\n\t}\n\n\torgent, err := FindOrgByNameClaim(sess, o.Name, src)\n\tif err != nil && o.LegalName != \"\" {\n\t\torgent, _ = FindOrgByLegalNameClaim(sess, o.LegalName, src)\n\t}\n\n\tnormName := genNormName(o)\n\tif o.Jurisdiction != \"\" {\n\t\t// attempt to normalize the jurisdiction country\n\t\tif code := countries.ByName(o.Jurisdiction); code.IsValid() {\n\t\t\to.Jurisdiction = code.Alpha2()\n\t\t}\n\t\tif o.RegistrationID != \"\" {\n\t\t\torgent, _ = FindOrgByJurisdictionAndRegistrationIDClaim(sess, o.Jurisdiction, o.RegistrationID)\n\t\t}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/org.go#L13-L49","documentation":"CreateOrgAsset is the public entry point for finding-or-creating an Organization asset, and it requires a non-nil Organization with a non-empty Name to key the lookup and claim creation. If o is nil or o.Name is empty, it immediately returns this error before touching the graph.","triggerScenarios":"Any caller (createOrgInvestors, getOrganization, storeEntity, storeContact, store) invoking CreateOrgAsset with o == nil or an Organization whose Name field is \"\". LegalName alone is NOT sufficient — Name is mandatory.","commonSituations":"Passing a zero-value Organization struct; parsing source data (RDAP, filings) where the name field was absent; building the struct from a map/JSON and missing the 'name' key; accidentally swapping Name/LegalName arguments.","solutions":["Set o.Name before calling CreateOrgAsset (use LegalName only as an additional match key)","Guard call sites: skip org creation when the extracted name is empty","Validate/trim names during data extraction so whitespace-only values are rejected","If only a legal name is available, copy it into Name as well"],"exampleFix":"// before\nCreateOrgAsset(sess, obj, rel, &oamorg.Organization{LegalName: \"Acme Ltd\"}, src)\n\n// after\norg := &oamorg.Organization{Name: \"Acme Ltd\", LegalName: \"Acme Ltd\"}\nCreateOrgAsset(sess, obj, rel, org, src)","handlingStrategy":"validation","validationCode":"func canCreateOrg(o *oamorg.Organization) bool {\n    return o != nil && strings.TrimSpace(o.Name) != \"\"\n}","typeGuard":"func hasOrgName(o *oamorg.Organization) bool {\n    return o != nil && o.Name != \"\"\n}","tryCatchPattern":null,"preventionTips":["Validate o.Name is non-empty at every call site of CreateOrgAsset","Copy LegalName into Name when only a legal name is available","Reject whitespace-only names during data extraction"],"tags":["go","validation","missing-name","organization"],"backgroundTag":"missing-required-argument","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}