{"record":{"id":"057cd04ee8a3ef5c","repo":"owasp-amass/amass","slug":"failed-to-parse-active-setting-value-is-not-a-boo","errorCode":null,"errorMessage":"failed to parse active setting, value is not a boolean","messagePattern":"failed to parse active setting, value is not a boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/active.go","lineNumber":19,"sourceCode":"// Copyright © by Jeff Foley 2017-2026. All rights reserved.\n// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.\n// SPDX-License-Identifier: Apache-2.0\n\npackage config\n\nimport \"fmt\"\n\nfunc (c *Config) loadActiveSettings(cfg *Config) error {\n\t// Retrieve the active option from the configuration\n\tactiveinterface, ok := c.Options[\"active\"]\n\tif !ok {\n\t\t// \"active\" not found in options, so nothing to do here\n\t\treturn nil\n\t}\n\n\tactive, ok := activeinterface.(bool)\n\tif !ok {\n\t\treturn fmt.Errorf(\"failed to parse active setting, value is not a boolean\")\n\t}\n\n\tc.Active = active\n\treturn nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/active.go#L1-L25","documentation":"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.","triggerScenarios":"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{}.","commonSituations":"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.","solutions":["Edit the config file so the active key is an unquoted boolean: active: true","Remove the \"active\" key entirely if you want the default (missing keys are skipped)","If building Options in code, pass an actual bool: Options[\"active\"] = true","Add a validation pass over loaded options to reject non-bool values with a clearer message"],"exampleFix":"# before (config.yaml)\nactive: \"true\"\n\n# after\nactive: true","handlingStrategy":"validation","validationCode":"func validateActiveSetting(options map[string]interface{}) error {\n\tv, ok := options[\"active\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, ok := v.(bool); !ok {\n\t\treturn fmt.Errorf(\"active must be an unquoted boolean, got %T\", v)\n\t}\n\treturn nil\n}","typeGuard":"func isBool(v interface{}) bool { _, ok := v.(bool); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tvar parseErr interface{}\n\tif strings.Contains(err.Error(), \"value is not a boolean\") {\n\t\t// correct the config file, then retry\n\t}\n\t_ = parseErr\n\tlog.Fatal(err)\n}","preventionTips":["Never quote booleans in the config file","Validate the config with a schema check before running the tool","Use a YAML editor/linter that highlights quoted booleans","Keep type expectations documented next to each option in the sample config"],"tags":["go","config","type-assertion","boolean"],"backgroundTag":"config-type-mismatch","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}