owasp-amass/amass · error

failed to parse active setting, value is not a boolean

Error message

failed to parse active setting, value is not a boolean

What it means

During configuration loading, Config.loadActiveSettings reads the "active" key from the options map and asserts it is a bool before assigning it to Config.Active. The assertion `activeinterface.(bool)` failed because the value stored under "active" is of some other type (string, number, etc.). This library throws it to fail fast on a malformed config rather than silently treating the setting as false.

Source

Thrown at config/active.go:19

// Copyright © by Jeff Foley 2017-2026. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// SPDX-License-Identifier: Apache-2.0

package config

import "fmt"

func (c *Config) loadActiveSettings(cfg *Config) error {
	// Retrieve the active option from the configuration
	activeinterface, ok := c.Options["active"]
	if !ok {
		// "active" not found in options, so nothing to do here
		return nil
	}

	active, ok := activeinterface.(bool)
	if !ok {
		return fmt.Errorf("failed to parse active setting, value is not a boolean")
	}

	c.Active = active
	return nil
}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Edit the config file so the active key is an unquoted boolean: active: true
  2. Remove the "active" key entirely if you want the default (missing keys are skipped)
  3. If building Options in code, pass an actual bool: Options["active"] = true
  4. Add a validation pass over loaded options to reject non-bool values with a clearer message

Example fix

# before (config.yaml)
active: "true"

# after
active: true
Defensive patterns

Strategy: validation

Validate before calling

func validateActiveSetting(options map[string]interface{}) error {
	v, ok := options["active"]
	if !ok {
		return nil
	}
	if _, ok := v.(bool); !ok {
		return fmt.Errorf("active must be an unquoted boolean, got %T", v)
	}
	return nil
}

Type guard

func isBool(v interface{}) bool { _, ok := v.(bool); return ok }

Try / catch

if err := cfg.LoadSettings(); err != nil {
	var parseErr interface{}
	if strings.Contains(err.Error(), "value is not a boolean") {
		// correct the config file, then retry
	}
	_ = parseErr
	log.Fatal(err)
}

Prevention

When it happens

Trigger: Loading a configuration where c.Options["active"] exists but its value is not a Go bool, e.g. a YAML/TOML value like active: "true" (string) or active: 1 (integer) parsed into map[string]interface{}.

Common situations: Hand-edited config files quoting booleans ("true" instead of true); config generated programmatically with an int; a schema/version change where "active" used to be a different type; environment-variable interpolation producing strings.

Understand the failure class

Related errors


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