{"record":{"id":"4e0ba5fe1fda4462","repo":"kubernetes/kops","slug":"got-retryable-error-while-deleting-tags-on-q-but","errorCode":null,"errorMessage":"got retryable error while deleting tags on %q, but retried too many times without success: %v","messagePattern":"got retryable error while deleting tags on %q, but retried too many times without success: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":1321,"sourceCode":"\tec2Tags := []ec2types.Tag{}\n\tfor k, v := range tags {\n\t\tec2Tags = append(ec2Tags, ec2types.Tag{Key: aws.String(k), Value: aws.String(v)})\n\t}\n\n\tattempt := 0\n\tfor {\n\t\tattempt++\n\n\t\trequest := &ec2.DeleteTagsInput{\n\t\t\tTags:      ec2Tags,\n\t\t\tResources: []string{resourceID},\n\t\t}\n\n\t\t_, err := c.EC2().DeleteTags(ctx, request)\n\t\tif err != nil {\n\t\t\tif isTagsEventualConsistencyError(err) {\n\t\t\t\tif attempt > DeleteTagsMaxAttempts {\n\t\t\t\t\treturn fmt.Errorf(\"got retryable error while deleting tags on %q, but retried too many times without success: %v\", resourceID, err)\n\t\t\t\t}\n\n\t\t\t\tif (attempt % DeleteTagsLogInterval) == 0 {\n\t\t\t\t\tklog.Infof(\"waiting for eventual consistency while deleting tags on %q\", resourceID)\n\t\t\t\t}\n\n\t\t\t\tklog.V(2).Infof(\"will retry after encountering error deleting tags on %q: %v\", resourceID, err)\n\t\t\t\ttime.Sleep(DeleteTagsRetryInterval)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treturn fmt.Errorf(\"error deleting tags on %v: %v\", resourceID, err)\n\t\t}\n\n\t\treturn nil\n\t}\n}\n","sourceCodeStart":1303,"sourceCodeEnd":1339,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L1303-L1339","documentation":"kOps wraps DeleteTags failures when AWS keeps returning a retryable 'eventual consistency' error (e.g. resource not yet visible to the tagging API) after DeleteTagsMaxAttempts retries. It signals that tag deletion was attempted repeatedly but the AWS side still reported the resource/tag as missing or not found.","triggerScenarios":"Deleting tags on an EC2 resource (VPC, subnet, IGW, instance, etc.) immediately after resource creation or an immediate delete/recreate cycle, where the DescribeTags/DeleteTags APIs lag behind CreateTags.","commonSituations":"Rapidly reusing a VPC name right after deleting a cluster; tags deleted during teardown while AWS still returns InvalidResourceId/NotFound due to propagation delay; kops destroy-cluster racing AWS consistency.","solutions":["Wait a few minutes and re-run the kops command (the resource state will have converged).","Use the latest kops release; DeleteTagsMaxAttempts/DeleteTagsRetryInterval tuning has improved over versions.","If the resource truly exists, verify the resource ID is correct with `aws ec2 describe-tags --filters Name=resource-id,Values=<id>`.","As a last resort, delete the tags manually with the AWS CLI and retry kops."],"exampleFix":"// before: repeatedly hitting eventual consistency on a fresh resource\nerr := cloud.DeleteTags(id, tags) // retried too many times\n// after: add delay/backoff before deleting tags on a newly created resource\ntime.Sleep(30 * time.Second) // or poll until tags visible via DescribeTags\nerr := cloud.DeleteTags(id, tags)","handlingStrategy":"retry","validationCode":"// Ensure the resource exists and tags are visible before deleting\nout, err := ec2Client.DescribeTags(ctx, &ec2.DescribeTagsInput{Filters: []ec2types.Filter{{Name: aws.String(\"resource-id\"), Values: []string{resourceID}}}})\nif err != nil || len(out.Tags) == 0 { /* defer deletion or abort */ }","typeGuard":null,"tryCatchPattern":"err := cloud.DeleteTags(ctx, resourceID, tagKeys)\nvar retriable *exhaustedRetriesError\nif errors.As(err, &retriable) {\n    klog.Warningf(\"tag deletion still eventually-inconsistent for %s; re-run later\", resourceID)\n}","preventionTips":["Avoid delete-then-recreate of resources with the same ID space in quick succession","Poll DescribeTags until tags are visible before deleting","Keep kops up to date for retry-interval improvements","Handle partial failures in destroy workflows idempotently"],"tags":["aws","ec2","tags","eventual-consistency","retry-exhausted"],"backgroundTag":"aws-eventual-consistency","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"}