{"record":{"id":"73fc754baf33ed23","repo":"abhigyanpatwari/GitNexus","slug":"parsedfile-cache-could-not-reset-durable-chunk-ge","errorCode":null,"errorMessage":"parsedfile-cache: could not reset durable chunk generation; continuing","messagePattern":"parsedfile-cache: could not reset durable chunk generation; continuing","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitnexus/src/core/ingestion/pipeline-phases/parse-impl.ts","lineNumber":1081,"sourceCode":"            nodesCreated: graph.nodeCount,\n          },\n        });\n        // The durable gate already snapshotted warm `.v8` shards into the\n        // run-scoped store for scope resolution.\n        await applyChunkResults(chunkWorkerData, chunkIdx, chunkFiles, chunkStartMs);\n      } else {\n        // Cache miss: dispatch to workers, capture the raw results, store\n        // them under the chunk hash for the next run.\n        chunkCacheMisses++;\n        reparsedFileCount += chunkFiles.length;\n        if (durableParsedFileDir !== undefined && chunkHash !== null) {\n          try {\n            await prepareDurableParsedFileChunk(durableParsedFileDir, chunkHash);\n          } catch (err) {\n            // The durable store is an optimization — degrade like the restore\n            // path does instead of failing the analyze. Workers recreate the\n            // directory on write, so at worst the old generation lingers.\n            logger.warn(\n              { err, chunkHash: chunkHash.slice(0, 8) },\n              'parsedfile-cache: could not reset durable chunk generation; continuing',\n            );\n          }\n        }\n        const progressForChunk = (current: number, _total: number, filePath: string) => {\n          const globalCurrent = filesParsedSoFar + current;\n          // Parse phase covers 20-70 (M2). Deferred extraction handles 70-95.\n          const parsingProgress = 20 + (globalCurrent / totalParseable) * 50;\n          onProgress({\n            phase: 'parsing',\n            percent: Math.round(parsingProgress),\n            message: `Parsing chunk ${chunkIdx + 1}/${numChunks}...`,\n            detail: filePath,\n            stats: {\n              filesProcessed: globalCurrent,\n              totalFiles: totalParseable,\n              nodesCreated: graph.nodeCount,","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/52924ef12c2290ceee4612526a828ec4cdf2047f/gitnexus/src/core/ingestion/pipeline-phases/parse-impl.ts#L1063-L1099","documentation":"With the durable parsed-file cache enabled, the parse phase stores each chunk's raw worker results on disk keyed by chunk hash. On a cache miss it calls prepareDurableParsedFileChunk(durableParsedFileDir, chunkHash) to reset that chunk's directory before workers write a fresh generation; if that reset throws (permissions, ENOSPC, stale lock, directory removed concurrently), the catch warns 'parsedfile-cache: could not reset durable chunk generation; continuing' and the analyze proceeds — the cache is an optimization, workers recreate the directory on write, and at worst the old generation lingers.","triggerScenarios":"The durable cache directory being unwritable (EACCES/EPERM, read-only mount), the disk being full (ENOSPC), a stale lock/ownership left by a previous run under another user, or the cache being wiped while the analyze runs.","commonSituations":"CI pipelines mounting a cache volume read-only or root-owned; cache dir created by root then reused by a non-root user; disk pressure on the cache drive; cache cleaned concurrently by another job.","solutions":["Check the logged { err } — EACCES/EPERM points to permissions, ENOSPC to disk space","chown/chmod the durable cache directory so the indexing user can write it","Free disk space or move the cache to a volume with headroom","Delete the stale chunk generation (the warn includes the chunkHash prefix) or clear the cache once","Otherwise ignore it — analyze results are unaffected; only cache freshness for this run degrades"],"exampleFix":"# before: cache dir owned by root, analyze runs as ci-user -> EACCES warn\nchown -R root:root <durable-parsedfile-dir>  # wrong owner\n\n# after: hand the cache to the indexing user, then re-run\nchown -R ci-user:ci-user <durable-parsedfile-dir> && npx gitnexus analyze","handlingStrategy":"fallback","validationCode":"// preflight before analyze: writable cache dir with free space\nimport fs from 'node:fs';\nfs.accessSync(durableParsedFileDir, fs.constants.W_OK); // throws EACCES early, with a clear cause\nassertFreeSpace(durableParsedFileDir, 512 * 1024 * 1024);","typeGuard":null,"tryCatchPattern":"try {\n  await prepareDurableParsedFileChunk(durableParsedFileDir, chunkHash);\n} catch (err) {\n  logger.warn({ err, chunkHash: chunkHash.slice(0, 8) }, 'parsedfile-cache: could not reset durable chunk generation; continuing');\n}","preventionTips":["Own the durable cache directory with the same user that runs analyze","Do not mount the cache volume read-only in CI","Monitor disk space on the cache drive (ENOSPC is the other common cause)","Treat this warn as cache-only: analyze correctness is unaffected"],"tags":["cache","filesystem","permissions","disk-full","ingestion"],"backgroundTag":"disk-cache-write-failed","analyzedSha":"52924ef12c2290ceee4612526a828ec4cdf2047f","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}