{"record":{"id":"bde057e9b84b0279","repo":"grafana/k6","slug":"couldn-t-parse-q-as-argument-for-csv-output","errorCode":null,"errorMessage":"couldn't parse %q as argument for csv output","messagePattern":"couldn't parse %q as argument for csv output","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/csv/config.go","lineNumber":75,"sourceCode":"\t\tc.TimeFormat = cfg.TimeFormat\n\t}\n\treturn c\n}\n\n// ParseArg takes an arg string and converts it to a config\nfunc ParseArg(arg string) (Config, error) {\n\tc := NewConfig()\n\n\tif !strings.Contains(arg, \"=\") {\n\t\tc.FileName = null.StringFrom(arg)\n\t\treturn c, nil\n\t}\n\n\tpairs := strings.SplitSeq(arg, \",\")\n\tfor pair := range pairs {\n\t\tk, v, _ := strings.Cut(pair, \"=\")\n\t\tif v == \"\" {\n\t\t\treturn c, fmt.Errorf(\"couldn't parse %q as argument for csv output\", arg)\n\t\t}\n\t\tswitch k {\n\t\tcase \"saveInterval\":\n\t\t\terr := c.SaveInterval.UnmarshalText([]byte(v))\n\t\t\tif err != nil {\n\t\t\t\treturn c, err\n\t\t\t}\n\t\tcase \"fileName\":\n\t\t\tc.FileName = null.StringFrom(v)\n\t\tcase \"timeFormat\":\n\t\t\tc.TimeFormat = null.StringFrom(v)\n\t\tdefault:\n\t\t\treturn c, fmt.Errorf(\"unknown key %q as argument for csv output\", k)\n\t\t}\n\t}\n\n\treturn c, nil\n}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/csv/config.go#L57-L93","documentation":"While parsing the CSV output argument string, a key=value pair was found whose value side is empty (e.g. \"fileName=\" or a trailing comma pair). ParseArg rejects any pair with an empty value for the CSV output configuration.","triggerScenarios":"Thrown at internal/output/csv/config.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a value for every key, e.g. --out csv=file=result.csv,saveInterval=1s","Remove keys you don't want to set instead of leaving them empty"],"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"}