{"record":{"id":"571caa01083cdf32","repo":"kubernetes/kops","slug":"listing-front-ends-for-load-balancer-s-w","errorCode":null,"errorMessage":"listing front-ends for load-balancer %s: %w","messagePattern":"listing front-ends for load-balancer (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go","lineNumber":82,"sourceCode":"func (l *LBFrontend) CompareWithID() *string {\n\treturn l.ID\n}\n\nfunc (l *LBFrontend) Find(context *fi.CloudupContext) (*LBFrontend, error) {\n\tcloud := context.T.Cloud.(scaleway.ScwCloud)\n\tlbService := cloud.LBService()\n\n\tif l.LoadBalancer.LBID == nil {\n\t\treturn nil, nil\n\t}\n\n\tfrontendResponse, err := lbService.ListFrontends(&lb.ZonedAPIListFrontendsRequest{\n\t\tZone: scw.Zone(cloud.Zone()),\n\t\tLBID: fi.ValueOf(l.LoadBalancer.LBID),\n\t\tName: l.Name,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"listing front-ends for load-balancer %s: %w\", fi.ValueOf(l.LoadBalancer.LBID), err)\n\t}\n\tif frontendResponse.TotalCount != 1 {\n\t\treturn nil, nil\n\t}\n\tfrontend := frontendResponse.Frontends[0]\n\n\treturn &LBFrontend{\n\t\tName:        new(frontend.Name),\n\t\tLifecycle:   l.Lifecycle,\n\t\tID:          new(frontend.ID),\n\t\tZone:        new(string(frontend.LB.Zone)),\n\t\tInboundPort: new(frontend.InboundPort),\n\t\tLoadBalancer: &LoadBalancer{\n\t\t\tName: new(frontend.LB.Name),\n\t\t},\n\t\tLBBackend: &LBBackend{\n\t\t\tName: new(frontend.Backend.Name),\n\t\t\tID:   new(frontend.Backend.ID),","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/lb_frontend.go#L64-L100","documentation":"kOps wraps failures from `lbService.ListFrontends` when the LoadBalancerFrontend task's Find looks up the existing front-end by name for the load-balancer. The error comes from the Scaleway LB Zoned API, not from the 'not found' case (that returns nil, nil when TotalCount != 1). Thrown in Find of lb_frontend.go.","triggerScenarios":"Find calls ListFrontends with Zone=scw.Zone(cloud.Zone()), LBID=l.LoadBalancer.LBID, Name=l.Name; the list call itself fails — invalid LBID, zone mismatch between cloud and LB, auth failure, or API outage.","commonSituations":"LB was deleted out-of-band so LBID is stale; cloud.Zone() returns a different zone than where the LB lives; expired Scaleway credentials; network partition during reconcile.","solutions":["Rerun `kops update cluster` — often transient","Verify the LB exists at the configured zone and LBID in the Scaleway console","Confirm cloud zone configuration matches the LB's zone","Check Scaleway credentials/permissions for the LB API","Inspect wrapped scw error (e.g. 404 not_found vs 403 permissions) for the precise cause"],"exampleFix":"// before: no diagnostics of cause\nreturn nil, fmt.Errorf(\"listing front-ends for load-balancer %s: %w\", lbID, err)\n// after: classify the SDK error\nvar serr *scw.ResponseError\nif errors.As(err, &serr) && serr.Status == 404 {\n    return nil, nil // LB gone; treat as not found\n}\nreturn nil, fmt.Errorf(\"listing front-ends for load-balancer %s: %w\", lbID, err)","handlingStrategy":"type-guard","validationCode":"// confirm LB is reachable before listing its front-ends\nlbs, err := lbService.ListLBs(&lb.ZonedAPIListLBsRequest{Zone: scw.Zone(cloud.Zone()), Name: lbName}, scw.WithAllPages())\nif err != nil { return err }\nif lbs.TotalCount != 1 { return nil } // LB gone; nothing to find","typeGuard":"func lbNotFound(err error) bool {\n    var serr *scw.ResponseError\n    return errors.As(err, &serr) && serr.Status == 404\n}","tryCatchPattern":"if err != nil {\n    if lbNotFound(err) { return nil, nil } // treat as absent\n    return nil, fmt.Errorf(\"listing front-ends for load-balancer %s: %w\", lbID, err)\n}","preventionTips":["Ensure cloud zone matches the LB's zone before lookup","Handle the TotalCount != 1 not-found path separately from hard errors","Classify scw.ResponseError status codes in Find implementations"],"tags":["scaleway","load-balancer","api-error","find"],"backgroundTag":"scaleway-lb-list-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"}