{"record":{"id":"2c77a31a36ae117d","repo":"paperclipai/paperclip","slug":"managed-install-metadata-is-missing","errorCode":null,"errorMessage":"Managed install metadata is missing.","messagePattern":"Managed install metadata is missing\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/update.ts","lineNumber":247,"sourceCode":"      try {\n        fs.writeFileSync(npmUserConfigPath, `registry=${PUBLIC_NPM_REGISTRY}\\n@paperclipai:registry=${PUBLIC_NPM_REGISTRY}\\n`, { mode: 0o600 });\n        await runCommand(\"npm\", args, {\n          env: {\n            ...process.env,\n            npm_config_registry: PUBLIC_NPM_REGISTRY,\n            NPM_CONFIG_REGISTRY: PUBLIC_NPM_REGISTRY,\n            npm_config_userconfig: npmUserConfigPath,\n            NPM_CONFIG_USERCONFIG: npmUserConfigPath,\n          },\n          maxBuffer: 16 * 1024 * 1024,\n        });\n      } finally {\n        fs.rmSync(npmConfigDir, { recursive: true, force: true });\n      }\n    }\n    emit(options, { mode, action: \"update\", targetVersion, dryRun: Boolean(options.dryRun), command: [\"npm\", ...args] }, options.dryRun ? \"Dry run complete.\" : pc.green(`Updated global npm install to ${targetVersion}.`)); return;\n  }\n  if (!manifest) throw new Error(\"Managed install metadata is missing.\");\n  if (comparison === 0) { emit(options, { mode, currentVersion, targetVersion, changed: false }, `paperclipai ${targetVersion} is already active.`); return; }\n  if (comparison < 0 && options.yes !== true) { const confirmed = await (overrides.confirm ?? defaultConfirm)(`Downgrade paperclipai from ${currentVersion} to ${targetVersion}?`); if (!confirmed) throw new Error(\"Downgrade cancelled. Re-run with --yes to confirm explicitly.\"); }\n  if (options.dryRun) { emit(options, { mode, currentVersion, targetVersion, action: comparison < 0 ? \"downgrade\" : \"update\", backup: options.backup !== false, dryRun: true }, `Would ${comparison < 0 ? \"downgrade\" : \"update\"} paperclipai ${currentVersion} → ${targetVersion}${options.backup === false ? \" without a backup\" : \" after a database backup\"}.`); return; }\n  if (options.backup !== false) await runPreUpdateBackup(options, overrides.backup ?? (() => dbBackupCommand({})), overrides.hasInstanceData);\n  const installed = await withInstallStoreLock(async () => {\n    assertManagedShimWritable(paths);\n    const payload = await installNpmPayload(targetVersion, runCommand, paths);\n    writeManagedShim(paths);\n    const record: InstallRecord = { source: \"npm\", version: targetVersion, channel: request.channel, payloadPath: payload.payloadPath, installedAt: (overrides.now?.() ?? new Date()).toISOString() };\n    const next = buildNextManifest(record, manifest); const oldTarget = fs.readlinkSync(paths.currentPath); flipCurrentAtomic(payload.payloadPath, paths);\n    try { writeInstallManifestAtomic(next, paths); } catch (error) { flipCurrentAtomic(path.resolve(paths.cliRoot, oldTarget), paths); throw error; }\n    pruneInstallPayloads(next, paths); return payload;\n  }, paths);\n  let restarted: boolean;\n  try {\n    restarted = await (overrides.restartActiveService ?? restartActiveManagedService)(targetVersion);\n  } catch (error) {\n    return rollbackAfterServiceValidationFailure(","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/update.ts#L229-L265","documentation":"updateCommand is in managed mode but readInstallManifest returned null, so the managed install's metadata is absent and no update can be planned.","triggerScenarios":"Thrown at cli/src/commands/update.ts:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reinstall the managed payload to regenerate install metadata."],"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-23T08:17:48.524Z"}