{"record":{"id":"64988733ab1601f5","repo":"AdguardTeam/AdGuardHome","slug":"unknown-option-type-q","errorCode":null,"errorMessage":"unknown option type %q","messagePattern":"unknown option type %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dhcpd/options_unix.go","lineNumber":148,"sourceCode":"\t\tval, err = parseDHCPOptionBool(valStr)\n\tcase typDel:\n\t\tval = dhcpv4.OptionGeneric{Data: nil}\n\tcase typDur:\n\t\tval, err = parseDHCPOptionDur(valStr)\n\tcase typHex:\n\t\tval, err = parseDHCPOptionHex(valStr)\n\tcase typIP:\n\t\tval, err = parseDHCPOptionIP(valStr)\n\tcase typIPs:\n\t\tval, err = parseDHCPOptionIPs(valStr)\n\tcase typText:\n\t\tval = dhcpv4.String(valStr)\n\tcase typU8:\n\t\tval, err = parseDHCPOptionUint(valStr, 8)\n\tcase typU16:\n\t\tval, err = parseDHCPOptionUint(valStr, 16)\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown option type %q\", typ)\n\t}\n\n\treturn val, err\n}\n\n// parseDHCPOption parses an option.  For the del option value is ignored.  The\n// examples of possible option strings:\n//\n//   - 1  bool true\n//   - 2  del\n//   - 3  dur  2h5s\n//   - 4  hex  736f636b733a2f2f70726f78792e6578616d706c652e6f7267\n//   - 5  ip   192.168.1.1\n//   - 6  ips  192.168.1.1,192.168.1.2\n//   - 7  text http://192.168.1.1/wpad.dat\n//   - 8  u8   255\n//   - 9  u16  65535\nfunc parseDHCPOption(s string) (code dhcpv4.OptionCode, val dhcpv4.OptionValue, err error) {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/dhcpd/options_unix.go#L130-L166","documentation":"Returned by parseDHCPOptionVal when an option's declared type is not one of the known types (ip, ips, hex, dur, u8, u16, bool, string). The message prints the offending type with %q so unexpected whitespace or case is visible ('Bool ' vs 'bool').","triggerScenarios":"Typing the type incorrectly: 'IP' instead of 'ip', 'uint8' instead of 'u8', 'int' — plus trailing spaces or tabs inside the type token when parsing 'code:type:value' strings.","commonSituations":"Writing options in the CLI/YAML shorthand where a stray space splits the token; guessing type names instead of checking docs; version drift after new types were introduced/renamed.","solutions":["Use exactly the documented lowercase type names: ip, ips, hex, dur, u8, u16, bool, string","In 'code:type:value' string form, ensure no spaces around the colons (parts are not trimmed)","Check the current list of supported types in the codebase's typ* constants or docs for your version"],"exampleFix":"// before\n\"type\":\"uint8\"\n// -> unknown option type \"uint8\"\n\n// after\n\"type\":\"u8\"","handlingStrategy":"type-guard","validationCode":"var validOptTypes = map[string]bool{\"ip\":true,\"ips\":true,\"hex\":true,\"dur\":true,\"u8\":true,\"u16\":true,\"bool\":true,\"string\":true}\nif !validOptTypes[typ] { /* reject before submitting */ }","typeGuard":"func isValidOptionType(t string) bool {\n\tswitch t {\n\tcase \"ip\", \"ips\", \"hex\", \"dur\", \"u8\", \"u16\", \"bool\", \"string\":\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Use exact lowercase type tokens (ip, ips, hex, dur, u8, u16, bool, string)","No spaces around colons in 'code:type:value' strings","Pin the supported-type list from the version you run"],"tags":["dhcp","options","validation","configuration","enum"],"backgroundTag":"unknown-config-enum-value","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}