{"record":{"id":"4b6805a9c0e9f4b6","repo":"kubernetes/kops","slug":"error-creating-forwarding-rule-v","errorCode":null,"errorMessage":"error creating forwarding rule: %v","messagePattern":"error creating forwarding rule: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/forwardingrule.go","lineNumber":234,"sourceCode":"\n\tif e.Subnetwork != nil {\n\t\tproject := t.Cloud.Project()\n\t\tif e.Network.Project != nil {\n\t\t\tproject = *e.Network.Project\n\t\t}\n\t\to.Subnetwork = e.Subnetwork.URL(project, t.Cloud.Region())\n\t}\n\n\tif a == nil {\n\t\tklog.V(4).Infof(\"Creating ForwardingRule %q\", o.Name)\n\n\t\top, err := t.Cloud.Compute().ForwardingRules().Insert(ctx, t.Cloud.Project(), t.Cloud.Region(), o)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating ForwardingRule %q: %v\", o.Name, err)\n\t\t}\n\n\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating forwarding rule: %v\", err)\n\t\t}\n\n\t\tif e.Labels != nil {\n\t\t\t// We can't set labels on creation; we have to read the object to get the fingerprint\n\t\t\t// TODO: We could get it from the operation!\n\t\t\tr, err := t.Cloud.Compute().ForwardingRules().Get(ctx, t.Cloud.Project(), t.Cloud.Region(), name)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"reading created ForwardingRule %q: %v\", name, err)\n\t\t\t}\n\n\t\t\treq := compute.RegionSetLabelsRequest{\n\t\t\t\tLabelFingerprint: r.LabelFingerprint,\n\t\t\t\tLabels:           e.Labels,\n\t\t\t}\n\t\t\top, err := t.Cloud.Compute().ForwardingRules().SetLabels(ctx, t.Cloud.Project(), t.Cloud.Region(), o.Name, &req)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"setting ForwardingRule labels: %w\", err)\n\t\t\t}","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/forwardingrule.go#L216-L252","documentation":"The ForwardingRules.Insert API call succeeded, but the subsequent WaitForOp failed — the GCE operation to create the forwarding rule completed with an error. kOps reports it as 'error creating forwarding rule' with the operation's error embedded.","triggerScenarios":"Insert returned an operation, then t.Cloud.WaitForOp(op) returned non-nil because the operation finished with status DONE and an error (e.g. conditionNotMet, resource exhausted during provisioning).","commonSituations":"Concurrent modification of the same region by another controller; target pool/backend deleted between insert and completion; transient GCE service disruption; operation timeout if WaitForOp hits its deadline.","solutions":["Inspect the wrapped operation error for the operation-level cause","Re-run kops update — a failed create leaves no resource, so the next run retries the insert cleanly","Check GCE operation logs in Cloud Console (Compute Engine > Operations) for details","If timeouts recur, increase WaitForOp tolerance or investigate GCE service health"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"null","typeGuard":null,"tryCatchPattern":"if err := cloud.WaitForOp(op); err != nil {\n    klog.Warningf(\"forwarding rule create op failed: %v; will retry on next run\", err)\n    return err // safe: insert is idempotent — next run recreates since no resource exists\n}","preventionTips":["Treat failed create operations as safe-to-retry (no resource was left behind)","Check GCE operation logs when the wrapped error is opaque","Avoid concurrent controllers mutating the same region during kops update","Watch GCE service health for transient disruptions"],"tags":["gce","forwarding-rule","operation","creation"],"backgroundTag":"gce-operation-failed","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"}