{"record":{"id":"1a490f56d9973fdc","repo":"mvanhorn/last30days-skill","slug":"engine-promote-tmp-cache-w","errorCode":null,"errorMessage":"engine: promote tmp cache: %w","messagePattern":"engine: promote tmp cache: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp/internal/engine/extract.go","lineNumber":97,"sourceCode":"\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 {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif path == \".\" {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/mcp/internal/engine/extract.go#L79-L115","documentation":"Error \"engine: promote tmp cache: %w\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"Fires when the engine cannot atomically promote the temporary cache directory to its final versioned location, e.g. on cross-device renames, permission denial, or a conflicting existing directory.","commonSituations":"See trigger scenarios.","solutions":["On Windows, close any process that has files open inside the cache directory; rename cannot replace an in-use directory.","Ensure the cache parent directory is writable and retry.","If antivirus is scanning the new directory, add an exclusion or retry after a moment."],"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-15T17:31:12.345Z"}