{"record":{"id":"a6f0c1ce53db29dc","repo":"provectus/kafka-ui","slug":"invalid-format-for-webclient-maxinmemorybuffersize","errorCode":null,"errorMessage":"Invalid format for webclient.maxInMemoryBufferSize","messagePattern":"Invalid format for webclient\\.maxInMemoryBufferSize","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/WebclientProperties.java","lineNumber":27,"sourceCode":"\n@Configuration\n@ConfigurationProperties(\"webclient\")\n@Data\npublic class WebclientProperties {\n\n  String maxInMemoryBufferSize;\n\n  @PostConstruct\n  public void validate() {\n    validateAndSetDefaultBufferSize();\n  }\n\n  private void validateAndSetDefaultBufferSize() {\n    if (maxInMemoryBufferSize != null) {\n      try {\n        DataSize.parse(maxInMemoryBufferSize);\n      } catch (Exception e) {\n        throw new ValidationException(\"Invalid format for webclient.maxInMemoryBufferSize\");\n      }\n    }\n  }\n\n}\n","sourceCodeStart":9,"sourceCodeEnd":33,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/config/WebclientProperties.java#L9-L33","documentation":"WebclientProperties.validateAndSetDefaultBufferSize validates the optional `webclient.maxInMemoryBufferSize` property by attempting DataSize.parse. If the string is not a valid Spring DataSize format (e.g. missing a unit), a ValidationException is thrown at startup.","triggerScenarios":"Setting webclient.maxInMemoryBufferSize in application config to a value like `5242880` (no unit) or `abc`; the value must parse as a DataSize (e.g. `10MB`, `512KB`).","commonSituations":"Copy-pasting a raw byte count from WebFlux docs without a unit suffix; typos in unit (`10 MBB`); locale-formatted numbers with separators like `5,000,000`.","solutions":["Append a valid size unit, e.g. `webclient.maxInMemoryBufferSize: 10MB`","Use one of B, KB, MB, GB, TB suffixes accepted by Spring's DataSize.parse","Remove the property entirely to fall back to the default buffer size"],"exampleFix":"// before\nwebclient:\n  maxInMemoryBufferSize: 5242880\n// after\nwebclient:\n  maxInMemoryBufferSize: 5MB","handlingStrategy":"validation","validationCode":"import re\nv = config.get('webclient', {}).get('maxInMemoryBufferSize')\nif v is not None and not re.fullmatch(r'\\d+(B|KB|MB|GB|TB)', str(v)):\n    raise ValueError(f'Invalid DataSize: {v}')","typeGuard":null,"tryCatchPattern":"try:\n    DataSize.parse(bufferSize)\nexcept Exception:\n    raise ValidationException('Use e.g. 10MB for webclient.maxInMemoryBufferSize')","preventionTips":["Always include a unit suffix (B/KB/MB/GB/TB)","Never paste raw byte counts into size properties","Check Spring Boot DataSize docs for accepted formats"],"tags":["configuration","spring","webclient","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}