{"record":{"id":"30c13baf7de45cfe","repo":"kubernetes/kops","slug":"setting-forwardrule-labels-w","errorCode":null,"errorMessage":"setting ForwardRule labels: %w","messagePattern":"setting ForwardRule labels: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/forwardingrule.go","lineNumber":255,"sourceCode":"\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}\n\n\t\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\t\treturn fmt.Errorf(\"setting ForwardRule labels: %w\", err)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif changes.Labels != nil {\n\t\t\treq := compute.RegionSetLabelsRequest{\n\t\t\t\tLabelFingerprint: a.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}\n\n\t\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\t\treturn fmt.Errorf(\"setting ForwardRule labels: %w\", err)\n\t\t\t}\n\n\t\t\tchanges.Labels = nil","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/forwardingrule.go#L237-L273","documentation":"The SetLabels call on a new forwarding rule succeeded, but WaitForOp failed — the GCE setLabels operation itself completed with an error. Distinct from 2714 only in that the API accepted the request but the operation did not.","triggerScenarios":"ForwardingRules().SetLabels returned an operation successfully, then t.Cloud.WaitForOp(op) reports the operation failed (e.g. fingerprint mismatch detected server-side, resource deleted concurrently).","commonSituations":"Another controller changed labels between Get and SetLabels (stale fingerprint); the rule or its containing region hit a concurrent-modification condition; transient GCE failure.","solutions":["Re-run kops update — it re-reads the resource and re-fetches the fingerprint before setting labels","Check whether another process/automation is modifying forwarding-rule labels concurrently","Inspect the operation error in GCE console for labelFingerprint or conditionNotMet failures"],"exampleFix":"null","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cloud.WaitForOp(op); err != nil {\n    klog.Warningf(\"setLabels op failed (%v); re-running update will refetch the fingerprint\", err)\n    return err\n}","preventionTips":["Re-run kops update after a failed labels operation — fingerprints are refreshed on discovery","Stop other label-mutating processes during updates","Inspect GCE operation logs for labelFingerprintMismatch causes"],"tags":["gce","forwarding-rule","labels","operation"],"backgroundTag":"label-fingerprint-conflict","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"}