weaviate/weaviate · error

disk_use.read_only_percentage must be between 0 and 100

Error message

disk_use.read_only_percentage must be between 0 and 100

What it means

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.

Source

Thrown at usecases/config/config_handler.go:1071

	DefaultPersistenceMaxReuseWalSize = 4096 // 4kb by default
)

func (p Persistence) Validate() error {
	if p.DataPath == "" {
		return fmt.Errorf("persistence.dataPath must be set")
	}

	return nil
}

type DiskUse struct {
	WarningPercentage  uint64 `json:"warning_percentage" yaml:"warning_percentage"`
	ReadOnlyPercentage uint64 `json:"readonly_percentage" yaml:"readonly_percentage"`
}

func (d DiskUse) Validate() error {
	if d.WarningPercentage > 100 {
		return fmt.Errorf("disk_use.read_only_percentage must be between 0 and 100")
	}

	if d.ReadOnlyPercentage > 100 {
		return fmt.Errorf("disk_use.read_only_percentage must be between 0 and 100")
	}

	return nil
}

type MemUse struct {
	WarningPercentage  uint64 `json:"warning_percentage" yaml:"warning_percentage"`
	ReadOnlyPercentage uint64 `json:"readonly_percentage" yaml:"readonly_percentage"`
}

func (m MemUse) Validate() error {
	if m.WarningPercentage > 100 {
		return fmt.Errorf("mem_use.read_only_percentage must be between 0 and 100")
	}

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Set disk_use.warning_percentage (or DISK_USE_WARNING_PERCENTAGE) to a value between 0 and 100
  2. If you intended to configure the read-only threshold, set disk_use.readonly_percentage instead
  3. 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

Example fix

// before
DISK_USE_WARNING_PERCENTAGE=150
// after
DISK_USE_WARNING_PERCENTAGE=80
Defensive patterns

Strategy: validation

Validate before calling

func validatePercent(name string, v uint64) error {
  if v > 100 {
    return fmt.Errorf("%s must be between 0 and 100, got %d", name, v)
  }
  return nil
}
// before starting the server:
// if err := validatePercent("DISK_USE_WARNING_PERCENTAGE", warn); err != nil { return err }

Type guard

func validPercentage(v uint64) bool { return v <= 100 }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/f75ef4acce9c60c4. Report an issue: GitHub.