{"record":{"id":"7409d16d2c167799","repo":"mvanhorn/last30days-skill","slug":"engine-clean-old-cache-w","errorCode":null,"errorMessage":"engine: clean old cache: %w","messagePattern":"engine: clean old cache: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp/internal/engine/extract.go","lineNumber":93,"sourceCode":"\ttmpDir := cacheDir + \".tmp\"\n\tif err := os.RemoveAll(tmpDir); err != nil {\n\t\treturn fmt.Errorf(\"engine: clean tmp cache: %w\", err)\n\t}\n\tif err := os.MkdirAll(tmpDir, 0o755); err != nil {\n\t\treturn fmt.Errorf(\"engine: create tmp cache (%s, set %s to override): %w\", tmpDir, CacheEnvOverride, err)\n\t}\n\tif err := extractAll(src, tmpDir); err != nil {\n\t\t_ = os.RemoveAll(tmpDir)\n\t\treturn err\n\t}\n\tsentinel := filepath.Join(tmpDir, SentinelFilename)\n\tif err := os.WriteFile(sentinel, []byte(version), 0o644); err != nil {\n\t\t_ = os.RemoveAll(tmpDir)\n\t\treturn fmt.Errorf(\"engine: write sentinel: %w\", err)\n\t}\n\tif err := os.RemoveAll(cacheDir); err != nil {\n\t\t_ = os.RemoveAll(tmpDir)\n\t\treturn fmt.Errorf(\"engine: clean old cache: %w\", err)\n\t}\n\tif err := os.Rename(tmpDir, cacheDir); err != nil {\n\t\t_ = os.RemoveAll(tmpDir)\n\t\treturn fmt.Errorf(\"engine: promote tmp cache: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc sentinelMatches(cacheDir, version string) bool {\n\tdata, err := os.ReadFile(filepath.Join(cacheDir, SentinelFilename))\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn string(data) == version\n}\n\nfunc extractAll(src fs.FS, dst string) error {\n\treturn fs.WalkDir(src, \".\", func(path string, d fs.DirEntry, err error) error {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/mcp/internal/engine/extract.go#L75-L111","documentation":"Error \"engine: clean old cache: %w\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Remove the old cache directory manually and retry.","Ensure no running process is using the old cache directory (close other MCP server instances), and check permissions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c7460f6114449ddfe6ea3fc2f23c3d910c0e740c","analyzedAt":"2026-08-15T03:34:49.540Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}