{"record":{"id":"e0b4a090bfa2b57b","repo":"mvanhorn/last30days-skill","slug":"engine-ensure-parent-of-s-w","errorCode":null,"errorMessage":"engine: ensure parent of %s: %w","messagePattern":"engine: ensure parent of (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp/internal/engine/extract.go","lineNumber":133,"sourceCode":"\t\tif path == \".\" {\n\t\t\treturn nil\n\t\t}\n\t\ttarget := filepath.Join(dst, path)\n\t\tif d.IsDir() {\n\t\t\treturn os.MkdirAll(target, 0o755)\n\t\t}\n\t\treturn copyEmbeddedFile(src, path, target)\n\t})\n}\n\nfunc copyEmbeddedFile(src fs.FS, srcPath, dst string) error {\n\tin, err := src.Open(srcPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"engine: open %s: %w\", srcPath, err)\n\t}\n\tdefer func() { _ = in.Close() }()\n\tif err := os.MkdirAll(filepath.Dir(dst), 0o755); err != nil {\n\t\treturn fmt.Errorf(\"engine: ensure parent of %s: %w\", dst, err)\n\t}\n\tout, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"engine: create %s: %w\", dst, err)\n\t}\n\tdefer func() { _ = out.Close() }()\n\tif _, err := io.Copy(out, in); err != nil {\n\t\treturn fmt.Errorf(\"engine: write %s: %w\", dst, err)\n\t}\n\treturn nil\n}\n\n// onceRegistry serializes first-call extraction per cache directory so the\n// rename in ensureLocked happens exactly once across goroutines.\nvar (\n\tonceMu       sync.Mutex\n\tonceRegistry = map[string]*sync.Once{}\n)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/mcp/internal/engine/extract.go#L115-L151","documentation":"Error \"engine: ensure parent of %s: %w\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"Fires when the engine cannot create the parent directory of a file it is about to write into the cache, usually due to unwritable cache-root permissions.","commonSituations":"See trigger scenarios.","solutions":["Ensure the cache directory tree is writable by the current user.","Set LAST30DAYS_CACHE_DIR to a writable location and retry."],"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"}