{"record":{"id":"04586905da98ba40","repo":"kubernetes/kops","slug":"error-deleting-group-q-w","errorCode":null,"errorMessage":"error deleting group %q: %w","messagePattern":"error deleting group %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scaleway/cloud.go","lineNumber":227,"sourceCode":"\nfunc (s *scwCloudImplementation) IPAMService() *ipam.API {\n\treturn s.ipamAPI\n}\n\nfunc (s *scwCloudImplementation) LBService() *lb.ZonedAPI {\n\treturn s.lbAPI\n}\n\nfunc (s *scwCloudImplementation) MarketplaceService() *marketplace.API {\n\treturn s.marketplaceAPI\n}\n\nfunc (s *scwCloudImplementation) DeleteGroup(group *cloudinstances.CloudInstanceGroup) error {\n\ttoDelete := append(group.NeedUpdate, group.Ready...)\n\tfor _, cloudInstance := range toDelete {\n\t\terr := s.DeleteInstance(cloudInstance)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error deleting group %q: %w\", group.HumanName, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (s *scwCloudImplementation) DeleteInstance(i *cloudinstances.CloudInstance) error {\n\tserver, err := s.instanceAPI.GetServer(&instance.GetServerRequest{\n\t\tZone:     s.zone,\n\t\tServerID: i.ID,\n\t})\n\tif err != nil {\n\t\tif is404Error(err) {\n\t\t\tklog.V(4).Infof(\"error deleting cloud instance %s of group %s : instance was already deleted\", i.ID, i.CloudInstanceGroup.HumanName)\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"deleting cloud instance %s of group %s: %w\", i.ID, i.CloudInstanceGroup.HumanName, err)\n\t}\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/cloud.go#L209-L245","documentation":"DeleteGroup iterates over all instances in a CloudInstanceGroup (NeedUpdate + Ready) and calls DeleteInstance on each. If any single instance deletion fails, the whole group deletion is aborted and wrapped as \"error deleting group %q: %w\" with the group's HumanName. It is a fan-out aggregator error — the root cause is always one of the per-instance DeleteInstance failures.","triggerScenarios":"s.DeleteInstance fails for at least one instance in the group: the Scaleway instance API DeleteServer/GetServer call fails with a non-404 error (auth failure, instance in a state that cannot be deleted, network error, missing permission).","commonSituations":"Rolling-update of an instance group where one server is stuck deleting or in an error state; IAM credentials lacking instance deletion permission; a server already being deleted concurrently by another controller producing a conflict error.","solutions":["Unwrap to find the failing instance ID and underlying Scaleway API error from the DeleteInstance chain.","Check the instance's state in the Scaleway console; manually delete or wait for a stuck server before retrying.","Verify the Scaleway credentials have permission to delete servers in that project/zone.","Re-run the kops rolling-update / delete command — DeleteInstance tolerates 404, so retries of already-deleted instances are safe."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := cloud.DeleteGroup(group); err != nil {\n  var scwErr *scw.ResourceNotFoundError\n  if errors.As(err, &scwErr) {\n    klog.Warningf(\"instance in group %s already gone; safe to retry\", group.HumanName)\n  } else {\n    klog.Errorf(\"group %s delete failed: %v — inspect per-instance errors\", group.HumanName, err)\n  }\n  return err\n}","preventionTips":["Check all group instances are in a deletable state before rolling updates.","Grant the Scaleway IAM policy servers:delete and servers:read scopes.","Avoid concurrent kops runs targeting the same instance group.","Retry idempotently — 404s on already-deleted instances are tolerated."],"tags":["scaleway","instance-group","delete","rolling-update"],"backgroundTag":"cloud-instance-deletion-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"}