{"record":{"id":"9d4af887f975b7d8","repo":"kubernetes/kops","slug":"updating-front-end-for-load-balancer-s-w","errorCode":null,"errorMessage":"updating front-end for load-balancer %s: %w","messagePattern":"updating front-end for load-balancer (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go","lineNumber":144,"sourceCode":"\t\t}\n\t}\n\treturn nil\n}\n\nfunc (l *LBFrontend) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *LBFrontend) error {\n\tlbService := t.Cloud.LBService()\n\n\tif actual != nil {\n\n\t\t_, err := lbService.UpdateFrontend(&lb.ZonedAPIUpdateFrontendRequest{\n\t\t\tZone:        scw.Zone(fi.ValueOf(actual.Zone)),\n\t\t\tFrontendID:  fi.ValueOf(actual.ID),\n\t\t\tName:        fi.ValueOf(actual.Name),\n\t\t\tInboundPort: fi.ValueOf(expected.InboundPort),\n\t\t\tBackendID:   fi.ValueOf(actual.LBBackend.ID),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"updating front-end for load-balancer %s: %w\", fi.ValueOf(actual.LoadBalancer.Name), err)\n\t\t}\n\n\t} else {\n\n\t\tfrontendCreated, err := lbService.CreateFrontend(&lb.ZonedAPICreateFrontendRequest{\n\t\t\tZone:        scw.Zone(fi.ValueOf(expected.Zone)),\n\t\t\tLBID:        fi.ValueOf(expected.LoadBalancer.LBID),\n\t\t\tName:        fi.ValueOf(expected.Name),\n\t\t\tInboundPort: fi.ValueOf(expected.InboundPort),\n\t\t\tBackendID:   fi.ValueOf(expected.LBBackend.ID),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating front-end for load-balancer %s: %w\", fi.ValueOf(expected.LoadBalancer.Name), err)\n\t\t}\n\n\t\texpected.ID = &frontendCreated.ID\n\n\t}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go#L126-L162","documentation":"kOps wraps failures from `lbService.UpdateFrontend` when an existing Scaleway LB front-end must be reconciled (name, inbound port, or default backend) in RenderScw of LoadBalancerFrontend. The wrapped error comes from the Scaleway LB Zoned API.","triggerScenarios":"RenderScw's update branch calls UpdateFrontend with FrontendID=actual.ID, Name, InboundPort=expected.InboundPort, BackendID; the API rejects — invalid InboundPort (privileged/out of range), backend ID stale, frontend deleted concurrently, auth/quota error.","commonSituations":"Changing the API-server port in the cluster spec to an invalid/in-use port; backend replaced between find and update (race); LB in transient state; credentials expired.","solutions":["Rerun `kops update cluster` after checking LB state in the Scaleway console","Validate InboundPort is in the allowed Scaleway range (e.g. 1-65535, not conflicting)","Verify the referenced backend still exists (BackendID from actual may be stale)","Check Scaleway credentials/permissions","Inspect the wrapped scw error code (409 conflict, 422 validation) and adjust the cluster spec accordingly"],"exampleFix":"// before: update without validating port\nInboundPort: fi.ValueOf(expected.InboundPort),\n// after: validate the port first\nport := fi.ValueOf(expected.InboundPort)\nif port < 1 || port > 65535 {\n    return fmt.Errorf(\"invalid inbound port %d for front-end %s\", port, fi.ValueOf(actual.Name))\n}\nInboundPort: &port,","handlingStrategy":"validation","validationCode":"// validate inputs before UpdateFrontend\nport := fi.ValueOf(expected.InboundPort)\nif port < 1 || port > 65535 { return fmt.Errorf(\"invalid inbound port %d\", port) }\nif fi.ValueOf(actual.LBBackend.ID) == \"\" { return errors.New(\"backend ID missing for frontend update\") }\nif _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{Zone: zone, LBID: lbID}); err != nil { return err }","typeGuard":null,"tryCatchPattern":"var serr *scw.ResponseError\nif errors.As(err, &serr) && serr.Status == 404 {\n    // frontend deleted concurrently: fall back to CreateFrontend path\n}","preventionTips":["Avoid changing API-server ports to privileged or conflicting values","Verify referenced backends exist before attaching them to front-ends","Wait for LB readiness before mutation","Don't delete/modify front-ends in the Scaleway console while kOps manages them"],"tags":["scaleway","load-balancer","api-error","frontend"],"backgroundTag":"scaleway-lb-frontend-update-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"}