grafana/k6 · error

key `%s` with no value

Error message

key `%s` with no value

What it means

The strvals-style configuration string contains a key with no '=' or value: the tokenizer hit a ',' (or the end of input) while still inside a key. In practice this comes from a malformed -o otel=... (or similar key=value) option, e.g. 'a=b,barekey'. The error names the offending key, and parsing aborts entirely.

Source

Thrown at internal/lib/strvals/parser.go:28

type tokenizer struct {
	i          int
	s          string
	currentKey string
}

func (t *tokenizer) readKey() (string, error) {
	start := t.i
	for ; t.i < len(t.s); t.i++ {
		if t.s[t.i] == '=' && t.i != len(t.s)-1 {
			t.i++

			return t.s[start : t.i-1], nil
		}
		if t.s[t.i] == ',' {
			k := t.s[start:t.i]

			return k, fmt.Errorf("key `%s` with no value", k)
		}
	}

	s := t.s[start:]

	return s, fmt.Errorf("key `%s` with no value", s)
}

func (t *tokenizer) readValue() string {
	start := t.i
	for ; t.i < len(t.s); t.i++ {
		if t.s[t.i] == ',' {
			t.i++

			return t.s[start : t.i-1]
		}
	}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Ensure every key in the comma-separated string has the form key=value
  2. Check for a missing '=' after the key named in the error, stray commas, or trailing empty segments
  3. Quote values containing commas per the strvals format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/lib/strvals/parser.go:28 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/5c5d35f369fb9b81. Report an issue: GitHub.