{"record":{"id":"c6b8f417a5c67847","repo":"kubernetes/kops","slug":"zone-flag-is-required-for-gce-clusters","errorCode":null,"errorMessage":"zone flag is required for GCE clusters","messagePattern":"zone flag is required for GCE clusters","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":224,"sourceCode":"\n\tig.Spec.Subnets = options.Subnets\n\n\tig.Spec.Zones = options.Zones\n\n\tcloud, err := cloudup.BuildCloud(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tig, err = cloudup.PopulateInstanceGroupSpec(cluster, ig, cloud, channel)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tig.AddInstanceGroupNodeLabel()\n\tif cluster.GetCloudProvider() == kopsapi.CloudProviderGCE {\n\t\tif len(ig.Spec.Zones) == 0 {\n\t\t\treturn fmt.Errorf(\"zone flag is required for GCE clusters\")\n\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 {","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L206-L242","documentation":"After populating the IG spec for a GCE cluster, no zones were set (neither via --zone flags nor inferred). GCE requires explicit zones for instance groups, unlike AWS where subnets imply zones, so creation is blocked.","triggerScenarios":"Thrown at cmd/kops/create_instancegroup.go:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass --zone flags, e.g. --zone us-west1-a (comma-separated for multiple)","Ensure the cluster subnets/zones configuration allows zone inference","Re-run the command with at least one valid GCE zone"],"exampleFix":null,"handlingStrategy":"validation","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-12T07:17:12.445Z"}