owasp-amass/amass · error
error mapping configuration settings to internal values: %v
Error message
error mapping configuration settings to internal values: %v
What it means
After reading the file, LoadSettings unmarshals the YAML into the Config struct with yaml.Unmarshal. If the document is not valid YAML or contains fields incompatible with the struct, it returns 'error mapping configuration settings to internal values'. Env-based database/engine settings are still applied before returning.
Source
Thrown at config/config.go:280
_ = c.LoadDatabaseEnvSettings()
_ = c.LoadEngineEnvSettings()
return fmt.Errorf("failed to get absolute path of the configuration file: %v", err)
}
c.Filepath = absolutePath
// Open the configuration file
data, err := os.ReadFile(c.Filepath)
if err != nil {
_ = c.LoadDatabaseEnvSettings()
_ = c.LoadEngineEnvSettings()
return fmt.Errorf("failed to load the main configuration file: %v", err)
}
err = yaml.Unmarshal(data, c)
if err != nil {
_ = c.LoadDatabaseEnvSettings()
_ = c.LoadEngineEnvSettings()
return fmt.Errorf("error mapping configuration settings to internal values: %v", err)
}
if err := c.loadSeedandScopeSettings(); err != nil {
return err
}
loads := []func(cfg *Config) error{
c.loadAlterationSettings,
c.loadBruteForceSettings,
c.loadDatabaseSettings,
c.loadDataSourceSettings,
c.loadResolverSettings,
c.loadTransformSettings,
c.loadEngineSettings,
c.loadActiveSettings,
c.loadRigidSettings,
}
for _, load := range loads {View on GitHub (pinned to 79299dce87)
Solutions
- Validate the file with a YAML linter: `yamllint config.yaml` or an online parser, and fix the reported line.
- Replace tab characters with spaces — tabs are illegal YAML indentation.
- Check that each key's value type matches the expected structure (maps vs lists vs scalars).
- Bisect by loading the file with a minimal yaml.Unmarshal in a scratch program to get the precise parser error.
Example fix
// before (config.yaml) scopes: - example.com # tab indentation // after scopes: - example.com
Defensive patterns
Strategy: validation
Validate before calling
raw, err := os.ReadFile(cfgPath)
if err != nil { return err }
var probe map[string]any
if err := yaml.Unmarshal(raw, &probe); err != nil {
return fmt.Errorf("config YAML invalid: %w", err)
} Try / catch
if err := cfg.LoadSettings(path); err != nil {
if strings.Contains(err.Error(), "error mapping configuration settings to internal values") {
// run the raw YAML through yaml.Unmarshal directly to get the exact line/column
}
return err
} Prevention
- Lint configs with yamllint or a YAML parser in CI
- Use spaces, never tabs, for YAML indentation
- Quote values that could parse as numbers/booleans
- Round-trip generated configs through a YAML parser before deploy
When it happens
Trigger: LoadSettings called with a config file containing invalid YAML syntax (bad indentation, tabs, unclosed quotes), duplicate keys rejected by the parser, or a scalar where the struct expects a map/list.
Common situations: Hand-edited YAML with mixed tabs/spaces; generated config where interpolation produced invalid YAML; pasting JSON-style content with unquoted values; upgrading between versions where a field's type changed.
Related errors
- alterations wordlist_file item is not a string
- datasources option is not a string
- brute forcing cannot be performed without DNS resolution
- active enumeration cannot be performed without DNS resolutio
- resolvers section is not a list
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/e2aab1e261c796e2.
Report an issue: GitHub.