{"record":{"id":"4c6fde1996e8c5d3","repo":"hashicorp/nomad","slug":"failed-to-parse-s-as-bool-s","errorCode":null,"errorMessage":"Failed to parse %s as bool: %s","messagePattern":"Failed to parse (.+?) as bool: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/config/config.go","lineNumber":1010,"sourceCode":"\tfor _, id := range ids {\n\t\tval, ok := c.Options[id]\n\t\tif ok {\n\t\t\treturn val\n\t\t}\n\t}\n\n\treturn defaultValue\n}\n\n// ReadBool parses the specified option as a boolean.\nfunc (c *Config) ReadBool(id string) (bool, error) {\n\tval, ok := c.Options[id]\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"Specified config is missing from options\")\n\t}\n\tbval, err := strconv.ParseBool(val)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"Failed to parse %s as bool: %s\", val, err)\n\t}\n\treturn bval, nil\n}\n\n// ReadBoolDefault tries to parse the specified option as a boolean. If there is\n// an error in parsing, the default option is returned.\nfunc (c *Config) ReadBoolDefault(id string, defaultValue bool) bool {\n\tval, err := c.ReadBool(id)\n\tif err != nil {\n\t\treturn defaultValue\n\t}\n\treturn val\n}\n\n// ReadInt parses the specified option as a int.\nfunc (c *Config) ReadInt(id string) (int, error) {\n\tval, ok := c.Options[id]\n\tif !ok {","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/config/config.go#L992-L1028","documentation":"Config.ReadBool looks up a client option by id and parses it with strconv.ParseBool; this error fires when the option exists but its value is not a recognizable boolean (accepted: 1/t/T/true/0/f/F/false). Callers using ReadBoolDefault silently fall back instead.","triggerScenarios":"Thrown at client/config/config.go:1010 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the client option to a valid boolean string (true/false/1/0)","Use ReadBoolDefault where a fallback is acceptable","Validate the option value at agent config load time"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}