{"record":{"id":"082c4420aa8e4385","repo":"kubernetes/kops","slug":"invalid-path-in-swiftfs-tree-s","errorCode":null,"errorMessage":"invalid path in swiftfs tree: %s","messagePattern":"invalid path in swiftfs tree: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/swiftfs.go","lineNumber":328,"sourceCode":"\t\treturn err\n\t} else if done {\n\t\treturn nil\n\t} else {\n\t\treturn wait.ErrWaitTimeout\n\t}\n}\n\nfunc (p *SwiftPath) RemoveAll(ctx context.Context) error {\n\ttree, err := p.ReadTree(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tobjects := make([]string, len(tree))\n\tfor i := range tree {\n\t\tswiftObject, isSwiftObject := tree[i].(*SwiftPath)\n\t\tif !isSwiftObject {\n\t\t\treturn fmt.Errorf(\"invalid path in swiftfs tree: %s\", tree[i].Path())\n\t\t}\n\t\tobjects[i] = swiftObject.key\n\t}\n\n\tobjectsToDelete := []string(nil)\n\tfor len(objects) > 0 {\n\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 {","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/swiftfs.go#L310-L346","documentation":"Internal type guard in SwiftPath.RemoveAll: the paths returned by ReadTree must all be *SwiftPath, but one entry is a different Path implementation. This indicates the tree listing was somehow mixed with another VFS backend — a programming invariant violation rather than a runtime condition — so the bulk-delete keys cannot be extracted and the purge aborts.","triggerScenarios":"Thrown at util/pkg/vfs/swiftfs.go:328 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":"type-guard","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"}