{"record":{"id":"f4c4d15372096685","repo":"helm/helm","slug":"negative-d-index-not-allowed","errorCode":null,"errorMessage":"negative %d index not allowed","messagePattern":"negative (.+?) index not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/strvals/literal_parser.go","lineNumber":174,"sourceCode":"\t\t}\n\t}\n}\n\nfunc (t *literalParser) keyIndex() (int, error) {\n\t// First, get the key.\n\tstop := runeSet([]rune{']'})\n\tv, _, err := runesUntilLiteral(t.sc, stop)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// v should be the index\n\treturn strconv.Atoi(string(v))\n}\n\nfunc (t *literalParser) listItem(list []any, i, nestedNameLevel int) ([]any, error) {\n\tif i < 0 {\n\t\treturn list, fmt.Errorf(\"negative %d index not allowed\", i)\n\t}\n\tstop := runeSet([]rune{'[', '.', '='})\n\n\tswitch key, lastRune, err := runesUntilLiteral(t.sc, stop); {\n\tcase len(key) > 0:\n\t\treturn list, fmt.Errorf(\"unexpected data at end of array index: %q\", key)\n\n\tcase err != nil:\n\t\treturn list, err\n\n\tcase lastRune == '=':\n\t\tvalue, err := t.val()\n\t\tif err != nil && !errors.Is(err, io.EOF) {\n\t\t\treturn list, err\n\t\t}\n\t\treturn setIndex(list, i, string(value))\n\n\tcase lastRune == '.':","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/strvals/literal_parser.go#L156-L192","documentation":"Error \"negative %d index not allowed\" thrown in helm/helm.","triggerScenarios":"Thrown at pkg/strvals/literal_parser.go:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}