{"record":{"id":"10beeb953ef0420b","repo":"kubernetes/kops","slug":"error-creating-network-v","errorCode":null,"errorMessage":"error creating Network: %v","messagePattern":"error creating Network: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":177,"sourceCode":"\n\t\tcase \"auto\":\n\t\t\tnetwork.AutoCreateSubnetworks = true\n\n\t\tcase \"custom\":\n\t\t\tnetwork.AutoCreateSubnetworks = false\n\t\t\t// The boolean default value of \"false\" is omitted when the struct\n\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 {","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L159-L195","documentation":"Wrapped error from Network.RenderGCE when the synchronous Networks.Insert call fails for a new network (a == nil). GCE rejected the create — common causes are an invalid CIDR for legacy mode, name collision, permissions, or networks quota.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped API error for the rejection reason","Verify the network name is unused and the CIDR/mode combination is valid","Clear quota/permission problems and re-run the apply"],"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-12T07:17:12.445Z"}