{"record":{"id":"d33eab4797e1c385","repo":"kubernetes/kops","slug":"reading-created-forwardingrule-q-v","errorCode":null,"errorMessage":"reading created ForwardingRule %q: %v","messagePattern":"reading created ForwardingRule %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/forwardingrule.go","lineNumber":242,"sourceCode":"\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}\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{","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/forwardingrule.go#L224-L260","documentation":"After creating a forwarding rule, kOps must read it back to obtain the label fingerprint (GCE labels cannot be set at creation). This error wraps a failure of that ForwardingRules().Get call on a resource that was just created.","triggerScenarios":"Labels are set on the task (e.Labels != nil), creation succeeded, but ForwardingRules().Get(ctx, project, region, name) fails — typically propagation delay (the resource is not yet visible via Get), a permission error, or a transient API error.","commonSituations":"GCE eventual-consistency: Get immediately after operation completion occasionally 404s; IAM changes revoked compute.viewer; regional mismatch if project/region resolution changed.","solutions":["Re-run kops update — the rule now exists and the next pass will only set labels","Check IAM permissions for the service account (compute.forwardingRules.get)","Retry after a short delay if it was an eventual-consistency 404","Verify project/region are correct in the kOps cluster spec"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"null","typeGuard":null,"tryCatchPattern":"r, err := cloud.Compute().ForwardingRules().Get(ctx, project, region, name)\nif err != nil {\n    if isNotFound(err) {\n        // eventual consistency right after creation: brief backoff then retry once\n        time.Sleep(2 * time.Second)\n        r, err = cloud.Compute().ForwardingRules().Get(ctx, project, region, name)\n    }\n    if err != nil {\n        return fmt.Errorf(\"reading created ForwardingRule %q: %v\", name, err)\n    }\n}","preventionTips":["Grant compute.forwardingRules.get to the kOps service account","Expect eventual-consistency 404s immediately after creation; add small backoff","Confirm project/region in the cluster spec match the created resource"],"tags":["gce","forwarding-rule","labels","read-after-write"],"backgroundTag":"read-after-write-404","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"}