{"record":{"id":"34cc5ba54143581e","repo":"txthinking/brook","slug":"blockdomainlist-must-be-with-absolute-path","errorCode":null,"errorMessage":"--blockDomainList must be with absolute path","messagePattern":"--blockDomainList must be with absolute path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/brook/main.go","lineNumber":267,"sourceCode":"\t\t\t\t\tif len(l) != 2 {\n\t\t\t\t\t\treturn errors.New(\"Invalid tag \" + v)\n\t\t\t\t\t}\n\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","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/txthinking/brook/blob/5cd13ef3b1fb574e88ebf2c1b5d95f2ebe1342c8/cli/brook/main.go#L249-L285","documentation":"--blockDomainList accepts a local file or an http(s) URL. If the value is non-empty, not an http(s) URL, and not an absolute filesystem path, the CLI rejects it at startup. This ensures block list sources are unambiguously fetchable/readable.","triggerScenarios":"Running a subcommand with --blockDomainList set to a relative path like lists/domains.txt, or any value that lacks both an http(s):// prefix and an absolute path.","commonSituations":"Relative paths in example configs; forgetting the http(s):// scheme for remote lists; working-directory assumptions in scripts.","solutions":["Use an absolute path: --blockDomainList /etc/brook/blockdomains.txt","Use a full URL: --blockDomainList https://example.com/blockdomains.txt","Resolve the path in your wrapper: --blockDomainList \"$PWD/lists/domains.txt\""],"exampleFix":"// before\nbrook server -l :9999 --blockDomainList lists/domains.txt\n// after\nbrook server -l :9999 --blockDomainList /etc/brook/lists/domains.txt","handlingStrategy":"validation","validationCode":"if v := blockDomainList; v != \"\" && !strings.HasPrefix(v, \"http://\") && !strings.HasPrefix(v, \"https://\") && !filepath.IsAbs(v) {\n\treturn fmt.Errorf(\"--blockDomainList must be URL or absolute path, got %q\", v)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths or http(s) URLs for all block lists","Avoid relative paths in unit/compose files","Validate list paths in CI by dry-running the CLI"],"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-14T00:17:10.932Z"}