{"record":{"id":"cde4e243835c1799","repo":"kubernetes/kops","slug":"creating-back-end-for-load-balancer-s-w","errorCode":null,"errorMessage":"creating back-end for load-balancer %s: %w","messagePattern":"creating back-end for load-balancer (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/lb_backend.go","lineNumber":187,"sourceCode":"\t\t\tZone:                 zone,\n\t\t\tLBID:                 fi.ValueOf(expected.LoadBalancer.LBID),\n\t\t\tName:                 fi.ValueOf(expected.Name),\n\t\t\tForwardProtocol:      lb.Protocol(fi.ValueOf(expected.ForwardProtocol)),\n\t\t\tForwardPort:          fi.ValueOf(expected.ForwardPort),\n\t\t\tForwardPortAlgorithm: lb.ForwardPortAlgorithm(fi.ValueOf(expected.ForwardPortAlgorithm)),\n\t\t\tStickySessions:       lb.StickySessionsType(fi.ValueOf(expected.StickySessions)),\n\t\t\tHealthCheck: &lb.HealthCheck{\n\t\t\t\tCheckMaxRetries: 5,\n\t\t\t\tTCPConfig:       &lb.HealthCheckTCPConfig{},\n\t\t\t\tPort:            fi.ValueOf(expected.ForwardPort),\n\t\t\t\tCheckTimeout:    scw.TimeDurationPtr(3000),\n\t\t\t\tCheckDelay:      scw.TimeDurationPtr(1001),\n\t\t\t},\n\t\t\tServerIP:      controlPlanesIPs,\n\t\t\tProxyProtocol: lb.ProxyProtocol(fi.ValueOf(expected.ProxyProtocol)),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating back-end for load-balancer %s: %w\", fi.ValueOf(expected.LoadBalancer.Name), err)\n\t\t}\n\n\t\texpected.ID = &backendCreated.ID\n\n\t}\n\n\t_, err = lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{\n\t\tLBID: fi.ValueOf(expected.LoadBalancer.LBID),\n\t\tZone: 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 terraformLBBackend struct {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/lb_backend.go#L169-L205","documentation":"kOps wraps any failure from `lbService.CreateBackend` when no matching back-end exists and one must be created for the Scaleway load-balancer, including the backend name, health-check config, server IPs and proxy-protocol settings. The underlying error is from the Scaleway LB Zoned API. Thrown in RenderScw of the LoadBalancerBackend task.","triggerScenarios":"RenderScw's `else` branch (no existing back-end found) calls CreateBackend with zone, name, forward-port, health-check (CheckDelay etc.), ServerIP=controlPlanesIPs and ProxyProtocol; the API rejects it (invalid health check params, name conflicts, LB not ready, quota, auth).","commonSituations":"Invalid proxy protocol or port config from cluster spec; LB still in creating state so backend creation fails; hitting Scaleway LB backend quotas; expired credentials; typos in zone.","solutions":["Rerun `kops update cluster` after the LB reaches 'ready' state","Validate cluster-spec LB config (forwardPort, healthCheck settings, proxyProtocol) against Scaleway API constraints","Check Scaleway console/API for LB state and quotas in the zone","Verify Scaleway credentials and project has LB service enabled","Inspect the wrapped SDK error (scw.StatusError) for the exact 4xx/5xx code"],"exampleFix":"// before: create immediately after LB creation\nbackendCreated, err := lbService.CreateBackend(req)\n// after: ensure LB is ready first\nif _, err := lbService.WaitForLb(&lb.ZonedAPIWaitForLBRequest{LBID: lbID, Zone: zone}); err != nil {\n    return fmt.Errorf(\"waiting for load-balancer before backend creation: %w\", err)\n}\nbackendCreated, err := lbService.CreateBackend(req)","handlingStrategy":"validation","validationCode":"// pre-validate backend creation inputs\nname := fi.ValueOf(expected.Name)\nport := fi.ValueOf(expected.ForwardPort)\nif name == \"\" { return errors.New(\"backend name is empty\") }\nif port < 1 || port > 65535 { return fmt.Errorf(\"invalid forward port %d\", port) }\nif len(controlPlanesIPs) == 0 { return errors.New(\"no control-plane IPs resolved; refusing to create empty backend\") }\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 == 409 {\n    // name conflict: re-run Find and switch to the update path\n}","preventionTips":["Validate cluster-spec LB settings (ports, health check, proxy protocol) before applying","Ensure the LB is out of transient state before creating children","Avoid duplicate backend names on the same LB","Confirm quotas in the target zone"],"tags":["scaleway","load-balancer","api-error","configuration"],"backgroundTag":"scaleway-lb-backend-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"}