mvanhorn/last30days-skill · error

engine: clean old cache: %w

Error message

engine: clean old cache: %w

What it means

Error "engine: clean old cache: %w" thrown in mvanhorn/last30days-skill.

Source

Thrown at mcp/internal/engine/extract.go:93

	tmpDir := cacheDir + ".tmp"
	if err := os.RemoveAll(tmpDir); err != nil {
		return fmt.Errorf("engine: clean tmp cache: %w", err)
	}
	if err := os.MkdirAll(tmpDir, 0o755); err != nil {
		return fmt.Errorf("engine: create tmp cache (%s, set %s to override): %w", tmpDir, CacheEnvOverride, err)
	}
	if err := extractAll(src, tmpDir); err != nil {
		_ = os.RemoveAll(tmpDir)
		return err
	}
	sentinel := filepath.Join(tmpDir, SentinelFilename)
	if err := os.WriteFile(sentinel, []byte(version), 0o644); err != nil {
		_ = os.RemoveAll(tmpDir)
		return fmt.Errorf("engine: write sentinel: %w", err)
	}
	if err := os.RemoveAll(cacheDir); err != nil {
		_ = os.RemoveAll(tmpDir)
		return fmt.Errorf("engine: clean old cache: %w", err)
	}
	if err := os.Rename(tmpDir, cacheDir); err != nil {
		_ = os.RemoveAll(tmpDir)
		return fmt.Errorf("engine: promote tmp cache: %w", err)
	}
	return nil
}

func sentinelMatches(cacheDir, version string) bool {
	data, err := os.ReadFile(filepath.Join(cacheDir, SentinelFilename))
	if err != nil {
		return false
	}
	return string(data) == version
}

func extractAll(src fs.FS, dst string) error {
	return fs.WalkDir(src, ".", func(path string, d fs.DirEntry, err error) error {

View on GitHub (pinned to c7460f6114)

Solutions

  1. Remove the old cache directory manually and retry.
  2. Ensure no running process is using the old cache directory (close other MCP server instances), and check permissions.

When it happens

Trigger: Fires when the engine fails to clean a previous versioned cache directory, commonly because files are locked, owned by another user, or the directory was modified externally.

Common situations: See trigger scenarios.


AI-assisted analysis of mvanhorn/last30days-skill@c7460f6114 (2026-08-15). Data as JSON: /api/errors/7409d16d2c167799. Report an issue: GitHub.