{"record":{"id":"b8d1f1fb35a64897","repo":"txthinking/brook","slug":"blockcidr6list-must-be-with-absolute-path","errorCode":null,"errorMessage":"--blockCIDR6List must be with absolute path","messagePattern":"--blockCIDR6List must be with absolute path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/brook/main.go","lineNumber":273,"sourceCode":"\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()\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t},\n\t\t\t\t})","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/txthinking/brook/blob/5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8/cli/brook/main.go#L255-L291","documentation":"This is a CLI startup validation guard in the brook command: when --blockCIDR6List is given as a relative filesystem path the command refuses to start, because the block list file must be addressable unambiguously regardless of the working directory (the same pattern also allows http:// or https:// URLs). The input at fault is a relative --blockCIDR6List value; pass an absolute path (or an http(s) URL).","triggerScenarios":"--blockCIDR6List cidr6.txt or another relative path lacking an http(s):// prefix while non-empty.","commonSituations":"Relative paths in compose/unit files; forgetting the scheme for hosted lists; mismatch between dev and production working directories.","solutions":["Use an absolute path: --blockCIDR6List /etc/brook/cidr6.txt","Use an http(s) URL for the list","Make the launch script emit absolute paths"],"exampleFix":"// before\nbrook server -l :9999 --blockCIDR6List cidr6.txt\n// after\nbrook server -l :9999 --blockCIDR6List /etc/brook/cidr6.txt","handlingStrategy":"validation","validationCode":"if v := blockCIDR6List; v != \"\" && !strings.HasPrefix(v, \"http://\") && !strings.HasPrefix(v, \"https://\") && !filepath.IsAbs(v) {\n\treturn fmt.Errorf(\"--blockCIDR6List must be URL or absolute path, got %q\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply the URL-or-absolute-path rule to all three block list flags","Standardize list storage location across environments","Add flag validation to deployment scripts before rollout"],"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"}