{"record":{"id":"4f59fad9d777eb6c","repo":"paperclipai/paperclip","slug":"plugin-not-found-pluginid","errorCode":null,"errorMessage":"Plugin not found: ${pluginId}","messagePattern":"Plugin not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-database.ts","lineNumber":362,"sourceCode":"}\n\ntype PluginDatabaseClient = Pick<Db, \"select\" | \"insert\" | \"update\" | \"execute\">;\ntype PluginDatabaseRootClient = PluginDatabaseClient & Partial<Pick<Db, \"transaction\">>;\n\nexport interface ApplyPluginMigrationsOptions {\n  /**\n   * Persist failed migration ledger rows. Fresh install uses false because the\n   * caller owns a larger transaction and must roll back the plugin row and\n   * namespace together.\n   */\n  persistFailure?: boolean;\n}\n\nexport function pluginDatabaseService(db: PluginDatabaseRootClient) {\n  async function getPluginRecord(pluginId: string) {\n    const rows = await db.select().from(plugins).where(eq(plugins.id, pluginId)).limit(1);\n    const plugin = rows[0];\n    if (!plugin) throw new Error(`Plugin not found: ${pluginId}`);\n    return plugin;\n  }\n\n  async function ensureNamespaceWithClient(\n    client: PluginDatabaseClient,\n    pluginId: string,\n    manifest: PaperclipPluginManifestV1,\n  ) {\n    if (!manifest.database) return null;\n    const namespaceName = derivePluginDatabaseNamespace(\n      manifest.id,\n      manifest.database.namespaceSlug,\n    );\n    await client.execute(sql.raw(`CREATE SCHEMA IF NOT EXISTS ${quoteIdentifier(namespaceName)}`));\n    const rows = await client\n      .insert(pluginDatabaseNamespaces)\n      .values({\n        pluginId,","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-database.ts#L344-L380","documentation":"Lookup guard in getPluginRecord: no plugin row exists for the given pluginId in the registry. Generic sentinel for any plugin-scoped database operation (migrations, namespace, runtime) targeting an unknown or already-uninstalled plugin; the bad pluginId is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-database.ts:362 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the plugin id is installed for the company; install the plugin first if needed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}