{"record":{"id":"ca971500a5b3bed4","repo":"owasp-amass/amass","slug":"config-seed-and-scope-are-not-initialized","errorCode":null,"errorMessage":"config seed and scope are not initialized","messagePattern":"config seed and scope are not initialized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"config/scope.go","lineNumber":22,"sourceCode":"\npackage config\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/caffix/stringset\"\n\tamassnet \"github.com/owasp-amass/amass/v5/internal/net\"\n\t\"github.com/owasp-amass/amass/v5/internal/net/dns\"\n)\n\nfunc (c *Config) loadSeedandScopeSettings() error {\n\tif c.Seed == nil || c.Seed.isScopeEmpty(false) {\n\t\tif c.Scope == nil {\n\t\t\treturn fmt.Errorf(\"config seed and scope are not initialized\")\n\t\t} else {\n\t\t\tif err := c.Scope.populate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tc.Seed = c.Scope\n\t\t\treturn nil\n\t\t}\n\t} else if err := c.Seed.populate(); err != nil {\n\t\treturn err\n\t}\n\n\tif c.Scope == nil || !c.Scope.isScopeEmpty(true) {\n\t\tif err := c.Seed.populate(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Scope = c.Seed\n\t\tc.Scope.Ports = []int{80, 443}\n\t\treturn nil","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/scope.go#L4-L40","documentation":"loadSeedandScopeSettings requires that either a Seed or a Scope is configured. If Seed is nil or empty and Scope is also nil, there is no target universe to work from, so the error is returned. If Scope exists, it is populated and used as the Seed.","triggerScenarios":"LoadSettings is called on a Config where neither Seed nor Scope was set (both nil), or Seed exists but isScopeEmpty(false) is true while Scope is nil.","commonSituations":"Creating a Config programmatically and forgetting to call NewScope/NewSeed or set domains; loading an empty/minimal config file with no scope section; older configs missing the seed field after a version upgrade.","solutions":["Set a Scope on the config (e.g. cfg.Scope = amass.NewScope() and add domains/ASNs) before loading settings","Set a Seed with target domains so the check passes","Add a scope/seed section to the config file if loading from YAML/JSON"],"exampleFix":"// before\ncfg := amass.NewConfig()\ncfg.LoadSettings(\"amass.ini\") // Seed and Scope nil\n// after\ncfg := amass.NewConfig()\ncfg.Scope = amass.NewScope()\ncfg.Scope.AddDomain(\"example.com\")\ncfg.LoadSettings(\"amass.ini\")","handlingStrategy":"validation","validationCode":"if cfg.Seed == nil && cfg.Scope == nil { return errors.New(\"config requires Seed or Scope before LoadSettings\") }","typeGuard":"func hasTarget(c *Config) bool { return c.Seed != nil || c.Scope != nil }","tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil {\n    if strings.Contains(err.Error(), \"seed and scope\") { cfg.Scope = amass.NewScope() /* retry */ }\n    return err\n}","preventionTips":["Always initialize Scope with at least one domain before LoadSettings","Add scope/seed sections to config templates","Add an init-time assertion in construction helpers","Check upgrade guides when Seed layout changed between versions"],"tags":["config","initialization","scope"],"backgroundTag":"missing-required-config","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"}