JuliusBrussee/caveman · error · Error

${agent} ${serverName} MCP transaction lost one durable jour

Error message

${agent} ${serverName} MCP transaction lost one durable journal copy; refusing destructive recovery

What it means

Recovery guard for an interrupted MCP ownership transaction: the journal exists and hashes match, but one of the two durable pending copies (config pending or locator/journal pending) is missing. The transaction protocol requires both copies to recover safely, so destructive recovery is refused rather than guessing.

Source

Thrown at packages/cli/src/index.ts:12479

    if (configPending) durableUnlink(configPendingPath);
    if (locatorPending) durableUnlink(locatorPath);
  };

  if (configIsAfter && markerIsAfter) {
    removePendingCopies();
    process.stderr.write(`${mark("warn")} finalized interrupted ${agent} ${serverName} MCP transaction\n`);
    return "finalized";
  }
  if (configIsBefore && markerIsBefore) {
    removePendingCopies();
    process.stderr.write(`${mark("warn")} discarded uncommitted ${agent} ${serverName} MCP transaction\n`);
    return "discarded";
  }
  if ((!configIsBefore && !configIsAfter) || (!markerIsBefore && !markerIsAfter)) {
    throw new Error(`${agent} ${serverName} MCP config or ownership journal changed during interrupted transaction; refusing destructive recovery`);
  }
  if (!configPending || !locatorPending) {
    throw new Error(`${agent} ${serverName} MCP transaction lost one durable journal copy; refusing destructive recovery`);
  }

  if (!configIsBefore) {
    durableReplaceFileIfUnchanged(configPath, configCurrent, configBefore, journal.config_before_mode);
  }
  if (!markerIsBefore) {
    durableReplaceFileIfUnchanged(markerPath, markerCurrent, markerBefore, journal.marker_before_mode);
  }
  if (optionalBytesHash(fileBytes(configPath)) !== journal.config_before_sha256
    || optionalBytesHash(fileBytes(markerPath)) !== journal.marker_before_sha256) {
    throw new Error(`${agent} ${serverName} MCP rollback postflight mismatch`);
  }
  removePendingCopies();
  process.stderr.write(`${mark("warn")} rolled back interrupted ${agent} ${serverName} MCP transaction\n`);
  return "rolled-back";
}

function transactOwnedMcpConfig(

View on GitHub (pinned to 5184b3d11a)

Solutions

  1. Manually restore the missing pending copy from the journal's recorded before/after hashes, then re-run to let recovery complete
  2. Remove the journal and reconcile the config and ownership marker by hand, then retry the managed install
  3. Check for disk-full or permission errors that prevented the second durable copy from being written
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cli/src/index.ts:12479 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@5184b3d11a (2026-09-06). Data as JSON: /api/errors/3f01147cfa0a6dbd. Report an issue: GitHub.