{"record":{"id":"e9066a1b757f1b6c","repo":"paperclipai/paperclip","slug":"previous-payload-is-missing-target-payloadpath","errorCode":null,"errorMessage":"Previous payload is missing: ${target.payloadPath}","messagePattern":"Previous payload is missing: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/update.ts","lineNumber":133,"sourceCode":"}\n\nexport function resolveUpdateRequest(manifest: InstallManifest | null, options: Pick<UpdateOptions, \"canary\" | \"latest\" | \"version\">): { spec: string; channel: InstallChannel; explicit: boolean } {\n  const selected = Number(Boolean(options.canary)) + Number(Boolean(options.latest)) + Number(Boolean(options.version));\n  if (selected > 1) throw new Error(\"Choose only one of --latest, --canary, or --version.\");\n  if (options.version) return { spec: options.version.trim(), channel: \"pinned\", explicit: true };\n  if (options.canary) return { spec: \"canary\", channel: \"canary\", explicit: true };\n  if (options.latest) return { spec: \"latest\", channel: \"latest\", explicit: true };\n  if (manifest?.channel === \"pinned\") return { spec: manifest.version, channel: \"pinned\", explicit: false };\n  const channel = manifest?.channel === \"canary\" ? \"canary\" : \"latest\";\n  return { spec: channel, channel, explicit: false };\n}\n\nexport function rollbackManagedInstall(paths = resolveInstallStorePaths()): InstallManifest {\n  const manifest = readInstallManifest(paths);\n  if (!manifest) throw new Error(\"No managed install was found to roll back.\");\n  const target = manifest.previous[0];\n  if (!target) throw new Error(\"No previous managed payload is available for rollback.\");\n  if (!fs.existsSync(target.payloadPath)) throw new Error(`Previous payload is missing: ${target.payloadPath}`);\n  const current: InstallRecord = { source: manifest.source, version: manifest.version, channel: manifest.channel, payloadPath: manifest.payloadPath, repo: manifest.repo, ref: manifest.ref, sha: manifest.sha, installedAt: manifest.installedAt };\n  const next: InstallManifest = { schemaVersion: manifest.schemaVersion, ...target, previous: [current, ...manifest.previous.slice(1)].slice(0, 2) };\n  const oldTarget = fs.readlinkSync(paths.currentPath);\n  flipCurrentAtomic(target.payloadPath, paths);\n  try { writeInstallManifestAtomic(next, paths); } catch (error) { flipCurrentAtomic(path.resolve(paths.cliRoot, oldTarget), paths); throw error; }\n  return next;\n}\n\nasync function defaultConfirm(message: string): Promise<boolean> {\n  if (!process.stdin.isTTY || !process.stdout.isTTY) return false;\n  const answer = await p.confirm({ message, initialValue: false });\n  return !p.isCancel(answer) && answer === true;\n}\nfunction emit(options: UpdateOptions, value: Record<string, unknown>, message: string): void { if (options.json) console.log(JSON.stringify(value, null, 2)); else console.log(message); }\n\nasync function rollbackAfterServiceValidationFailure(\n  paths: InstallStorePaths,\n  restartActiveService: (expectedVersion: string) => Promise<boolean>,","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/update.ts#L115-L151","documentation":"Rollback selected a previous payload record whose payloadPath no longer exists on disk, so the roll back target is unavailable.","triggerScenarios":"Thrown at cli/src/commands/update.ts:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reinstall the previous version explicitly with --version, since the recorded payload is missing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}