{"record":{"id":"435ba70634d5efcb","repo":"affaan-m/ECC","slug":"error-message-install-state-checkpoint-also-fai","errorCode":null,"errorMessage":"${error.message} Install-state checkpoint also failed: ${checkpointError.message}","messagePattern":"(.+?) Install-state checkpoint also failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"scripts/lib/install/apply.js","lineNumber":631,"sourceCode":"            plan.installStatePath,\n            stateWithContentDigests(\n              preserveUnwrittenFiles(\n                hookRemovalCount > 0 && completedHookRemovalCount === hookRemovalCount\n                  ? migration.finalState\n                  : migration.bridgeState,\n                migration,\n                writtenDestinations\n              ),\n              {\n                ...appliedPlan,\n                operations: appliedPlan.operations.filter(operation => (\n                  writtenDestinations.has(operation.destinationPath)\n                )),\n              }\n            )\n          );\n        } catch (checkpointError) {\n          throw new Error(\n            `${error.message} Install-state checkpoint also failed: ${checkpointError.message}`,\n            { cause: error }\n          );\n        }\n      }\n      throw error;\n    }\n    let antigravityMigrationWarnings = [];\n  try {\n    const antigravityMigration = cleanupLegacyAntigravityInstall(appliedPlan);\n    if (antigravityMigration.detected && !antigravityMigration.complete) {\n      antigravityMigrationWarnings = [\n        'Legacy Antigravity migration is incomplete. ECC preserved modified, unverifiable, or unmanaged content under .agent; review and move anything you want to keep, then rerun the Antigravity install.',\n        ...(Array.isArray(antigravityMigration.warnings) ? antigravityMigration.warnings : []),\n      ];\n    }\n  } catch (error) {\n    antigravityMigrationWarnings = [","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/apply.js#L613-L649","documentation":"applyInstallPlanLocked writes an install-state checkpoint after operations so state stays consistent with disk. If the original operation already failed and the checkpoint write also fails, the library wraps both failures into a single error preserving the original via cause, so you know the operation failed AND state could not be checkpointed.","triggerScenarios":"An operation in applyInstallPlanLocked throws, and the subsequent best-effort checkpoint of install state (recording writtenDestinations) throws as well — the aggregate error message concatenates both messages.","commonSituations":"Disk full or read-only filesystem causing both the operation and the state-file write to fail; permission problems on the state directory; the settings write failed due to lock contention and the state dir is also unwritable.","solutions":["Read error.cause to see the original operation failure and fix that first (e.g. free disk space, fix permissions).","Fix the checkpoint failure separately: check write permissions and free space for the install-state location.","Re-run the install after resolving; verify install state matches what was actually written."],"exampleFix":"// before\ntry { apply(plan) } catch (e) { console.log(e.message) } // truncated, hides cause\n// after\ntry { apply(plan) } catch (e) { console.error(e.message, e.cause ?? e) }","handlingStrategy":"try-catch","validationCode":"// preflight writable state dir\nfs.accessSync(stateDir, fs.constants.W_OK);\nfs.statSync(stateDir);","typeGuard":null,"tryCatchPattern":"try {\n  await applyInstallPlan(plan);\n} catch (e) {\n  console.error(e.message);\n  if (e.cause) console.error('root cause:', e.cause.message); // fix the original failure first\n  throw e;\n}","preventionTips":["Ensure disk space and write permissions for both destinations and the install-state directory.","Always inspect error.cause on aggregate installer errors.","Run installers as a user with write access to ~/.claude and the state location."],"tags":["installer","state","checkpoint","filesystem"],"backgroundTag":"file-write-failed","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}