{"record":{"id":"26b0e46108158ec2","repo":"kubernetes/kops","slug":"gce-networks-in-legacy-mode-are-not-supported-pl","errorCode":null,"errorMessage":"GCE networks in legacy mode are not supported.  Please convert to auto mode or specify a different network.","messagePattern":"GCE networks in legacy mode are not supported\\.  Please convert to auto mode or specify a different network\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":184,"sourceCode":"\t\t\t// is serialized, which results in the network being created with\n\t\t\t// the auto-create subnetworks default of \"true\". Explicitly send\n\t\t\t// the default value.\n\t\t\tnetwork.ForceSendFields = []string{\"AutoCreateSubnetworks\"}\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unhandled mode %q\", e.Mode)\n\t\t}\n\n\t\top, err := t.Cloud.Compute().Networks().Insert(t.Cloud.Project(), network)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating Network: %v\", err)\n\t\t}\n\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\treturn fmt.Errorf(\"error waiting for Network creation to complete: %w\", err)\n\t\t}\n\t} else {\n\t\tif a.Mode == \"legacy\" {\n\t\t\treturn fmt.Errorf(\"GCE networks in legacy mode are not supported.  Please convert to auto mode or specify a different network.\")\n\t\t}\n\t\tempty := &Network{}\n\t\tif !reflect.DeepEqual(empty, changes) {\n\t\t\treturn fmt.Errorf(\"cannot apply changes to Network: %v\", changes)\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype terraformNetwork struct {\n\tName                  *string `cty:\"name\"`\n\tIPv4Range             *string `cty:\"ipv4_range\"`\n\tProject               *string `cty:\"project\"`\n\tAutoCreateSubnetworks *bool   `cty:\"auto_create_subnetworks\"`\n}\n\nfunc (_ *Network) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Network) error {","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L166-L202","documentation":"Hard stop from Network.RenderGCE when an existing network (a != nil) is in legacy mode. Legacy networks lack subnetworks, which kOps requires; the task explicitly refuses to proceed and directs the user to convert the network or choose another one.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Migrate the GCE network from legacy to auto/custom subnet mode (gcloud compute networks update --switch-to-custom-subnet-mode) or use a different, non-legacy network","Point the cluster spec's NetworkID at a subnet-capable network"],"exampleFix":null,"handlingStrategy":"fallback","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"}