abhigyanpatwari/GitNexus · warning

parsedfile-cache: could not reset durable chunk generation…

Error message

parsedfile-cache: could not reset durable chunk generation; continuing

What it means

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.

Solutions

  1. Check the logged { err } — EACCES/EPERM points to permissions, ENOSPC to disk space
  2. chown/chmod the durable cache directory so the indexing user can write it
  3. Free disk space or move the cache to a volume with headroom
  4. Delete the stale chunk generation (the warn includes the chunkHash prefix) or clear the cache once
  5. Otherwise ignore it — analyze results are unaffected; only cache freshness for this run degrades

Example fix

# before: cache dir owned by root, analyze runs as ci-user -> EACCES warn
chown -R root:root <durable-parsedfile-dir>  # wrong owner

# after: hand the cache to the indexing user, then re-run
chown -R ci-user:ci-user <durable-parsedfile-dir> && npx gitnexus analyze
Defensive patterns

Strategy: fallback

Validate before calling

// preflight before analyze: writable cache dir with free space
import fs from 'node:fs';
fs.accessSync(durableParsedFileDir, fs.constants.W_OK); // throws EACCES early, with a clear cause
assertFreeSpace(durableParsedFileDir, 512 * 1024 * 1024);

Try / catch

try {
  await prepareDurableParsedFileChunk(durableParsedFileDir, chunkHash);
} catch (err) {
  logger.warn({ err, chunkHash: chunkHash.slice(0, 8) }, 'parsedfile-cache: could not reset durable chunk generation; continuing');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@ac9a4e9abd (2026-08-20). Data as JSON: /api/errors/73fc754baf33ed23. Report an issue: GitHub.

Appendix: source

Thrown at gitnexus/src/core/ingestion/pipeline-phases/parse-impl.ts:1121

            logger.info(
              `📦 parse-cache SKIP: chunk ${p.chunkIdx + 1}/${numChunks} ` +
                `had ${quarantinedInChunk} worker-quarantined file(s); ` +
                `next run will rediscover (${p.chunkHash.slice(0, 8)})`,
            );
          }
        } else if (rawResults.length > 0) {
          await persistParseCacheChunk(parseCache, p.chunkHash, rawResults);
          if (isDev) {
            logger.info(
              `📦 parse-cache MISS+store: chunk ${p.chunkIdx + 1}/${numChunks} (${p.chunkFiles.length} files, ${p.chunkHash.slice(0, 8)})`,
            );
          }
        }
      }
      await applyChunkResults(chunkWorkerData, p.chunkIdx, p.chunkFiles.length, p.chunkStartMs);
    };

    /**
     * Dispatch a round's cache misses as ONE pool round. Returns the parked
     * round; the caller drains it after starting the next one so the workers
     * parse round N+1 while the main thread merges round N (the same overlap
     * the per-chunk loop had, at round granularity).
     */
    const startRound = async (
      entries: RoundEntry[],
    ): Promise<{ entries: RoundEntry[]; results: Promise<ParseWorkerResult[][]> } | null> => {
      if (entries.length === 0) return null;
      const misses = entries.filter((entry) => entry.kind === 'miss');
      if (misses.length === 0) {
        return { entries, results: Promise.resolve([]) };
      }
      // Each chunk resets its own directory, so these are independent and run
      // concurrently: serially they would sit on the critical path this round
      // exists to shorten, with the pool idle and the previous round's merge
      // waiting, once per miss.
      //

View on GitHub (pinned to ac9a4e9abd)