{"record":{"id":"b2ff9cbb519e4c4d","repo":"kubernetes/kops","slug":"deregistering-cloud-instance-s-of-group-q-remov","errorCode":null,"errorMessage":"deregistering cloud instance %s of group %q: removing IP from lb: %w","messagePattern":"deregistering cloud instance (.+?) of group %q: removing IP from lb: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scaleway/cloud.go","lineNumber":289,"sourceCode":"\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\n}\n\nfunc (s *scwCloudImplementation) DetachInstance(i *cloudinstances.CloudInstance) error {\n\tklog.V(8).Infof(\"Scaleway DetachInstance is not implemented yet\")\n\treturn fmt.Errorf(\"DetachInstance is not implemented yet for Scaleway\")\n}\n\n// FindClusterStatus was used before etcd-manager to check the etcd cluster status and prevent unsupported changes.\nfunc (s *scwCloudImplementation) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error) {\n\tklog.V(8).Info(\"Scaleway FindClusterStatus is not implemented\")\n\treturn nil, nil","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/cloud.go#L271-L307","documentation":"When the instance's IP is found in a back-end pool, DeregisterInstance calls lbAPI.RemoveBackendServers to detach it; errors are wrapped as \"deregistering cloud instance %s of group %q: removing IP from lb: %w\". The IP and back-end were identified correctly but the mutation against the Scaleway LB API failed, so the node may still receive traffic.","triggerScenarios":"lbAPI.RemoveBackendServers(&lb.ZonedAPIRemoveBackendServersRequest{Zone: s.zone, BackendID: backEnd.ID, ServerIP: []string{serverIP}}) fails: backend ID stale/deleted concurrently, cross-zone request, IP no longer in pool (conflict), LB under another operation (draining/locking), permission denied, or transient API error.","commonSituations":"Two rolling-update controllers deregistering the same node concurrently; LB in a transitional state right after a configuration change; IAM key lacking lb:update permission; zone mismatch on a zoned LB.","solutions":["Check the wrapped status code: 409/404 usually means the IP was already removed or backend changed — verify the pool in the console and treat as done.","Ensure s.zone matches the LB/backend zone.","Grant the IAM policy lb:update (back-end mutation) permission.","Retry after the LB finishes any in-progress operation or transient error clears."],"exampleFix":"// before\n// concurrent deregister: second RemoveBackendServers 404s\n// after: check pool membership first / tolerate not-found\n// if !backend.Pool contains serverIP { skip RemoveBackendServers }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := s.lbAPI.RemoveBackendServers(&lb.ZonedAPIRemoveBackendServersRequest{Zone: s.zone, BackendID: backEnd.ID, ServerIP: []string{serverIP}})\nif err != nil {\n  var respErr *scw.ResponseError\n  if errors.As(err, &respErr) && (respErr.StatusCode == 404 || respErr.StatusCode == 409) {\n    klog.Infof(\"IP %s already removed from backend %s\", serverIP, backEnd.ID)\n    return nil\n  }\n  return fmt.Errorf(\"removing IP from lb backend %s: %w\", backEnd.ID, err)\n}","preventionTips":["Serialize rolling updates so only one controller deregisters a node at a time.","Treat 404/409 on RemoveBackendServers as success (idempotent deregistration).","Grant lb:update permission to the kops IAM key.","Wait for LB configuration-drain windows before retrying failed removals."],"tags":["scaleway","load-balancer","backend-servers","deregister"],"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"}