{"record":{"id":"448a762676be0652","repo":"vllm-project/vllm","slug":"size-cannot-be-empty","errorCode":null,"errorMessage":"Size cannot be empty.","messagePattern":"Size cannot be empty\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py","lineNumber":203,"sourceCode":"            f\"tenant_id must be a string or null, got {type(value).__name__}: {value!r}\"\n        )\n    tenant_id = value.strip()\n    return tenant_id if tenant_id else DEFAULT_TENANT_ID\n\n\ndef _parse_size(value: Any) -> int:\n    \"\"\"Parse storage size strings with units: GB, MB, KB, B.\"\"\"\n    if isinstance(value, int):\n        return value\n    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:","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/worker.py#L185-L221","documentation":"_parse_size rejects size strings that are empty or whitespace-only, before unit parsing begins. This is distinct from error 532 (wrong type) and 534 (malformed non-empty string).","triggerScenarios":"\"local_buffer_size\": \"\" or \"   \" in the mooncake config JSON.","commonSituations":"Helm/Jinja templates rendering an empty default; optional fields set to empty strings to 'unset' them.","solutions":["Provide a real value such as \"1GB\"","Delete the key so the DEFAULT_LOCAL_BUFFER_SIZE / DEFAULT_GLOBAL_SEGMENT_SIZE fallback applies"],"exampleFix":"// before\n{ \"local_buffer_size\": \"\" }\n\n// after\n{ \"local_buffer_size\": \"1GB\" }","handlingStrategy":"validation","validationCode":"v = raw.get(key)\nif isinstance(v, str) and not v.strip():\n    raise ValueError(f\"{key} must not be an empty string; remove the key to use the default\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete optional keys instead of blanking them in templates","Add a 'no empty strings' lint to config generation"],"tags":["mooncake","config","parsing"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}