grafana/k6 · error

requestsBurst must be greater than 0

Error message

requestsBurst must be greater than 0

What it means

validateConfig() requires requestsBurst, the token-bucket burst size for the url secret source's rate limiter, to be at least 1. A burst of 0 would make the limiter unable to admit even a single request. As with the other numeric fields, the default is valid, so only an explicit non-positive override triggers this.

Source

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

	return config, nil
}

func validateConfig(config extConfig) error {
	// Validate required fields and value constraints
	if err := validateURLTemplate(config.URLTemplate); err != nil {
		return err
	}

	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_REQUESTS_BURST override to fall back to the default
  2. Or set it to a positive value, typically >= requestsPerMinuteLimit, e.g. '100'
  3. If computing burst from other values, guard with a max(1, computed) expression

Example fix

# before
K6_SECRET_SOURCE_URL_REQUESTS_BURST='0'

# after
K6_SECRET_SOURCE_URL_REQUESTS_BURST='100'
Defensive patterns

Strategy: validation

Validate before calling

const burst = Number(process.env.K6_SECRET_SOURCE_URL_REQUESTS_BURST);
if (process.env.K6_SECRET_SOURCE_URL_REQUESTS_BURST && burst <= 0) {
  throw new Error('requestsBurst must be > 0');
}

Prevention

When it happens

Trigger: Setting K6_SECRET_SOURCE_URL_REQUESTS_BURST='0' (or a negative integer), or "requestsBurst": 0 in the JSON/inline config.

Common situations: Copying the rate-limit settings and zeroing both; assuming burst=0 means 'no burst limit'; CI templates that define every variable with 0 defaults.

Related errors


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