{"record":{"id":"51ad21480bfbd2e5","repo":"mvanhorn/last30days-skill","slug":"engine-write-s-w","errorCode":null,"errorMessage":"engine: write %s: %w","messagePattern":"engine: write (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp/internal/engine/extract.go","lineNumber":141,"sourceCode":"\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)\n\nfunc getOnce(cacheDir string) *sync.Once {\n\tonceMu.Lock()\n\tdefer onceMu.Unlock()\n\tif o, ok := onceRegistry[cacheDir]; ok {\n\t\treturn o\n\t}\n\to := &sync.Once{}","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/mcp/internal/engine/extract.go#L123-L159","documentation":"Error \"engine: write %s: %w\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"Fires when the engine fails while writing payload bytes to a cache file, e.g. disk full, I/O error, or the file being removed mid-write by external cleanup.","commonSituations":"See trigger scenarios.","solutions":["Free disk space; a short write almost always means the filesystem is full.","Check filesystem quotas and permissions on the cache directory, then 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"}