grafana/k6 · error

requestsPerMinuteLimit must be greater than 0

Error message

requestsPerMinuteLimit must be greater than 0

What it means

validateConfig() enforces a strictly positive rate limit for the url secret source: requestsPerMinuteLimit bounds how many secret-fetch requests may be issued per minute, and a limit of 0 or less would forbid all requests. The error fires at startup when an explicit override makes the value non-positive.

Source

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

	if err := validateConfig(config); err != nil {
		return extConfig{}, err
	}

	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_PER_MINUTE_LIMIT override to use the default
  2. Or set a large positive value to effectively disable throttling, e.g. '1000000'
  3. Validate that computed values (from env or CI variables) are >= 1 before launching k6

Example fix

# before
K6_SECRET_SOURCE_URL_REQUESTS_PER_MINUTE_LIMIT='0'

# after
K6_SECRET_SOURCE_URL_REQUESTS_PER_MINUTE_LIMIT='1000000'
Defensive patterns

Strategy: validation

Validate before calling

const rpm = Number(process.env.K6_SECRET_SOURCE_URL_REQUESTS_PER_MINUTE_LIMIT);
if (process.env.K6_SECRET_SOURCE_URL_REQUESTS_PER_MINUTE_LIMIT && rpm <= 0) {
  throw new Error('requestsPerMinuteLimit must be > 0');
}

Prevention

When it happens

Trigger: Setting K6_SECRET_SOURCE_URL_REQUESTS_PER_MINUTE_LIMIT='0' (or negative), or "requestsPerMinuteLimit": 0 in the JSON/inline config.

Common situations: Trying to disable rate limiting by setting the limit to 0; feeding a negative number from a misconfigured variable; config scaffolding filled with zeros.

Related errors


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