{"record":{"id":"75fd77aa5d84581b","repo":"grafana/k6","slug":"couldn-t-parse-the-loki-msgmaxsize-as-a-number-w","errorCode":null,"errorMessage":"couldn't parse the loki msgMaxSize as a number %w","messagePattern":"couldn't parse the loki msgMaxSize as a number %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/log/loki.go","lineNumber":175,"sourceCode":"\t\tcase \"pushPeriod\":\n\t\t\topts.PushPeriod, err = time.ParseDuration(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"couldn't parse the loki pushPeriod %w\", err)\n\t\t\t}\n\t\tcase \"profile\":\n\t\t\topts.Profile = true\n\t\tcase \"limit\":\n\t\t\topts.Limit, err = strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"couldn't parse the loki limit as a number %w\", err)\n\t\t\t}\n\t\t\tif opts.Limit < 1 {\n\t\t\t\treturn fmt.Errorf(\"loki limit needs to be a positive number, is %d\", opts.Limit)\n\t\t\t}\n\t\tcase \"msgMaxSize\":\n\t\t\topts.MsgMaxSize, err = strconv.Atoi(value)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"couldn't parse the loki msgMaxSize as a number %w\", err)\n\t\t\t}\n\t\t\tif opts.MsgMaxSize < 1 {\n\t\t\t\treturn fmt.Errorf(\"loki msgMaxSize needs to be a positive number, is %d\", opts.MsgMaxSize)\n\t\t\t}\n\t\tcase \"level\":\n\t\t\topts.Level = value\n\t\tcase \"allowedLabels\":\n\t\t\topts.AllowedLabels = strings.Split(value, \",\")\n\t\tdefault:\n\t\t\tif after, ok := strings.CutPrefix(key, \"label.\"); ok {\n\t\t\t\topts.Labels = append(opts.Labels, [2]string{after, value})\n\n\t\t\t\tcontinue\n\t\t\t} else if after, ok := strings.CutPrefix(key, \"header.\"); ok {\n\t\t\t\topts.Headers = append(opts.Headers, [2]string{after, value})\n\n\t\t\t\tcontinue\n\t\t\t}","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/log/loki.go#L157-L193","documentation":"The msgMaxSize option of the Loki log output could not be converted to an integer by strconv.Atoi. parseArgs wraps the parse failure, meaning the supplied value is not a valid base-10 number string (empty, fractional, or contains non-digits).","triggerScenarios":"Thrown at internal/log/loki.go:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide msgMaxSize as a plain integer string, e.g. --log-output=loki=...,msgMaxSize=500000","Check for typos, quotes, or unit suffixes in the msgMaxSize value"],"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-14T00:17:10.932Z"}