{"record":{"id":"dc12a9ae11f31b62","repo":"txthinking/brook","slug":"blockcidr4list-must-be-with-absolute-path","errorCode":null,"errorMessage":"--blockCIDR4List must be with absolute path","messagePattern":"--blockCIDR4List must be with absolute path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/brook/main.go","lineNumber":270,"sourceCode":"\t\t\t\t\tm[l[0]] = l[1]\n\t\t\t\t}\n\t\t\t}\n\t\t\tp := prometheus.NewPrometheus(c.String(\"prometheus\"), c.String(\"prometheusPath\"), m)\n\t\t\tp.TouchBrook()\n\t\t\tg.Add(&runnergroup.Runner{\n\t\t\t\tStart: func() error {\n\t\t\t\t\treturn p.ListenAndServe()\n\t\t\t\t},\n\t\t\t\tStop: func() error {\n\t\t\t\t\treturn p.Shutdown()\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t\tif c.String(\"blockDomainList\") != \"\" && !strings.HasPrefix(c.String(\"blockDomainList\"), \"http://\") && !strings.HasPrefix(c.String(\"blockDomainList\"), \"https://\") && !filepath.IsAbs(c.String(\"blockDomainList\")) {\n\t\t\treturn errors.New(\"--blockDomainList must be with absolute path\")\n\t\t}\n\t\tif c.String(\"blockCIDR4List\") != \"\" && !strings.HasPrefix(c.String(\"blockCIDR4List\"), \"http://\") && !strings.HasPrefix(c.String(\"blockCIDR4List\"), \"https://\") && !filepath.IsAbs(c.String(\"blockCIDR4List\")) {\n\t\t\treturn errors.New(\"--blockCIDR4List must be with absolute path\")\n\t\t}\n\t\tif c.String(\"blockCIDR6List\") != \"\" && !strings.HasPrefix(c.String(\"blockCIDR6List\"), \"http://\") && !strings.HasPrefix(c.String(\"blockCIDR6List\"), \"https://\") && !filepath.IsAbs(c.String(\"blockCIDR6List\")) {\n\t\t\treturn errors.New(\"--blockCIDR6List must be with absolute path\")\n\t\t}\n\t\tif c.String(\"blockDomainList\") != \"\" || c.String(\"blockCIDR4List\") != \"\" || c.String(\"blockCIDR6List\") != \"\" || len(c.StringSlice(\"blockGeoIP\")) != 0 {\n\t\t\tp, err := block.NewBlock(c.String(\"blockDomainList\"), c.String(\"blockCIDR4List\"), c.String(\"blockCIDR6List\"), c.StringSlice(\"blockGeoIP\"), c.Int(\"blockListUpdateInterval\"))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tp.TouchBrook()\n\t\t\tif c.Int(\"blockListUpdateInterval\") != 0 {\n\t\t\t\tg.Add(&runnergroup.Runner{\n\t\t\t\t\tStart: func() error {\n\t\t\t\t\t\tp.Update()\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t},\n\t\t\t\t\tStop: func() error {\n\t\t\t\t\t\tp.Stop()","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/txthinking/brook/blob/5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8/cli/brook/main.go#L252-L288","documentation":"Same validation as for blockDomainList applied to --blockCIDR4List: a non-empty value must be either an http(s):// URL or an absolute file path; relative paths abort startup. This list supplies IPv4 CIDRs to block.","triggerScenarios":"--blockCIDR4List cidr4.txt or any relative path without http(s):// prefix.","commonSituations":"Relative paths copied from local dev setups; missing scheme on remote CIDR lists; cron/systemd units with different CWD than interactive testing.","solutions":["Use an absolute path: --blockCIDR4List /etc/brook/cidr4.txt","Use an http(s) URL for remote lists","Resolve relative paths in the launch script before invoking brook"],"exampleFix":"// before\nbrook server -l :9999 --blockCIDR4List cidr4.txt\n// after\nbrook server -l :9999 --blockCIDR4List /etc/brook/cidr4.txt","handlingStrategy":"validation","validationCode":"if v := blockCIDR4List; v != \"\" && !strings.HasPrefix(v, \"http://\") && !strings.HasPrefix(v, \"https://\") && !filepath.IsAbs(v) {\n\treturn fmt.Errorf(\"--blockCIDR4List must be URL or absolute path, got %q\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Same rule as other block lists: absolute path or http(s) URL","Keep list files under a fixed absolute directory like /etc/brook/","Resolve paths in launch scripts before invoking brook"],"tags":["cli","path-validation","blocking"],"backgroundTag":"invalid-cli-argument","analyzedSha":"5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8","analyzedAt":"2026-09-06T04:35:00.432Z","contentChangedAt":"2026-09-06T04:35:00.432Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}