{"record":{"id":"9c80f6ddf2b75b79","repo":"vllm-project/vllm","slug":"invalid-format-value","errorCode":null,"errorMessage":"Invalid format: '{value}'","messagePattern":"Invalid format: '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py","lineNumber":213,"sourceCode":"    if not isinstance(value, str):\n        try:\n            return int(value)\n        except (TypeError, ValueError) as e:\n            raise TypeError(f\"Unsupported type for size: {type(value)}\") from e\n\n    cleaned = value.strip().lower()\n    if not cleaned:\n        raise ValueError(\"Size cannot be empty.\")\n\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)","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py#L195-L231","documentation":"_parse_size matches size strings against the regex ^\\s*([\\d.]+)\\s*(gb|mb|kb|b)?\\s*$ (case-insensitive). Anything else — \"8 GB X\", \"0x1000\", \"8tb\", \"1,024GB\", \"half\" — fails with ValueError('Invalid format'). Only gb/mb/kb/b units (binary multiples) plus bare byte counts are accepted.","triggerScenarios":"Using unsupported units (TB/PB), thousands separators, hex, or extra characters in global_segment_size/local_buffer_size.","commonSituations":"Users writing disk-style sizes (\"2TB\"), European decimal commas, or pasting values from cloud console quotas.","solutions":["Convert to a supported unit: \"2048GB\" instead of \"2TB\"","Remove commas/spaces: \"1024GB\" not \"1,024 GB\"","Or use a bare integer byte count"],"exampleFix":"// before\n{ \"global_segment_size\": \"2TB\" }\n\n// after\n{ \"global_segment_size\": \"2048GB\" }","handlingStrategy":"validation","validationCode":"import re\nSIZE_RE = re.compile(r\"^[\\d.]+\\s*(gb|mb|kb|b)?$\", re.I)\nv = str(raw.get(key)).strip()\nif v and not SIZE_RE.match(v):\n    raise ValueError(f\"{key} must look like '1024MB' or a bare byte count\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert TB values to GB (only gb/mb/kb/b are supported)","Avoid thousands separators and stray spaces in size strings"],"tags":["mooncake","config","parsing"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}