{"record":{"id":"6c6efe1bae4e7ff5","repo":"owasp-amass/amass","slug":"missing-the-source","errorCode":null,"errorMessage":"missing the source","messagePattern":"missing the source","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/support/org/org.go","lineNumber":33,"sourceCode":"\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}\n\t\tif orgent == nil {\n\t\t\torgent, _ = FindOrgByNormNameAndJurisdictionClaim(sess, normName, o.Jurisdiction)","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/org/org.go#L15-L51","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Construct an et.Source with at least Name and Confidence from your data provider and pass it in","Thread the source through helper functions so it isn't dropped between store and CreateOrgAsset","In tests, use a canonical test source (e.g. &et.Source{Name: \"test\", Confidence: 100}) instead of nil","Add an assertion early in your pipeline that src != nil before any asset creation"],"exampleFix":"// before\nCreateOrgAsset(sess, obj, rel, org, nil)\n\n// after\nsrc := &et.Source{Name: \"rdap-verisign\", Confidence: 90}\nCreateOrgAsset(sess, obj, rel, org, src)","handlingStrategy":"validation","validationCode":"if src == nil {\n    return fmt.Errorf(\"et.Source is required for asset creation\")\n}\nCreateOrgAsset(sess, obj, rel, org, src)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build an et.Source with Name and Confidence before ingestion","Thread src through helper chains; never pass nil as a placeholder","Use a canonical non-nil source in tests"],"tags":["go","missing-argument","provenance","source"],"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-14T00:17:10.932Z"}