owasp-amass/amass · error

config options are not initialized

Error message

config options are not initialized

What it means

loadDatabaseSettings found c.Options nil: the configuration option map was never initialized before the 'database' key lookup. Like its engine counterpart, it is a precondition guard indicating earlier configuration loading did not run or failed silently — the database URI value itself is not the problem.

Source

Thrown at config/graphdb.go:37

	Username string `json:"username,omitempty"` // Username for authentication
	Password string `json:"password,omitempty"` // Password for authentication
	Host     string `json:"host,omitempty"`     // Host of the database
	Port     string `json:"port,omitempty"`     // Port of the database
	DBName   string `json:"db_name,omitempty"`  // Name of the database
	Options  string `json:"options,omitempty"`  // Extra options used while connecting to the database
}

const (
	amassUser   = "AMASS_DB_USER"
	amassPass   = "AMASS_DB_PASSWORD"
	assetDB     = "AMASS_DB_HOST"
	assetPort   = "AMASS_DB_PORT"
	assetDBName = "AMASS_DB_NAME"
)

func (c *Config) loadDatabaseSettings(cfg *Config) error {
	if c.Options == nil {
		return fmt.Errorf("config options are not initialized")
	}

	dbURIInterface, ok := c.Options["database"]
	if !ok {
		if err := c.LoadDatabaseEnvSettings(); err != nil {
			return nil
		}
	}

	dbURI, ok := dbURIInterface.(string)
	if !ok {
		return fmt.Errorf("expected 'database' to be a string, got %T", dbURIInterface)
	}

	if _, err := url.Parse(dbURI); err == nil {
		if err := c.loadDatabase(dbURI); err != nil {
			return err
		}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Initialize/populate Config.Options from the config file, CLI flags, or env before loadDatabaseSettings runs
  2. Audit the configuration pipeline for swallowed errors that leave Options nil
  3. Consider defaulting Options to an empty map at construction so lookups return 'not found' instead of erroring
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at config/graphdb.go:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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