grafana/k6 · error

retryBackoff must be greater than 0

Error message

retryBackoff must be greater than 0

What it means

validateConfig() requires a strictly positive retryBackoff duration for the url secret source; it is the base delay between retry attempts and a zero/negative backoff would make retries spin immediately. It only triggers when an explicit override makes the value non-positive, since the default is positive.

Source

Thrown at internal/secretsource/url/url.go:599

	if config.Timeout.Duration <= 0 {
		return errors.New("timeout must be greater than 0")
	}

	if config.RequestsPerMinuteLimit.Int64 <= 0 {
		return errors.New("requestsPerMinuteLimit must be greater than 0")
	}

	if config.RequestsBurst.Int64 <= 0 {
		return errors.New("requestsBurst must be greater than 0")
	}

	if config.MaxRetries.Int64 < 0 {
		return errors.New("maxRetries must be non-negative")
	}

	if config.RetryBackoff.Duration <= 0 {
		return errors.New("retryBackoff must be greater than 0")
	}

	return nil
}

View on GitHub (pinned to 93accf6570)

Solutions

  1. Remove the K6_SECRET_SOURCE_URL_RETRY_BACKOFF override to use the default
  2. Or set a small positive duration such as '100ms' or '1s'
  3. Audit config files for zeroed duration fields before deploying

Example fix

# before
K6_SECRET_SOURCE_URL_RETRY_BACKOFF='0s'

# after
K6_SECRET_SOURCE_URL_RETRY_BACKOFF='500ms'
Defensive patterns

Strategy: validation

Validate before calling

const backoff = process.env.K6_SECRET_SOURCE_URL_RETRY_BACKOFF;
if (backoff && /^(0|[-\d.]+)/.test(backoff)) {
  throw new Error('retryBackoff must be > 0');
}

Prevention

When it happens

Trigger: Setting K6_SECRET_SOURCE_URL_RETRY_BACKOFF='0s' (or a negative duration), or "retryBackoff": "0s" in the JSON/inline config.

Common situations: Zeroing the backoff to make retries 'instant'; config scaffolds that set every duration to 0s; unit fixtures reusing a zeroed struct.

Related errors


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/5c8e5d932d359324. Report an issue: GitHub.