owasp-amass/amass · error

missing the source

Error message

missing the source

What it means

CreateOrgAsset requires a non-nil *et.Source to record provenance (source name and confidence) on the name/jurisdiction claims it creates. If src is nil, it returns this error because claims without attribution would corrupt the graph's trust model.

Source

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

	"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)
		}
		if orgent == nil {
			orgent, _ = FindOrgByNormNameAndJurisdictionClaim(sess, normName, o.Jurisdiction)

View on GitHub (pinned to 79299dce87)

Solutions

  1. Construct an et.Source with at least Name and Confidence from your data provider and pass it in
  2. Thread the source through helper functions so it isn't dropped between store and CreateOrgAsset
  3. In tests, use a canonical test source (e.g. &et.Source{Name: "test", Confidence: 100}) instead of nil
  4. Add an assertion early in your pipeline that src != nil before any asset creation

Example fix

// before
CreateOrgAsset(sess, obj, rel, org, nil)

// after
src := &et.Source{Name: "rdap-verisign", Confidence: 90}
CreateOrgAsset(sess, obj, rel, org, src)
Defensive patterns

Strategy: validation

Validate before calling

if src == nil {
    return fmt.Errorf("et.Source is required for asset creation")
}
CreateOrgAsset(sess, obj, rel, org, src)

Prevention

When it happens

Trigger: Invoking CreateOrgAsset without constructing an et.Source — e.g. passing nil because the caller had no source metadata, or forgetting to thread the source from the plugin's ingestion context into the store helper chain (store -> storeEntity -> getOrganization).

Common situations: Ad-hoc scripts calling the API directly without building an et.Source; refactors that drop the src parameter along the call chain; tests that pass nil for convenience.

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/6c6efe1bae4e7ff5. Report an issue: GitHub.