owasp-amass/amass · error

missing the organization name

Error message

missing the organization name

What it means

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.

Source

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

	"time"

	"github.com/biter777/countries"
	"github.com/google/uuid"
	et "github.com/owasp-amass/amass/v5/engine/types"
	dbt "github.com/owasp-amass/asset-db/types"
	oam "github.com/owasp-amass/open-asset-model"
	oamgen "github.com/owasp-amass/open-asset-model/general"
	oamorg "github.com/owasp-amass/open-asset-model/org"
)

var createOrgLock sync.Mutex

func CreateOrgAsset(sess et.Session, obj *dbt.Entity, rel oam.Relation, o *oamorg.Organization, src *et.Source) (*dbt.Entity, error) {
	createOrgLock.Lock()
	defer createOrgLock.Unlock()

	if o == nil || o.Name == "" {
		return nil, errors.New("missing the organization name")
	} else if src == nil {
		return nil, errors.New("missing the source")
	}

	orgent, err := FindOrgByNameClaim(sess, o.Name, src)
	if err != nil && o.LegalName != "" {
		orgent, _ = FindOrgByLegalNameClaim(sess, o.LegalName, src)
	}

	normName := genNormName(o)
	if o.Jurisdiction != "" {
		// attempt to normalize the jurisdiction country
		if code := countries.ByName(o.Jurisdiction); code.IsValid() {
			o.Jurisdiction = code.Alpha2()
		}
		if o.RegistrationID != "" {
			orgent, _ = FindOrgByJurisdictionAndRegistrationIDClaim(sess, o.Jurisdiction, o.RegistrationID)
		}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Set o.Name before calling CreateOrgAsset (use LegalName only as an additional match key)
  2. Guard call sites: skip org creation when the extracted name is empty
  3. Validate/trim names during data extraction so whitespace-only values are rejected
  4. If only a legal name is available, copy it into Name as well

Example fix

// before
CreateOrgAsset(sess, obj, rel, &oamorg.Organization{LegalName: "Acme Ltd"}, src)

// after
org := &oamorg.Organization{Name: "Acme Ltd", LegalName: "Acme Ltd"}
CreateOrgAsset(sess, obj, rel, org, src)
Defensive patterns

Strategy: validation

Validate before calling

func canCreateOrg(o *oamorg.Organization) bool {
    return o != nil && strings.TrimSpace(o.Name) != ""
}

Type guard

func hasOrgName(o *oamorg.Organization) bool {
    return o != nil && o.Name != ""
}

Prevention

When it happens

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

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

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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