grafana/k6 · error

invalid config format %q, expected key=value

Error message

invalid config format %q, expected key=value

What it means

parseInlineConfig expects every comma-separated fragment of the url secret source config to be key=value. A fragment without '=' (or an empty fragment) triggers this validation error; at fault is the raw config string supplied by the user to the url secret source.

Source

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

	logger.WithFields(logrus.Fields{
		"attempts": attempts,
		"error":    lastErr,
	}).Debug("Max retry attempts reached")

	return lastErr
}

func parseInlineConfig(configArg string, fs fsext.Fs) (extConfig, error) {
	var fileCfg extConfig
	var inlineCfg extConfig

	// Split by comma to parse key=value pairs
	parts := strings.SplitSeq(configArg, ",")
	for part := range parts {
		key, value, ok := strings.Cut(part, "=")
		if !ok {
			return extConfig{}, fmt.Errorf("invalid config format %q, expected key=value", part)
		}

		if key == "config" {
			// Load from file
			var err error
			fileCfg, err = loadConfigFromFile(value, fs)
			if err != nil {
				return extConfig{}, err
			}
			continue
		}

		if err := parseInlineConfigOption(key, value, &inlineCfg); err != nil {
			return extConfig{}, err
		}
	}

	// Apply configs in order: file -> inline

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Write every option as key=value, e.g. urlTemplate=https://svc/{key},maxRetries=3
  2. Remove stray comma-separated tokens
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/secretsource/url/url.go:335 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/cd0f053992171e80. Report an issue: GitHub.