affaan-m/ECC · error
No install-state available for repair
Error message
No install-state available for repair
What it means
createRepairPlanFromRecord requires the record to contain a saved `state` object; without it there are no recorded operations from which to build a repair plan, so repair is impossible and this error is thrown.
Solutions
- Run a fresh install so a complete install-state is persisted, then repair
- Point the repair flow at the correct record containing saved state
- Restore the install-state file from backup
- If legacy layout is 'opencode', use the legacy repair path instead
Example fix
// before
const plan = createRepairPlanFromRecord({ legacyLayout: 'npm' });
// after
const plan = record.state
? createRepairPlanFromRecord(record)
: createRepairPlanFromFreshInstall(manifest); Defensive patterns
Strategy: validation
Validate before calling
if (!record?.state) throw new Error('record has no install-state; run install first'); Type guard
function hasInstallState(record) { return record != null && record.state != null && typeof record.state === 'object'; } Try / catch
try { createRepairPlanFromRecord(record); } catch (e) { if (e.message === 'No install-state available for repair') { await freshInstallThenRepair(); } else throw e; } Prevention
- Only repair records that completed an install with persisted state
- Back up install-state files
- Detect legacy 'opencode' layout and use legacy repair path
When it happens
Trigger: Calling the repair flow with a record object that has state === null/undefined — e.g. a record loaded from an install that never persisted state, or a freshly created/empty record.
Common situations: Repairing before the first completed install; state file deleted or corrupted; reading a legacy record that predates state persistence.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Missing merge payload for repair
- Missing rendered content for repair
- Unsupported repair operation kind
- A normalized install request is required
- An unqualified or incompatible Nasiko executable or receipt…
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/f40e39f15deca2e2.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/lib/install-lifecycle.js:1808
okCount: 0,
errorCount: 0,
warningCount: 0
}
);
return {
generatedAt: new Date().toISOString(),
packageVersion: context.packageVersion,
manifestVersion: context.manifestVersion,
results,
summary
};
}
function createRepairPlanFromRecord(record, context, options = {}) {
const state = record.state;
if (!state) {
throw new Error('No install-state available for repair');
}
if (
record.legacyLayout !== 'opencode'
&& (state.request.legacyMode || shouldRepairFromRecordedOperations(state))
) {
const operations = hydrateRecordedOperations(
context.repoRoot,
getManagedOperations(state),
record.targetRoot
);
const statePreview = buildRecordedStatePreview(state, context, operations);
return {
mode: state.request.legacyMode ? 'legacy' : 'recorded',
target: record.adapter.target,
adapter: record.adapter,
targetRoot: state.target.root,View on GitHub (pinned to 8321021c54)