helm/helm · error

negative %d index not allowed

Error message

negative %d index not allowed

What it means

Error "negative %d index not allowed" thrown in helm/helm.

Source

Thrown at pkg/strvals/literal_parser.go:174

		}
	}
}

func (t *literalParser) keyIndex() (int, error) {
	// First, get the key.
	stop := runeSet([]rune{']'})
	v, _, err := runesUntilLiteral(t.sc, stop)
	if err != nil {
		return 0, err
	}

	// v should be the index
	return strconv.Atoi(string(v))
}

func (t *literalParser) listItem(list []any, i, nestedNameLevel int) ([]any, error) {
	if i < 0 {
		return list, fmt.Errorf("negative %d index not allowed", i)
	}
	stop := runeSet([]rune{'[', '.', '='})

	switch key, lastRune, err := runesUntilLiteral(t.sc, stop); {
	case len(key) > 0:
		return list, fmt.Errorf("unexpected data at end of array index: %q", key)

	case err != nil:
		return list, err

	case lastRune == '=':
		value, err := t.val()
		if err != nil && !errors.Is(err, io.EOF) {
			return list, err
		}
		return setIndex(list, i, string(value))

	case lastRune == '.':

View on GitHub (pinned to 2a29f1770b)

When it happens

Trigger: Thrown at pkg/strvals/literal_parser.go:174 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of helm/helm@2a29f1770b (2026-08-15). Data as JSON: /api/errors/f4c4d15372096685. Report an issue: GitHub.