{"record":{"id":"27abc046693ef31c","repo":"affaan-m/ECC","slug":"missing-rendered-content-for-repair-operation-d","errorCode":null,"errorMessage":"Missing rendered content for repair: ${operation.destinationPath}","messagePattern":"Missing rendered content for repair: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-lifecycle.js","lineNumber":812,"sourceCode":"    if (operation.contentTransform || isMarkdownPath(operation.destinationPath)) {\n      const source = readFileWithMetadataNoFollow(sourcePath, 'utf8');\n      writeContainedFile(\n        operation.destinationPath,\n        getExpectedCopyFileContent(operation, source.content, linkIndex),\n        trustedRoot,\n        'repair',\n        source.mode & 0o777\n      );\n    } else {\n      copyContainedFile(sourcePath, operation.destinationPath, trustedRoot, 'repair');\n    }\n    return operation.destinationPath;\n  }\n\n  if (operation.kind === 'render-template') {\n    const renderedContent = getOperationTextContent(operation);\n    if (renderedContent === null) {\n      throw new Error(`Missing rendered content for repair: ${operation.destinationPath}`);\n    }\n\n    writeContainedFile(operation.destinationPath, renderedContent, trustedRoot, 'repair');\n    return operation.destinationPath;\n  }\n\n  if (operation.kind === 'merge-json') {\n    const payload = getOperationJsonPayload(operation);\n    if (payload === undefined) {\n      throw new Error(`Missing merge payload for repair: ${operation.destinationPath}`);\n    }\n\n    const existingDestination = getContainedExistingPath(operation.destinationPath, trustedRoot, 'repair');\n    const currentValue = existingDestination\n      ? readJsonNoFollow(\n        getManagedDestination(existingDestination, trustedRoot, 'repair').managedPath\n      )\n      : {};","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-lifecycle.js#L794-L830","documentation":"Thrown during repair execution when a 'render-template' operation has no rendered text content available (getOperationTextContent returns null). The repair path re-executes recorded install operations and requires the template's rendered output to exist; without it, the destination file cannot be rewritten.","triggerScenarios":"Calling the repair flow with an install-state record whose render-template operation lacks text content — e.g. the state was recorded by an older version that did not capture rendered output, or the operation object was constructed/parsed incompletely.","commonSituations":"Repairing after a plugin version upgrade changed the state schema; hand-editing or truncating the install-state JSON; running repair on a partial/corrupted state record.","solutions":["Re-run the install (install/update) to regenerate a complete install-state with rendered content, then repair","Check the install-state record's operation entries for missing text/content fields and regenerate them","Upgrade or downgrade to matching plugin/harness versions so state schema matches the repair code","Delete the stale install-state record and perform a fresh install"],"exampleFix":"// before: repairing with stale state lacking rendered content\nrepairFromRecord(oldRecord)\n// after: reinstall to regenerate state first\nconst record = await installAndUpdateState(manifest);\nrepairFromRecord(record);","handlingStrategy":"validation","validationCode":"const repairable = record.state.operations.every(op => op.kind !== 'render-template' || op.text != null);\nif (!repairable) throw new Error('state has render-template ops without rendered content; reinstall first');","typeGuard":"function hasRenderedContent(op) { return op.kind !== 'render-template' || (op != null && typeof op.text === 'string'); }","tryCatchPattern":"try { repairFromRecord(record); } catch (e) { if (String(e.message).startsWith('Missing rendered content')) { await reinstall(); } else throw e; }","preventionTips":["Never hand-edit install-state JSON","Regenerate state via install before repairing after upgrades","Keep installer versions consistent between write and repair"],"tags":["install","repair","missing-content"],"backgroundTag":"empty-required-field","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"}