{"record":{"id":"953bd46224543fa8","repo":"txthinking/brook","slug":"ip-unknown","errorCode":null,"errorMessage":"${ip} unknown","messagePattern":"(.+?) unknown","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/brook/main.go","lineNumber":2735,"sourceCode":"\t\t\t\t\tUsage: \"1.1.1.1\",\n\t\t\t\t},\n\t\t\t\t&cli.BoolFlag{\n\t\t\t\t\tName:  \"example\",\n\t\t\t\t\tUsage: \"Show a minimal example of usage\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tAction: func(c *cli.Context) error {\n\t\t\t\tif c.Bool(\"example\") {\n\t\t\t\t\tfmt.Println(\"brook ipcountry --ip 1.2.3.4\")\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tip := net.ParseIP(c.String(\"ip\"))\n\t\t\t\tif ip == nil {\n\t\t\t\t\treturn errors.New(c.String(\"ip\") + \" is not IP\")\n\t\t\t\t}\n\t\t\t\ts := iploc.Country(ip)\n\t\t\t\tif s == \"\" {\n\t\t\t\t\treturn errors.New(c.String(\"ip\") + \" unknown\")\n\t\t\t\t}\n\t\t\t\tfmt.Println(s)\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t&cli.Command{\n\t\t\tName:  \"completion\",\n\t\t\tUsage: \"Generate shell completions\",\n\t\t\tFlags: []cli.Flag{\n\t\t\t\t&cli.StringFlag{\n\t\t\t\t\tName:    \"file\",\n\t\t\t\t\tAliases: []string{\"f\"},\n\t\t\t\t\tUsage:   \"Write to file\",\n\t\t\t\t\tValue:   \"brook_autocomplete\",\n\t\t\t\t},\n\t\t\t\t&cli.BoolFlag{\n\t\t\t\t\tName:  \"example\",\n\t\t\t\t\tUsage: \"Show a minimal example of usage\",","sourceCodeStart":2717,"sourceCodeEnd":2753,"githubUrl":"https://github.com/txthinking/brook/blob/5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8/cli/brook/main.go#L2717-L2753","documentation":"Lookup failure in the ipcountry subcommand: the --ip value parsed as a valid IP, but iploc.Country returned an empty string, meaning the IP is not present in the bundled IP-to-country database (common for private/reserved ranges or IPs newer than the data). Not a syntax error like the preceding 'is not IP' check.","triggerScenarios":"Thrown at cli/brook/main.go:2735 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the IP is a public, assigned address (private/reserved ranges have no country)","Try a different public IP to verify the tool works","Update brook/iploc data if the IP was recently allocated"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8","analyzedAt":"2026-09-06T04:35:00.432Z","contentChangedAt":"2026-09-06T04:35:00.432Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}