{"record":{"id":"ce548fbd33fdac47","repo":"vllm-project/vllm","slug":"invalid-numeric-value-number-str-in-value","errorCode":null,"errorMessage":"Invalid numeric value '{number_str}' in: '{value}'","messagePattern":"Invalid numeric value '(.+?)' in: '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py","lineNumber":222,"sourceCode":"\n    unit_multipliers = {\n        \"gb\": 1024**3,\n        \"mb\": 1024**2,\n        \"kb\": 1024,\n        \"b\": 1,\n    }\n    match = re.match(r\"^\\s*([\\d.]+)\\s*(gb|mb|kb|b)?\\s*$\", cleaned)\n    if not match:\n        raise ValueError(f\"Invalid format: '{value}'\")\n\n    number_str = match.group(1)\n    unit = match.group(2) or \"b\"\n    multiplier = unit_multipliers[unit]\n\n    try:\n        numeric_value = float(number_str)\n    except ValueError as exc:\n        raise ValueError(f\"Invalid numeric value '{number_str}' in: '{value}'\") from exc\n    return int(numeric_value * multiplier)\n\n\ndef _align_up(value: int, alignment: int) -> int:\n    return ((value + alignment - 1) // alignment) * alignment\n\n\ndef _estimate_disk_offload_staging_bytes(size_list: list[int]) -> int:\n    data_size = sum(size_list)\n    return _align_up(data_size, _DIRECT_IO_ALIGNMENT) + _DIRECT_IO_PADDING_BYTES\n\n\ndef _sum_batch_bytes(sizes: list[list[int]]) -> int:\n    return sum(sum(size) for size in sizes)\n\n\ndef _get_usable_disk_offload_buffer_budget_bytes(raw_budget_bytes: int) -> int:\n    return max(1, int(raw_budget_bytes * envs.VLLM_MOONCAKE_DISK_STAGING_USABLE_RATIO))","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py#L204-L240","documentation":"After the format regex matches, _parse_size converts the captured numeric group with float(); failure raises this ValueError. In practice the regex ([\\d.]+) already excludes most bad input, so this fires on edge cases like \".\" alone or \"1.2.3\" that match the regex but are not valid floats.","triggerScenarios":"Values like \".\", \"1.2.3\", or \"...\" in size fields — multiple dots that slip through the character-class regex.","commonSituations":"Truncated copy-paste of a size string; hand-editing that leaves stray dots.","solutions":["Write the number in plain decimal form: \"1.5GB\" or \"1024MB\"","Or use an integer byte count"],"exampleFix":"// before\n{ \"local_buffer_size\": \"1.2.3GB\" }\n\n// after\n{ \"local_buffer_size\": \"1.5GB\" }","handlingStrategy":"validation","validationCode":"num = str(raw.get(key)).strip().lower().rstrip(\"gbmkb \")\ntry:\n    float(num)\nexcept ValueError:\n    raise ValueError(f\"{key} numeric part {num!r} is not a valid number\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use single-dot decimals only (\"1.5GB\"), never multiple dots","Prefer integer byte counts for machine-generated configs"],"tags":["mooncake","config","parsing"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}