thanos-io/thanos · error

delete file/dir

Error message

delete file/dir

What it means

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.

Solutions

  1. Inspect the MultiError contents for the specific files that failed to remove
  2. Check for open file handles, busy mounts, or permission issues blocking removal
  3. Re-run cleanup for the remaining paths, as removal failures leave partial state
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/runutil/runutil.go:231 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07). Data as JSON: /api/errors/e61ab6bb7a8d9679. Report an issue: GitHub.

Appendix: source

Thrown at pkg/runutil/runutil.go:231

		}

		if ignore {
			continue
		}

		if len(matchingIgnores) == 0 {
			if err := os.RemoveAll(filepath.Join(dir, d.Name())); err != nil {
				groupErrs.Add(err)
			}
			continue
		}
		if err := DeleteAll(filepath.Join(dir, d.Name()), matchingIgnores...); err != nil {
			groupErrs.Add(err)
		}
	}

	if groupErrs.Err() != nil {
		return errors.Wrap(groupErrs.Err(), "delete file/dir")
	}
	return nil
}

View on GitHub (pinned to 35b8b99117)