{"record":{"id":"32749efea9aede2d","repo":"slackhq/nebula","slug":"config-s-interfaces-has-invalid-value-type-t","errorCode":null,"errorMessage":"config `%s.interfaces` has invalid value (type %T): %v","messagePattern":"config `(.+?)\\.interfaces` has invalid value \\(type %T\\): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"allow_list.go","lineNumber":184,"sourceCode":"\t}\n\n\treturn &AllowList{cidrTree: tree}, nil\n}\n\nfunc getAllowListInterfaces(k string, v any) ([]AllowListNameRule, error) {\n\tvar nameRules []AllowListNameRule\n\n\trawRules, ok := v.(map[string]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"config `%s.interfaces` is invalid (type %T): %v\", k, v, v)\n\t}\n\n\tfirstEntry := true\n\tvar allValues bool\n\tfor name, rawAllow := range rawRules {\n\t\tallow, ok := config.AsBool(rawAllow)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"config `%s.interfaces` has invalid value (type %T): %v\", k, rawAllow, rawAllow)\n\t\t}\n\n\t\tnameRE, err := regexp.Compile(\"^\" + name + \"$\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"config `%s.interfaces` has invalid key: %s: %v\", k, name, err)\n\t\t}\n\n\t\tnameRules = append(nameRules, AllowListNameRule{\n\t\t\tName:  nameRE,\n\t\t\tAllow: allow,\n\t\t})\n\n\t\tif firstEntry {\n\t\t\tallValues = allow\n\t\t\tfirstEntry = false\n\t\t} else {\n\t\t\tif allow != allValues {\n\t\t\t\treturn nil, fmt.Errorf(\"config `%s.interfaces` values must all be the same true/false value\", k)","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/allow_list.go#L166-L202","documentation":"Validation error from getAllowListInterfaces: a value inside the `<key>.interfaces` map (the per-interface allow/deny rule) could not be coerced to a boolean by config.AsBool. The offending entry is rawAllow, whose dynamic Go type is shown in the message — e.g. a list or nested map where true/false (or a string form of them) was expected.","triggerScenarios":"getAllowListInterfaces encountering an entry like eth0: \"yes\", eth0: 1, or a nested map under an interface name.","commonSituations":"Unquoted yes/no strings, numeric flags, or pasting rules from other tools that use accept/deny semantics.","solutions":["Change every interface value to literal true or false","Unquote values so YAML/JSON parses them as booleans","Check the type %T in the message to see what the value parsed as"],"exampleFix":"// before\ninterfaces:\n  eth0: \"yes\"\n// after\ninterfaces:\n  eth0: true","handlingStrategy":"validation","validationCode":"func interfaceValuesAreBool(m map[string]any) bool {\n\tfor _, v := range m {\n\t\tif _, ok := v.(bool); !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}","typeGuard":"func isBool(v any) bool { _, ok := v.(bool); return ok }","tryCatchPattern":null,"preventionTips":["Use JSON/YAML booleans only for interface entries","Validate the whole config with a schema linter"],"tags":["config","validation","interfaces","allowlist"],"backgroundTag":"invalid-config-value","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}