weaviate/weaviate · error

parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w

Error message

parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w

What it means

FromEnv reads TRANSFER_INACTIVITY_TIMEOUT and parses it with time.ParseDuration to configure how long a shard/replica transfer may be inactive before being considered failed. An invalid duration string is wrapped as "parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w" and aborts config loading so the operator sees the bad env var immediately.

Source

Thrown at usecases/config/environment.go:224

		if err != nil {
			return fmt.Errorf("parse LAZY_LOAD_SHARD_SIZE_THRESHOLD_GB as float: %w", err)
		}
		if asFloat < 0 {
			return fmt.Errorf("LAZY_LOAD_SHARD_SIZE_THRESHOLD_GB must be >= 0")
		}
		config.LazyLoadShardSizeThresholdGB = asFloat
	} else {
		config.LazyLoadShardSizeThresholdGB = DefaultLazyLoadShardSizeThresholdGB
	}

	if entcfg.Enabled(os.Getenv("FORCE_FULL_REPLICAS_SEARCH")) {
		config.ForceFullReplicasSearch = true
	}

	if v := os.Getenv("TRANSFER_INACTIVITY_TIMEOUT"); v != "" {
		timeout, err := time.ParseDuration(v)
		if err != nil {
			return fmt.Errorf("parse TRANSFER_INACTIVITY_TIMEOUT as duration: %w", err)
		}
		config.TransferInactivityTimeout = timeout
	} else {
		config.TransferInactivityTimeout = DefaultTransferInactivityTimeout
	}

	err := parsePositiveDuration(
		"HALT_FOR_TRANSFER_TIMEOUT",
		func(val time.Duration) { config.HaltForTransferTimeout = val },
		DefaultHaltForTransferTimeout,
	)
	if err != nil {
		return err
	}

	// Recount all property lengths at startup to support accurate BM25 scoring
	if entcfg.Enabled(os.Getenv("RECOUNT_PROPERTIES_AT_STARTUP")) {
		config.RecountPropertiesAtStartup = true

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Use a valid Go duration with an explicit unit, e.g. TRANSFER_INACTIVITY_TIMEOUT=2m or 1h30m.
  2. Unset the variable to use DefaultTransferInactivityTimeout.
  3. Verify with Go's ParseDuration semantics: number+unit (ns, us, ms, s, m, h), no spaces.

Example fix

// before
TRANSFER_INACTIVITY_TIMEOUT=90
// after
TRANSFER_INACTIVITY_TIMEOUT=90s
Defensive patterns

Strategy: validation

Validate before calling

v := os.Getenv("TRANSFER_INACTIVITY_TIMEOUT")
if v != "" {
    if _, err := time.ParseDuration(v); err != nil {
        return fmt.Errorf("invalid TRANSFER_INACTIVITY_TIMEOUT %q: %w", v, err)
    }
}

Type guard

func validDuration(v string) bool {
    _, err := time.ParseDuration(v)
    return err == nil
}

Prevention

When it happens

Trigger: TRANSFER_INACTIVITY_TIMEOUT set to a value time.ParseDuration rejects: "90" (no unit), "2h30" (incomplete compound), "90min", "1 hr", or whitespace-padded values, during LoadConfig.

Common situations: Following docs from other systems that accept bare seconds; writing "90min" instead of "90m"; k8s duration formats like "1h30m0s" are fine but "90" is not; leftover placeholder values in compose files.

Understand the failure class

Related errors


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