{"record":{"id":"02479c5bbd9b54df","repo":"kubernetes/kops","slug":"error-writing-cluster-yaml-to-stdout-v-02479c","errorCode":null,"errorMessage":"error writing cluster yaml to stdout: %v","messagePattern":"error writing cluster yaml to stdout: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":243,"sourceCode":"\t\t}\n\t\tfmt.Println(\"detected a GCE cluster; labeling nodes to receive metadata-proxy.\")\n\t\tig.Spec.NodeLabels[\"cloud.google.com/metadata-proxy-ready\"] = \"true\"\n\t}\n\n\tif options.DryRun {\n\n\t\tif options.Output == \"\" {\n\t\t\treturn fmt.Errorf(\"must set output flag; yaml or json\")\n\t\t}\n\n\t\t// Cluster name is not populated, and we need it\n\t\tig.ObjectMeta.Labels = make(map[string]string)\n\t\tig.ObjectMeta.Labels[kopsapi.LabelClusterName] = cluster.ObjectMeta.Name\n\n\t\tswitch options.Output {\n\t\tcase OutputYaml:\n\t\t\tif err := fullOutputYAML(out, ig); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error writing cluster yaml to stdout: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\tcase OutputJSON:\n\t\t\tif err := fullOutputJSON(out, true, ig); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error writing cluster json to stdout: %v\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported output type %q\", options.Output)\n\t\t}\n\t}\n\n\tif options.Edit {\n\t\tedit := editor.NewDefaultEditor(commandutils.EditorEnvs)\n\n\t\traw, err := kopscodecs.ToVersionedYaml(ig)\n\t\tif err != nil {\n\t\t\treturn err","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L225-L261","documentation":"During dry-run YAML output, serializing the populated InstanceGroup to YAML on stdout failed. The object was built successfully; this is an output-stage failure, typically from the YAML printer (or a broken stdout pipe).","triggerScenarios":"Thrown at cmd/kops/create_instancegroup.go:243 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped serialization error for details","Ensure stdout is not a closed/broken pipe","Report as a kops bug if the IG object itself cannot be serialized"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}