{"record":{"id":"15731c2d321ef120","repo":"kubernetes/kops","slug":"deregistering-cloud-instance-s-of-group-q-listi","errorCode":null,"errorMessage":"deregistering cloud instance %s of group %q: listing load-balancer's back-ends for instance creation: %w","messagePattern":"deregistering cloud instance (.+?) of group %q: listing load-balancer's back-ends for instance creation: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scaleway/cloud.go","lineNumber":278,"sourceCode":"\t\treturn fmt.Errorf(\"deregistering cloud instance %s of group %q: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t}\n\tserverIP, err := s.GetServerIP(server.Server.ID, server.Server.Zone)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deregistering cloud instance %s of group %q: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t}\n\n\t// We remove the instance's IP from load-balancers\n\tlbs, err := s.GetClusterLoadBalancers(s.ClusterName(server.Server.Tags))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deregistering cloud instance %s of group %q: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t}\n\tfor _, loadBalancer := range lbs {\n\t\tbackEnds, err := s.lbAPI.ListBackends(&lb.ZonedAPIListBackendsRequest{\n\t\t\tZone: s.zone,\n\t\t\tLBID: loadBalancer.ID,\n\t\t}, scw.WithAllPages())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"deregistering cloud instance %s of group %q: listing load-balancer's back-ends for instance creation: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t\t}\n\t\tfor _, backEnd := range backEnds.Backends {\n\t\t\tfor _, ip := range backEnd.Pool {\n\t\t\t\tif ip == serverIP {\n\t\t\t\t\t_, err := s.lbAPI.RemoveBackendServers(&lb.ZonedAPIRemoveBackendServersRequest{\n\t\t\t\t\t\tZone:      s.zone,\n\t\t\t\t\t\tBackendID: backEnd.ID,\n\t\t\t\t\t\tServerIP:  []string{serverIP},\n\t\t\t\t\t})\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"deregistering cloud instance %s of group %q: removing IP from lb: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/cloud.go#L260-L296","documentation":"For each cluster load-balancer, DeregisterInstance lists its back-ends with lbAPI.ListBackends (paged via scw.WithAllPages). Failure is wrapped as \"deregistering cloud instance %s of group %q: listing load-balancer's back-ends for instance creation: %w\" — note the copy-pasted 'for instance creation' tail from another call site. It means kOps cannot read the back-end pool, so it cannot find and remove the instance's IP.","triggerScenarios":"lbAPI.ListBackends(&lb.ZonedAPIListBackendsRequest{Zone: s.zone, LBID: loadBalancer.ID}, scw.WithAllPages()) errors: invalid LBID, wrong zone for a zoned LB (multi-AZ cluster where the LB lives in another zone), permission denied, pagination failure, or transient 5xx.","commonSituations":"Cluster spanning zones where s.zone differs from the LB's zone (ZonedAPI requires the LB's own zone); IAM key missing lb back-end read rights; LB deleted/recreated out-of-band so the cached ID is stale.","solutions":["Check the wrapped error code — 404 means the LBID is wrong or the LB was deleted; fix or recreate the LB mapping.","Ensure s.zone matches the load-balancer's zone; zoned LB APIs reject cross-zone requests.","Grant IAM permission to list LB back-ends (lb:read).","Retry if the error is a transient 5xx/throttle from Scaleway."],"exampleFix":"// before: cross-zone ListBackends\nZone: s.zone // nl-ams-1, LB is in fr-par-1\n// after\nZone: loadBalancer.Zone // use the LB's own zone","handlingStrategy":"try-catch","validationCode":"if loadBalancer.Zone != s.zone {\n  return fmt.Errorf(\"LB %s is in zone %s but client zone is %s; use the LB's own zone\", loadBalancer.ID, loadBalancer.Zone, s.zone)\n}","typeGuard":null,"tryCatchPattern":"backEnds, err := s.lbAPI.ListBackends(&lb.ZonedAPIListBackendsRequest{Zone: s.zone, LBID: loadBalancer.ID}, scw.WithAllPages())\nif err != nil {\n  var respErr *scw.ResponseError\n  if errors.As(err, &respErr) && respErr.StatusCode == 404 {\n    klog.Warningf(\"LB %s or its back-ends no longer exist; skipping\", loadBalancer.ID)\n    continue\n  }\n  return fmt.Errorf(\"listing back-ends for LB %s: %w\", loadBalancer.ID, err)\n}","preventionTips":["For zoned LBs, always call the API with the LB's own zone, not the client's default zone.","Use scw.WithAllPages so pagination truncation never hides back-ends.","Monitor Scaleway status pages for LB API incidents before maintenance windows."],"tags":["scaleway","load-balancer","backends","pagination"],"backgroundTag":"cloud-api-request-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}