{"record":{"id":"721aba138bb3a013","repo":"kubernetes/kops","slug":"error-remove-d-files-w","errorCode":null,"errorMessage":"error remove %d files: %w","messagePattern":"error remove (.+?) files: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/swiftfs.go","lineNumber":353,"sourceCode":"\t\t// BulkDelete can only process 10000 objects per call\n\t\tif len(objects) > 10000 {\n\t\t\tobjectsToDelete = objects[:10000]\n\t\t\tobjects = objects[10000:]\n\t\t} else {\n\t\t\tobjectsToDelete = objects\n\t\t\tobjects = nil\n\t\t}\n\n\t\tdone, err := RetryWithBackoff(swiftWriteBackoff, func() (bool, error) {\n\t\t\tclient, err := p.getClient(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tif _, err := swiftobject.BulkDelete(ctx, client, p.bucket, objectsToDelete).Extract(); err != nil {\n\t\t\t\tif isSwiftNotFound(err) {\n\t\t\t\t\treturn true, os.ErrNotExist\n\t\t\t\t}\n\t\t\t\treturn false, fmt.Errorf(\"error remove %d files: %w\", len(objectsToDelete), err)\n\t\t\t}\n\n\t\t\treturn true, nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if done {\n\t\t\tcontinue\n\t\t} else {\n\t\t\treturn wait.ErrWaitTimeout\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (p *SwiftPath) RemoveAllVersions(ctx context.Context) error {\n\treturn p.Remove(ctx)","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/swiftfs.go#L335-L371","documentation":"Returned inside SwiftPath.RemoveAll's retry loop when the Swift bulk-delete call fails for a batch (up to 10000 objects) with something other than 404. The container refused the bulk delete — permissions, too-many-requests, or proxy error — and the error reports how many objects were in the failed batch; RetryWithBackoff re-attempts the same batch.","triggerScenarios":"Thrown at util/pkg/vfs/swiftfs.go:353 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check container delete permissions and auth token validity","Rely on swiftWriteBackoff retries for transient throttling; if persistent, inspect the wrapped Swift error","If batches consistently fail, reduce concurrency against the Swift proxy"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}