{"record":{"id":"f75ef4acce9c60c4","repo":"weaviate/weaviate","slug":"disk-use-read-only-percentage-must-be-between-0-an","errorCode":null,"errorMessage":"disk_use.read_only_percentage must be between 0 and 100","messagePattern":"disk_use\\.read_only_percentage must be between 0 and 100","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/config/config_handler.go","lineNumber":1071,"sourceCode":"\tDefaultPersistenceMaxReuseWalSize = 4096 // 4kb by default\n)\n\nfunc (p Persistence) Validate() error {\n\tif p.DataPath == \"\" {\n\t\treturn fmt.Errorf(\"persistence.dataPath must be set\")\n\t}\n\n\treturn nil\n}\n\ntype DiskUse struct {\n\tWarningPercentage  uint64 `json:\"warning_percentage\" yaml:\"warning_percentage\"`\n\tReadOnlyPercentage uint64 `json:\"readonly_percentage\" yaml:\"readonly_percentage\"`\n}\n\nfunc (d DiskUse) Validate() error {\n\tif d.WarningPercentage > 100 {\n\t\treturn fmt.Errorf(\"disk_use.read_only_percentage must be between 0 and 100\")\n\t}\n\n\tif d.ReadOnlyPercentage > 100 {\n\t\treturn fmt.Errorf(\"disk_use.read_only_percentage must be between 0 and 100\")\n\t}\n\n\treturn nil\n}\n\ntype MemUse struct {\n\tWarningPercentage  uint64 `json:\"warning_percentage\" yaml:\"warning_percentage\"`\n\tReadOnlyPercentage uint64 `json:\"readonly_percentage\" yaml:\"readonly_percentage\"`\n}\n\nfunc (m MemUse) Validate() error {\n\tif m.WarningPercentage > 100 {\n\t\treturn fmt.Errorf(\"mem_use.read_only_percentage must be between 0 and 100\")\n\t}","sourceCodeStart":1053,"sourceCodeEnd":1089,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/config/config_handler.go#L1053-L1089","documentation":"DiskUse.Validate() checks that the configured disk usage percentages are within 0-100. This error is thrown when WarningPercentage exceeds 100. Note the message text is misleading: it says 'read_only_percentage' even though the offending field is warning_percentage, a copy-paste bug in the error string.","triggerScenarios":"Setting DISK_USE_WARNING_PERCENTAGE env var or disk_use.warning_percentage config (yaml/json) to a value greater than 100 at startup, when Validate() runs during config loading.","commonSituations":"Typo in the env value (e.g. 1000 instead of 100), confusing a raw byte/disk-space value with a percentage, or copy-pasting a bytes-based threshold into the percentage field.","solutions":["Set disk_use.warning_percentage (or DISK_USE_WARNING_PERCENTAGE) to a value between 0 and 100","If you intended to configure the read-only threshold, set disk_use.readonly_percentage instead","If the message mentions read_only_percentage but you only changed warning_percentage, ignore the wording and fix the warning value — the message text is a known copy-paste bug"],"exampleFix":"// before\nDISK_USE_WARNING_PERCENTAGE=150\n// after\nDISK_USE_WARNING_PERCENTAGE=80","handlingStrategy":"validation","validationCode":"func validatePercent(name string, v uint64) error {\n  if v > 100 {\n    return fmt.Errorf(\"%s must be between 0 and 100, got %d\", name, v)\n  }\n  return nil\n}\n// before starting the server:\n// if err := validatePercent(\"DISK_USE_WARNING_PERCENTAGE\", warn); err != nil { return err }","typeGuard":"func validPercentage(v uint64) bool { return v <= 100 }","tryCatchPattern":null,"preventionTips":["Treat both disk_use percentages as 0-100 integers in your config tooling","Add a pre-flight config lint step in your deployment pipeline","Remember the warning check's error text misleadingly says read_only_percentage","Keep warning_percentage strictly below readonly_percentage"],"tags":["configuration","startup","validation","weaviate"],"backgroundTag":"invalid-config-value","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}