{"record":{"id":"02cee4171bc3cfa2","repo":"grafana/k6","slug":"could-not-marshal-yaml-w","errorCode":null,"errorMessage":"could not marshal YAML: %w","messagePattern":"could not marshal YAML: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/ui.go","lineNumber":400,"sourceCode":"\t\t\t// Default ticker-based progress bar resizing\n\t\t\tif gs.Stdout.IsTTY && !terminalSizeUnknown && winch == nil {\n\t\t\t\ttw, _, err := term.GetSize(stdoutFD)\n\t\t\t\tif tw > 0 && err == nil {\n\t\t\t\t\ttermWidth = tw\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trenderProgressBars(true)\n\t\tgs.OutMutex.Lock()\n\t\tprintProgressBars()\n\t\tgs.OutMutex.Unlock()\n\t}\n}\n\nfunc yamlPrint(w io.Writer, v any) error {\n\tdata, err := yaml.Marshal(v)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not marshal YAML: %w\", err)\n\t}\n\t_, err = fmt.Fprint(w, string(data))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could flush the data to the output: %w\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":382,"sourceCodeEnd":408,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/ui.go#L382-L408","documentation":"yamlPrint wraps yaml.Marshal failing on the value being printed (end-of-test summary data in ui.go). Since the printed structs are plain serializable Go values, this is an internal error, not something the user's input controls.","triggerScenarios":"Thrown at internal/cmd/ui.go:400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped yaml error for the offending field","Report as a k6 bug — summary data should always be YAML-marshalable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}