{"record":{"id":"a06d84d3f21bfe71","repo":"kubernetes/kops","slug":"not-making-progress-deleting-resources-giving-up","errorCode":null,"errorMessage":"not making progress deleting resources; giving up","messagePattern":"not making progress deleting resources; giving up","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/ops/delete.go","lineNumber":176,"sourceCode":"\t\t\twg.Wait()\n\t\t}\n\n\t\tif len(resourceMap) == len(done) {\n\t\t\treturn nil\n\t\t}\n\n\t\tfmt.Printf(\"Not all resources deleted; waiting before reattempting deletion\\n\")\n\t\tfor k := range resourceMap {\n\t\t\tif _, d := done[k]; d {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfmt.Printf(\"\\t%s\\n\", k)\n\t\t}\n\n\t\titerationsWithNoProgress++\n\t\tif iterationsWithNoProgress > count && count != 0 {\n\t\t\treturn fmt.Errorf(\"not making progress deleting resources; giving up\")\n\t\t}\n\n\t\ttime.Sleep(interval)\n\t}\n}\n","sourceCodeStart":158,"sourceCodeEnd":182,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/ops/delete.go#L158-L182","documentation":"DeleteResources tracks how many consecutive iterations pass without any resource transitioning to Done. After `count` no-progress iterations (when count != 0), it concludes deletion is stuck and returns this error instead of looping forever. Unlike the timeout error, this indicates active failures, not just slowness.","triggerScenarios":"DeleteResources (pkg/resources/ops/delete.go:176) reaches iterationsWithNoProgress > count because every pass the same resources fail to delete — e.g. an API returns a persistent error (auth failure, dependency conflict, resource not actually removable) so `failed` never drains.","commonSituations":"IAM permissions missing for deleting a specific resource type (e.g. ec2:DeleteVolume); a resource with a cloud-side dependency not modeled in depMap; API rate limits; region mismatch making deletes 404 repeatedly; deleting only a subset of a cluster where an unselected resource blocks others.","solutions":["Inspect the per-resource failure messages printed during the loop (the failed resources are listed) and fix root causes (IAM, dependency, region)","Remove or resolve the blocking resource manually in the cloud, then re-run deletion","Increase the count parameter to allow more retry iterations if failures are transient","Verify credentials/region match the cluster; fix API errors causing every delete to fail","Run with -v (klog verbosity) to see dependency skip messages and identify the stuck dependency chain"],"exampleFix":"// before: persistent auth failure on DeleteSnapshot\n// IAM policy missing ec2:DeleteSnapshot → same resources fail every pass\n// after: grant the permission, then re-run\n// {\"Effect\":\"Allow\",\"Action\":[\"ec2:DeleteSnapshot\"],\"Resource\":\"*\"}","handlingStrategy":"try-catch","validationCode":"// Pre-validate IAM permissions for resource types in the set before deleting\ntypes := map[string]bool{}\nfor _, r := range resourceMap { types[r.Type] = true }\nklog.Infof(\"resource types to delete: %v\", types) // ensure credentials cover them all","typeGuard":null,"tryCatchPattern":"err := ops.DeleteResources(cloud, resourceMap, count, interval, wait)\nif err != nil && strings.Contains(err.Error(), \"not making progress\") {\n    klog.Errorf(\"deletion stuck; inspect failed resources above and fix IAM/dependencies before retrying\")\n    // do not blind-retry; diagnose the repeatedly failing resource first\n    return err\n}","preventionTips":["Read the listed failed resource keys in output before retrying","Verify IAM permissions for every resource type being deleted","Use klog -v=4 to see which dependencies never complete","Remove blocking cloud-side dependencies (targets, attachments) manually"],"tags":["delete","retry","stuck","cloud"],"backgroundTag":"deletion-no-progress","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"}