owasp-amass/amass · error

config options are not initialized

Error message

config options are not initialized

What it means

loadEngineSettings found c.Options nil: the configuration's option map was never populated before attempting to read the 'engine' key. This is a precondition guard — it fires when configuration loading/initialization was skipped or failed earlier, not because of anything wrong with the engine setting itself.

Source

Thrown at config/engineapi.go:43

	Options  string // Extra options used while connecting to the Engine API
}

const (
	engineUser   = "AMASS_ENGINE_USER"
	enginePass   = "AMASS_ENGINE_PASSWORD"
	engineHost   = "AMASS_ENGINE_HOST"
	enginePort   = "AMASS_ENGINE_PORT"
	enginePath   = "AMASS_ENGINE_PATH"
	engineScheme = "AMASS_ENGINE_SCHEME"
)

// loadEngineSettings is responsible for extracting the "engine" URL from the application's configuration
// and initializing the EngAPI structure. It performs several checks such as ensuring the configuration options
// are initialized and the "engine" key is present and of type string. If any of these checks fail, an error is returned.
func (c *Config) loadEngineSettings(cfg *Config) error {
	// Check if configuration options are initialized; if not, return an error.
	if c.Options == nil {
		return fmt.Errorf("config options are not initialized")
	}
	// Attempt to retrieve the "engine" value from the configuration options.
	apiURIInterface, ok := c.Options["engine"]
	if !ok {
		return c.LoadEngineEnvSettings()
	}
	// Assert that the "engine" option is of type string; if not, return an error specifying the incorrect type received.
	apiURI, ok := apiURIInterface.(string)
	if !ok {
		return fmt.Errorf("expected 'engine' to be a string, got %T", apiURIInterface)
	}
	// Load the Engine API URI information into the EngAPI structure.
	// If there's an error during this process, it's returned to the calling function.
	if err := c.loadEngineURI(apiURI); err != nil {
		return err
	}
	return nil
}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Ensure the Config was fully initialized (options loaded from file/CLI/env) before loadEngineSettings runs
  2. Check the earlier configuration loading step for a swallowed error that left Options nil
  3. Fail fast at startup with a clear 'configuration not loaded' error instead of relying on this guard
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at config/engineapi.go:43 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/b380e6f2f19a3aac. Report an issue: GitHub.