{"record":{"id":"e61ab6bb7a8d9679","repo":"thanos-io/thanos","slug":"delete-file-dir","errorCode":null,"errorMessage":"delete file/dir","messagePattern":"delete file/dir","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runutil/runutil.go","lineNumber":231,"sourceCode":"\t\t}\n\n\t\tif ignore {\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(matchingIgnores) == 0 {\n\t\t\tif err := os.RemoveAll(filepath.Join(dir, d.Name())); err != nil {\n\t\t\t\tgroupErrs.Add(err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif err := DeleteAll(filepath.Join(dir, d.Name()), matchingIgnores...); err != nil {\n\t\t\tgroupErrs.Add(err)\n\t\t}\n\t}\n\n\tif groupErrs.Err() != nil {\n\t\treturn errors.Wrap(groupErrs.Err(), \"delete file/dir\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":213,"sourceCodeEnd":235,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/runutil/runutil.go#L213-L235","documentation":"Raised in runutil.DeleteAll after recursing: at least one os.RemoveAll or recursive DeleteAll call failed while deleting the directory's contents, so the collected MultiError is wrapped with 'delete file/dir'. Note DeleteAll is not idempotent — a partial failure leaves some entries behind.","triggerScenarios":"Thrown at pkg/runutil/runutil.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the MultiError contents for the specific files that failed to remove","Check for open file handles, busy mounts, or permission issues blocking removal","Re-run cleanup for the remaining paths, as removal failures leave partial state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}