{"record":{"id":"e5e25d0e3ef93695","repo":"grafana/k6","slug":"there-was-no-after-an-array-with-key-s","errorCode":null,"errorMessage":"there was no ',' after an array with key '%s'","messagePattern":"there was no ',' after an array with key '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/lib/strvals/parser.go","lineNumber":61,"sourceCode":"\t\t\treturn t.s[start : t.i-1]\n\t\t}\n\t}\n\n\treturn t.s[start:]\n}\n\nfunc (t *tokenizer) readArray() (string, error) {\n\tstart := t.i\n\tfor ; t.i < len(t.s); t.i++ {\n\t\tif t.s[t.i] == ']' {\n\t\t\tif t.i+1 == len(t.s) || t.s[t.i+1] == ',' {\n\t\t\t\tt.i += 2\n\n\t\t\t\treturn t.s[start : t.i-2], nil\n\t\t\t}\n\t\t\tt.i++\n\n\t\t\treturn t.s[start : t.i-1], fmt.Errorf(\"there was no ',' after an array with key '%s'\", t.currentKey)\n\t\t}\n\t}\n\n\treturn t.s[start:], fmt.Errorf(\"array value for key `%s` didn't end\", t.currentKey)\n}\n\n// Parse parses the input string into key-value tokens following strvals format:\n// name=value,topname.subname=value.\nfunc Parse(s string) ([]Token, error) {\n\tresult := []Token{}\n\tt := &tokenizer{s: s}\n\n\tvar err error\n\tvar value string\n\tfor t.i < len(s) {\n\t\tt.currentKey, err = t.readKey()\n\t\tif err != nil {\n\t\t\treturn result, err","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/strvals/parser.go#L43-L79","documentation":"An array value in the strvals string (delimited by [ ]) was closed with ']' but was not followed by ',' or the end of input. The tokenizer requires a separator after an array element; anything else (e.g. 'k=[1,2]x') is treated as malformed input and aborts parsing. The error names the key whose array triggered it.","triggerScenarios":"Thrown at internal/lib/strvals/parser.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Put a ',' immediately after the closing ']' or end the string there","Remove stray characters between the array's ']' and the next key","Review the strvals syntax: elements are separated by commas, arrays use square brackets"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}