{"record":{"id":"8c0e86711298fbbb","repo":"kubernetes/kops","slug":"cannot-apply-changes-to-network-v","errorCode":null,"errorMessage":"cannot apply changes to Network: %v","messagePattern":"cannot apply changes to Network: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":188,"sourceCode":"\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 {\n\tshared := fi.ValueOf(e.Shared)\n\tif shared {\n\t\t// Not terraform owned / managed\n\t\treturn nil","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L170-L206","documentation":"Returned from Network.RenderGCE for an existing, non-legacy network when the residual diff is non-empty after the legacy check. The network task cannot apply in-place mutations, so any remaining change (after allowed no-op fields) is rejected.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the printed diff to identify the drifted field(s)","Align the cluster spec with the live network or adjust the network manually to match the spec","Recreate the network only if it is safe to do so (shared networks usually are not)"],"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"}