{"record":{"id":"bfb06939e48dc972","repo":"kubernetes/kops","slug":"creating-front-end-for-load-balancer-s-w","errorCode":null,"errorMessage":"creating front-end for load-balancer %s: %w","messagePattern":"creating front-end for load-balancer (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go","lineNumber":157,"sourceCode":"\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}\n\n\t_, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{\n\t\tLBID: fi.ValueOf(expected.LoadBalancer.LBID),\n\t\tZone: scw.Zone(fi.ValueOf(expected.Zone)),\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"waiting for load-balancer %s: %w\", fi.ValueOf(expected.LoadBalancer.Name), err)\n\t}\n\n\treturn nil\n}\n\ntype terraformLBFrontend struct {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go#L139-L175","documentation":"kOps wraps failures from `lbService.CreateFrontend` when no matching front-end exists and one must be created (LBID, name, inbound port, default backend) in RenderScw of LoadBalancerFrontend. The underlying error is from the Scaleway LB Zoned API.","triggerScenarios":"RenderScw's else branch calls CreateFrontend with Zone, LBID, Name, InboundPort, BackendID; the API rejects — LBID invalid or LB not ready, name conflict, invalid port, quota, or auth failure.","commonSituations":"Front-end name conflicts with an existing front-end on the same LB; creating frontend before the LB finished provisioning; invalid port from cluster spec; expired credentials.","solutions":["Rerun `kops update cluster` once the LB is in ready state","Check for an existing front-end with the same name/port on the LB in the Scaleway console","Validate InboundPort and LBID values before creation","Verify credentials and LB quotas for the project/zone","Inspect the wrapped scw error code to distinguish conflict vs validation vs auth"],"exampleFix":"// before: create immediately\nfrontendCreated, err := lbService.CreateFrontend(req)\n// after: wait for LB ready first\nif _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{LBID: lbID, Zone: zone}); err != nil {\n    return fmt.Errorf(\"waiting for load-balancer before frontend creation: %w\", err)\n}\nfrontendCreated, err := lbService.CreateFrontend(req)","handlingStrategy":"validation","validationCode":"// pre-create checks\nlbs, err := lbService.ListLBs(&lb.ZonedAPIListLBsRequest{Zone: zone, Name: lbName}, scw.WithAllPages())\nif err != nil || lbs.TotalCount != 1 { return fmt.Errorf(\"LB %s not ready in %s\", lbName, zone) }\nport := fi.ValueOf(expected.InboundPort)\nif port < 1 || port > 65535 { return fmt.Errorf(\"invalid inbound port %d\", port) }\nif fi.ValueOf(expected.LBBackend.ID) == \"\" { return errors.New(\"cannot create frontend without backend\") }","typeGuard":null,"tryCatchPattern":"var serr *scw.ResponseError\nif errors.As(err, &serr) && serr.Status == 409 {\n    // conflicting frontend name/port: re-run Find and take update path\n}","preventionTips":["Create back-ends before front-ends on a new LB","Use unique front-end names per LB","Ensure the LB is in ready state before adding front-ends","Check per-zone LB quotas"],"tags":["scaleway","load-balancer","api-error","frontend"],"backgroundTag":"scaleway-lb-frontend-create-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"}