{"record":{"id":"21c2565b010ba9a5","repo":"t8y2/dbx","slug":"name-must-contain-positive-integers","errorCode":null,"errorMessage":"{name} must contain positive integers","messagePattern":"(.+?) must contain positive integers","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/bench/agent_compare.py","lineNumber":640,"sourceCode":"    return path\n\n\ndef env_default(name: str, fallback: str) -> str:\n    return os.getenv(name, \"\") or fallback\n\n\ndef env_int(name: str, fallback: int) -> int:\n    value = int(env_default(name, str(fallback)))\n    if value < 1:\n        raise ValueError(f\"{name} must be positive\")\n    return value\n\n\ndef env_int_list(name: str, fallback: list[int]) -> list[int]:\n    raw = os.getenv(name, \"\")\n    values = fallback if not raw else [int(value.strip()) for value in raw.split(\",\")]\n    if not values or any(value < 1 for value in values):\n        raise ValueError(f\"{name} must contain positive integers\")\n    return values\n\n\ndef env_float(name: str, fallback: float) -> float:\n    value = float(env_default(name, str(fallback)))\n    if value <= 0:\n        raise ValueError(f\"{name} must be positive\")\n    return value\n\n\ndef env_bool(name: str, fallback: bool) -> bool:\n    raw = os.getenv(name)\n    if raw is None or raw == \"\":\n        return fallback\n    normalized = raw.strip().lower()\n    if normalized in {\"1\", \"true\", \"yes\", \"on\"}:\n        return True\n    if normalized in {\"0\", \"false\", \"no\", \"off\"}:","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/bench/agent_compare.py#L622-L658","documentation":"env_int_list parses a comma-separated integer list from an environment variable; it raises ValueError if the parsed list is empty or any element is below 1, requiring at least one positive integer. Used by main for lists like page sizes or concurrency levels to sweep.","triggerScenarios":"Setting the variable to \"\", only commas (\",,\", yielding empty/failed parses), 0, negative numbers, or whitespace-only segments — e.g. `BENCH_PAGE_SIZES=10,0,100` or `BENCH_PAGE_SIZES=` — then running main().","commonSituations":"Trailing comma in a copy-pasted list producing an empty final element; user tried to express \"default\" with 0; spaces around commas are tolerated by strip but blank entries still fail; list intended for a float knob pasted into an int list var.","solutions":["Set a comma-separated list of positive integers, e.g. `export BENCH_PAGE_SIZES=10,50,100`","Remove empty segments and trailing commas from the value","Unset the variable to use the fallback list defined in main()","Pre-validate in a wrapper: filter out non-positive entries before export"],"exampleFix":"// before\nexport BENCH_PAGE_SIZES=10,,100\n// after\nexport BENCH_PAGE_SIZES=10,50,100","handlingStrategy":"validation","validationCode":"import os\nraw = os.getenv(\"BENCH_PAGE_SIZES\", \"\")\nif raw:\n    parts = [x.strip() for x in raw.split(\",\")]\n    if any(not p or not p.isdigit() or int(p) < 1 for p in parts):\n        raise SystemExit(f\"BENCH_PAGE_SIZES={raw!r} must be comma-separated positive integers\")","typeGuard":null,"tryCatchPattern":"try:\n    sizes = env_int_list(\"BENCH_PAGE_SIZES\", [10, 100])\nexcept ValueError as e:\n    sys.exit(f\"bad env value: {e}\")","preventionTips":["Avoid trailing commas and empty segments in comma-separated lists","Every element must be an integer >= 1 — no zeros as placeholders","Unset the variable to use the fallback list instead of hand-building a default","Pre-parse and print the effective list in a dry-run to confirm what main() will use"],"tags":["environment-variable","validation","configuration"],"backgroundTag":"invalid-env-var-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}